本文整理匯總了Java中com.vaadin.data.Property.ValueChangeEvent類的典型用法代碼示例。如果您正苦於以下問題:Java ValueChangeEvent類的具體用法?Java ValueChangeEvent怎麽用?Java ValueChangeEvent使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ValueChangeEvent類屬於com.vaadin.data.Property包,在下文中一共展示了ValueChangeEvent類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getView
import com.vaadin.data.Property.ValueChangeEvent; //導入依賴的package包/類
@Override
public Component getView(final WidgetContext widgetContext) {
Tree tree = new Tree("Services", new FilterableHierarchicalContainer(new NCSServiceContainer(m_ncsComponentRepository)));
tree.setMultiSelect(true);
tree.setImmediate(true);
tree.setItemCaptionMode(Tree.ITEM_CAPTION_MODE_PROPERTY);
tree.setItemCaptionPropertyId("name");
tree.addListener(new ValueChangeListener() {
@Override
public void valueChange(ValueChangeEvent event) {
Collection<Long> selectedIds = (Collection<Long>) event.getProperty().getValue();
Criteria criteria = NCSEdgeProvider.createCriteria(selectedIds);
widgetContext.getGraphContainer().setCriteria(criteria);
}
});
return tree;
}
示例2: valueChange
import com.vaadin.data.Property.ValueChangeEvent; //導入依賴的package包/類
@Override
public void valueChange(final ValueChangeEvent event) {
if (!(event.getProperty() instanceof CheckBox)) {
return;
}
notifyConfigurationChanged();
final CheckBox checkBox = (CheckBox) event.getProperty();
BooleanConfigurationItem configurationItem;
if (actionAutocloseCheckBox.equals(checkBox)) {
configurationItem = actionAutocloseConfigurationItem;
} else {
return;
}
if (checkBox.getValue()) {
configurationItem.configEnable();
} else {
configurationItem.configDisable();
}
}
示例3: createAttributeCheckBox
import com.vaadin.data.Property.ValueChangeEvent; //導入依賴的package包/類
protected CheckBox createAttributeCheckBox(final AttributeSettings settings, final String key) {
final CheckBox checkBox = new CheckBox();
checkBox.setImmediate(true);
checkBox.addValueChangeListener(new ValueChangeListener() {
private static final long serialVersionUID = 1L;
@Override
public void valueChange(ValueChangeEvent event) {
ComponentAttribSetting setting = component.getSingleAttributeSetting(settings.getAttributeId(), key);
String oldValue = setting == null ? Boolean.FALSE.toString() : setting.getValue();
if (setting == null) {
setting = new ComponentAttribSetting(settings.getAttributeId(), component.getId(), key, Boolean.TRUE.toString());
component.addAttributeSetting(setting);
}
setting.setValue(checkBox.getValue().toString());
if (!oldValue.equals(setting.getValue())) {
context.getConfigurationService().save(setting);
}
}
});
checkBox.setReadOnly(readOnly);
return checkBox;
}
示例4: createCheckBox
import com.vaadin.data.Property.ValueChangeEvent; //導入依賴的package包/類
private CheckBox createCheckBox(final AttributeSettings settings, final String key) {
final CheckBox checkBox = new CheckBox();
checkBox.setImmediate(true);
checkBox.addValueChangeListener(new ValueChangeListener() {
@Override
public void valueChange(ValueChangeEvent event) {
ComponentAttribSetting setting = component.getSingleAttributeSetting(settings.getAttributeId(), key);
String oldValue = setting == null ? Boolean.FALSE.toString() : setting.getValue();
if (setting == null) {
setting = new ComponentAttribSetting(settings.getAttributeId(), component.getId(), key, Boolean.TRUE.toString());
component.addAttributeSetting(setting);
}
setting.setValue(checkBox.getValue().toString());
if (!oldValue.equals(setting.getValue())) {
context.getConfigurationService().save(setting);
}
}
});
checkBox.setReadOnly(readOnly);
return checkBox;
}
示例5: getUserOptions
import com.vaadin.data.Property.ValueChangeEvent; //導入依賴的package包/類
@SuppressWarnings("serial")
protected OptionGroup getUserOptions() {
this.userOption = new OptionGroup("Selection Criterion:");
this.userOption.addItem(NONE);
this.userOption.addItem(AVAILABILITY_ZONES);
this.userOption.addItem(HOST_AGGREGATES);
this.userOption.addItem(HOSTS);
this.userOption.select(NONE);
this.userOption.addValueChangeListener(new ValueChangeListener() {
@Override
public void valueChange(ValueChangeEvent event) {
populateOptionTable();
}
});
return this.userOption;
}
示例6: createCheckBox
import com.vaadin.data.Property.ValueChangeEvent; //導入依賴的package包/類
@SuppressWarnings("serial")
private CheckBox createCheckBox() {
this.checkbox = new CheckBox(VmidcMessages.getString(VmidcMessages_.SUMMARY_DOWNLOAD_INCLUDE_DB));
this.checkbox.setImmediate(true);
this.checkbox.setValue(false);
this.checkbox.addValueChangeListener(new ValueChangeListener() {
@Override
public void valueChange(ValueChangeEvent event) {
if (SummaryLayout.this.checkbox.getValue()) {
SummaryLayout.this.download
.setCaption(VmidcMessages.getString(VmidcMessages_.SUMMARY_DOWNLOAD_BUNDLE));
} else {
SummaryLayout.this.download
.setCaption(VmidcMessages.getString(VmidcMessages_.SUMMARY_DOWNLOAD_LOG));
}
}
});
return this.checkbox;
}
示例7: createOptionGroup
import com.vaadin.data.Property.ValueChangeEvent; //導入依賴的package包/類
@SuppressWarnings("serial")
private OptionGroup createOptionGroup() {
this.mode = new OptionGroup();
this.mode.addItem("DHCP");
this.mode.addItem("Static");
this.mode.addStyleName("network-options");
this.mode.setImmediate(true);
this.mode.addValueChangeListener(new ValueChangeListener() {
@Override
public void valueChange(ValueChangeEvent event) {
if (NetworkLayout.this.mode.getValue().equals("DHCP")) {
NetworkLayout.this.editIPSettings.setEnabled(false);
populateNetworkTable();
NetworkLayout.this.mode.setEnabled(true);
}
if (NetworkLayout.this.mode.getValue().equals("Static")) {
NetworkLayout.this.editIPSettings.setEnabled(true);
NetworkLayout.this.mode.setEnabled(false);
}
}
});
return this.mode;
}
示例8: getType
import com.vaadin.data.Property.ValueChangeEvent; //導入依賴的package包/類
@SuppressWarnings("serial")
private Component getType() {
this.protectionTypeOption = new OptionGroup("Selection Type:");
this.protectionTypeOption.addItem(TYPE_ALL);
this.protectionTypeOption.addItem(TYPE_SELECTION);
this.protectionTypeOption.select(TYPE_ALL);
this.protectionTypeOption.addValueChangeListener(new ValueChangeListener() {
@Override
public void valueChange(ValueChangeEvent event) {
if (BaseSecurityGroupWindow.this.protectionTypeOption.getValue() == TYPE_ALL) {
enableSelection(false);
} else if (BaseSecurityGroupWindow.this.protectionTypeOption.getValue() == TYPE_SELECTION) {
enableSelection(true);
}
// Populate to list first and then the from list since we use the 'to' list items to exclude them from
// the 'from' list
populateToList();
populateFromList();
}
});
return this.protectionTypeOption;
}
示例9: initializeOption
import com.vaadin.data.Property.ValueChangeEvent; //導入依賴的package包/類
protected void initializeOption() {
//
// Setup datasource and GUI properties
//
this.optionGroupAttribute.setImmediate(true);
this.optionGroupAttribute.addItem(ATTRIBUTE_OPTION_DICTIONARY);
this.optionGroupAttribute.addItem(ATTRIBUTE_OPTION_STANDARD);
this.optionGroupAttribute.addItem(ATTRIBUTE_OPTION_INPUT);
//
// Respond to events
//
this.optionGroupAttribute.addValueChangeListener(new ValueChangeListener() {
private static final long serialVersionUID = 1L;
@Override
public void valueChange(ValueChangeEvent event) {
self.resetAttributeOption();
}
});
}
示例10: initializeCheckBox
import com.vaadin.data.Property.ValueChangeEvent; //導入依賴的package包/類
protected void initializeCheckBox() {
this.checkBoxShortIds.setValue(true);
this.checkBoxShortIds.setImmediate(true);
this.checkBoxShortIds.addValueChangeListener(new ValueChangeListener() {
private static final long serialVersionUID = 1L;
@Override
public void valueChange(ValueChangeEvent event) {
if (self.checkBoxShortIds.getValue()) {
self.tableRequiredAttributes.setColumnCollapsed("id", true);
self.tableRequiredAttributes.setColumnCollapsed("category", true);
self.tableRequiredAttributes.setColumnCollapsed("datatype", true);
self.tableRequiredAttributes.setColumnCollapsed("shortId", false);
self.tableRequiredAttributes.setColumnCollapsed("shortCategory", false);
self.tableRequiredAttributes.setColumnCollapsed("shortDatatype", false);
} else {
self.tableRequiredAttributes.setColumnCollapsed("id", false);
self.tableRequiredAttributes.setColumnCollapsed("category", false);
self.tableRequiredAttributes.setColumnCollapsed("datatype", false);
self.tableRequiredAttributes.setColumnCollapsed("shortId", true);
self.tableRequiredAttributes.setColumnCollapsed("shortCategory", true);
self.tableRequiredAttributes.setColumnCollapsed("shortDatatype", true);
}
}
});
}
示例11: initializeSelect
import com.vaadin.data.Property.ValueChangeEvent; //導入依賴的package包/類
protected void initializeSelect(Map<VariableDefinitionType, PolicyType> vars) {
//
// Add existing variables into the table
//
if (vars != null) {
for (VariableDefinitionType var : vars.keySet()) {
this.listSelectVariables.addItem(var.getVariableId());
}
}
//
// Respond to changes
//
this.listSelectVariables.setImmediate(true);
this.listSelectVariables.addValueChangeListener(new ValueChangeListener() {
private static final long serialVersionUID = 1L;
@Override
public void valueChange(ValueChangeEvent event) {
Object value = self.listSelectVariables.getValue();
if (value != null) {
self.textFieldVariable.setValue(value.toString());
}
}
});
}
示例12: initializeCheckboxes
import com.vaadin.data.Property.ValueChangeEvent; //導入依賴的package包/類
protected void initializeCheckboxes(boolean readOnly) {
//
// The readonly check box
//
this.checkBoxReadOnly.setImmediate(true);
this.checkBoxReadOnly.setValue(readOnly);
this.checkBoxReadOnly.addValueChangeListener(new ValueChangeListener() {
private static final long serialVersionUID = 1L;
@Override
public void valueChange(ValueChangeEvent event) {
self.resetComponents();
self.setupCaption();
}
});
//
// The autosave check box
//
this.checkBoxAutoSave.setImmediate(true);
this.checkBoxAutoSave.setValue(true);
}
示例13: bindConfigurationValues
import com.vaadin.data.Property.ValueChangeEvent; //導入依賴的package包/類
@Override
public void bindConfigurationValues() {
super.bindConfigurationValues();
bindField(minValue, MIN_VALUE, preferences);
bindField(maxValue, MAX_VALUE, preferences);
valuesChoiceHandler = new ValueChangeListener() {
@Override
public void valueChange(ValueChangeEvent event) {
checkMaxValue((DiagrammePreferenceValue) event.getProperty().getValue());
}
};
valuesColumnChoice.addValueChangeListener(valuesChoiceHandler);
minValue.addValueChangeListener(new MinMaxValueChangeListener(minValue));
maxValue.addValueChangeListener(new MinMaxValueChangeListener(maxValue));
}
示例14: onGroupNumberChange
import com.vaadin.data.Property.ValueChangeEvent; //導入依賴的package包/類
private void onGroupNumberChange(final ValueChangeEvent event) {
if (editRolloutEnabled) {
return;
}
if (event.getProperty().getValue() != null && noOfGroups.isValid() && totalTargetsCount != null
&& isNumberOfGroups()) {
groupSizeLabel.setValue(getTargetPerGroupMessage(String.valueOf(getGroupSize())));
groupSizeLabel.setVisible(true);
updateGroupsChart(Integer.parseInt(noOfGroups.getValue()));
} else {
groupSizeLabel.setVisible(false);
if (isNumberOfGroups()) {
updateGroupsChart(0);
}
}
}
示例15: addValueChangeListener
import com.vaadin.data.Property.ValueChangeEvent; //導入依賴的package包/類
private void addValueChangeListener() {
autoStartOptionGroup.addValueChangeListener(new ValueChangeListener() {
private static final long serialVersionUID = 1L;
@Override
public void valueChange(final ValueChangeEvent event) {
if (event.getProperty().getValue().equals(AutoStartOption.SCHEDULED)) {
startAtDateField.setEnabled(true);
startAtDateField.setRequired(true);
} else {
startAtDateField.setEnabled(false);
startAtDateField.setRequired(false);
}
}
});
}