Java Code Examples for com.vaadin.data.Property#ValueChangeEvent

The following examples show how to use com.vaadin.data.Property#ValueChangeEvent . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DurationField.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public void valueChange(final Property.ValueChangeEvent event) {
    // do not delete this method, even when removing the code inside this
    // method. This method overwrites the super method, which is
    // necessary, that parsing works correctly on pressing enter key

    if (!(event.getProperty() instanceof DurationField)) {
        return;
    }
    final Date value = (Date) event.getProperty().getValue();

    // setValue() calls valueChanged again, when the minimum is greater
    // than the maximum this can lead to an endless loop
    if (value != null && minimumDuration != null && maximumDuration != null
            && minimumDuration.before(maximumDuration)) {

        if (compareTimeOfDates(value, maximumDuration) > 0) {
            ((DateField) event.getProperty()).setValue(maximumDuration);
        }

        if (compareTimeOfDates(minimumDuration, value) > 0) {
            ((DateField) event.getProperty()).setValue(minimumDuration);
        }
    }
}
 
Example 2
Source File: RolloutConfigurationView.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void valueChange(final Property.ValueChangeEvent event) {
    if (approvalCheckbox.equals(event.getProperty())) {
        if (approvalCheckbox.getValue()) {
            approvalConfigurationItem.configEnable();
        } else {
            approvalConfigurationItem.configDisable();
        }
        notifyConfigurationChanged();
    }
}
 
Example 3
Source File: WinServiceAdd.java    From primecloud-controller with GNU General Public License v2.0 5 votes vote down vote up
private void serviceTableSelect(Property.ValueChangeEvent event) {
    // 選択がない場合はサーバ選択をクリア
    if (serviceTable.getValue() == null) {
        serverSelect.removeAllItems();
        return;
    }

    // 選択されたサービス種類で利用可能なサーバ情報を選択画面に表示
    ComponentTypeDto componentType = findComponentType(serviceTable.getValue());
    serverSelect.show(instances, componentType.getInstanceNos());
}
 
Example 4
Source File: WinLoadBalancerEdit.java    From primecloud-controller with GNU General Public License v2.0 5 votes vote down vote up
private void checkProtocolValueChange(Property.ValueChangeEvent event) {
    if ("HTTP".equals(checkProtocolSelect.getValue())) {
        checkPathField.setEnabled(true);
    } else {
        checkPathField.setValue("");
        checkPathField.setEnabled(false);
    }
}
 
Example 5
Source File: WinServerAdd.java    From primecloud-controller with GNU General Public License v2.0 5 votes vote down vote up
private void cloudTableSelect(Property.ValueChangeEvent event) {
    // 選択がない場合はサーバ種別情報をクリア
    if (cloudTable.getValue() == null) {
        imageTable.removeAllItems();
        return;
    }

    // サーバ種別情報を表示
    PlatformDto platform = findPlatform(cloudTable.getValue());
    imageTable.show(platform.getImages());
    imageTable.selectFirst();
}
 
Example 6
Source File: WinServerAdd.java    From primecloud-controller with GNU General Public License v2.0 5 votes vote down vote up
private void imageTableSelect(Property.ValueChangeEvent event) {
    // 選択したサービスをクリア
    selectedComponentNos = null;

    if (serviceTable == null) {
        return;
    }

    // 選択がない場合はサービス情報をクリア
    if (cloudTable.getValue() == null || imageTable.getValue() == null) {
        serviceTable.removeAllItems();
        serviceTable.setCaption("");
        attachButton.setEnabled(false);
        return;
    }

    // サービス情報を表示
    ImageDto image = findImage(cloudTable.getValue(), imageTable.getValue());
    serviceTable.show(image.getComponentTypes());

    // サービス情報テーブルのキャプションを変更
    String caption = "「" + image.getImage().getImageNameDisp() + "」で利用できるサービス";
    serviceTable.setCaption(caption);

    // サービス選択ボタンを状態を変更
    if (image.getComponentTypes().size() > 0) {
        attachButton.setEnabled(true);
    } else {
        attachButton.setEnabled(false);
    }
}
 
Example 7
Source File: WinLoadBalancerConfigListener.java    From primecloud-controller with GNU General Public License v2.0 5 votes vote down vote up
private void protocolValueChange(Property.ValueChangeEvent event) {
    if ("HTTPS".equals(protocolSelect.getValue()) || "SSL".equals(protocolSelect.getValue())) {
        sslKeySelect.setEnabled(true);
    } else {
        sslKeySelect.setEnabled(false);
    }
}
 
Example 8
Source File: WinLoadBalancerAdd.java    From primecloud-controller with GNU General Public License v2.0 5 votes vote down vote up
private void cloudTableSelect(Property.ValueChangeEvent event) {
    // 選択がない場合はロードバランサ種別情報をクリア
    if (cloudTable.getValue() == null) {
        typeTable.removeAllItems();
        return;
    }

    // ロードバランサ種別情報を表示
    LoadBalancerPlatformDto platform = findPlatform(cloudTable.getValue());
    typeTable.show(platform.getTypes());
    typeTable.selectFirst();
}
 
Example 9
Source File: WinServerNetworkConfig.java    From primecloud-controller with GNU General Public License v2.0 5 votes vote down vote up
private void changeNetwork(Property.ValueChangeEvent event) {
    NetworkDto network = (NetworkDto) networkSelect.getValue();
    if (network != null) {
        ipModeSelect.setValue("POOL");

        netmaskField.setReadOnly(false);
        netmaskField.setValue(network.getNetmask());
        netmaskField.setReadOnly(true);

        gateWayField.setReadOnly(false);
        gateWayField.setValue(network.getGateWay());
        gateWayField.setReadOnly(true);

        dns1Field.setReadOnly(false);
        dns1Field.setValue(network.getDns1());
        dns1Field.setReadOnly(true);

        dns2Field.setReadOnly(false);
        dns2Field.setValue(network.getDns2());
        dns2Field.setReadOnly(true);
    } else {
        ipModeSelect.setValue("POOL");

        netmaskField.setReadOnly(false);
        netmaskField.setValue("");
        netmaskField.setReadOnly(true);

        gateWayField.setReadOnly(false);
        gateWayField.setValue("");
        gateWayField.setReadOnly(true);

        dns1Field.setReadOnly(false);
        dns1Field.setValue("");
        dns1Field.setReadOnly(true);

        dns2Field.setReadOnly(false);
        dns2Field.setValue("");
        dns2Field.setReadOnly(true);
    }
}
 
Example 10
Source File: WinServerNetworkConfig.java    From primecloud-controller with GNU General Public License v2.0 5 votes vote down vote up
private void changeIpMode(Property.ValueChangeEvent event) {
    String ipMode = (String) ipModeSelect.getValue();
    if (StringUtils.isNotEmpty(ipMode)) {
        if ("MANUAL".equals(ipMode)) {
            ipAddressField.setReadOnly(false);
            ipAddressField.setValue("");
            ipAddressField.setRequired(true);
        } else {
            ipAddressField.setReadOnly(false);
            ipAddressField.setValue("");
            ipAddressField.setReadOnly(true);
            ipAddressField.setRequired(false);
        }
    }
}