當前位置: 首頁>>代碼示例>>Java>>正文


Java ValueChangeListener類代碼示例

本文整理匯總了Java中com.vaadin.data.Property.ValueChangeListener的典型用法代碼示例。如果您正苦於以下問題:Java ValueChangeListener類的具體用法?Java ValueChangeListener怎麽用?Java ValueChangeListener使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ValueChangeListener類屬於com.vaadin.data.Property包,在下文中一共展示了ValueChangeListener類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getView

import com.vaadin.data.Property.ValueChangeListener; //導入依賴的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;
}
 
開發者ID:qoswork,項目名稱:opennmszh,代碼行數:23,代碼來源:NCSViewContribution.java

示例2: createAttributeCheckBox

import com.vaadin.data.Property.ValueChangeListener; //導入依賴的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;
}
 
開發者ID:JumpMind,項目名稱:metl,代碼行數:24,代碼來源:EditDeduperPanel.java

示例3: createCheckBox

import com.vaadin.data.Property.ValueChangeListener; //導入依賴的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;

}
 
開發者ID:JumpMind,項目名稱:metl,代碼行數:25,代碼來源:EditMergerPanel.java

示例4: getUserOptions

import com.vaadin.data.Property.ValueChangeListener; //導入依賴的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;
}
 
開發者ID:opensecuritycontroller,項目名稱:osc-core,代碼行數:18,代碼來源:BaseDeploymentSpecWindow.java

示例5: createCheckBox

import com.vaadin.data.Property.ValueChangeListener; //導入依賴的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;
}
 
開發者ID:opensecuritycontroller,項目名稱:osc-core,代碼行數:21,代碼來源:SummaryLayout.java

示例6: createOptionGroup

import com.vaadin.data.Property.ValueChangeListener; //導入依賴的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;
}
 
開發者ID:opensecuritycontroller,項目名稱:osc-core,代碼行數:25,代碼來源:NetworkLayout.java

示例7: getType

import com.vaadin.data.Property.ValueChangeListener; //導入依賴的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;
}
 
開發者ID:opensecuritycontroller,項目名稱:osc-core,代碼行數:24,代碼來源:BaseSecurityGroupWindow.java

示例8: initializeOption

import com.vaadin.data.Property.ValueChangeListener; //導入依賴的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();
		}
	});
}
 
開發者ID:apache,項目名稱:incubator-openaz,代碼行數:21,代碼來源:AttributeSelectionWindow.java

示例9: initializeCheckBox

import com.vaadin.data.Property.ValueChangeListener; //導入依賴的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);
			}
		}			
	});
}
 
開發者ID:apache,項目名稱:incubator-openaz,代碼行數:27,代碼來源:PIPSQLResolverEditorWindow.java

示例10: initializeSelect

import com.vaadin.data.Property.ValueChangeListener; //導入依賴的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());
			}
		}			
	});
}
 
開發者ID:apache,項目名稱:incubator-openaz,代碼行數:26,代碼來源:VariableReferenceEditorWindow.java

示例11: initializeCheckboxes

import com.vaadin.data.Property.ValueChangeListener; //導入依賴的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);
}
 
開發者ID:apache,項目名稱:incubator-openaz,代碼行數:23,代碼來源:PolicyEditor.java

示例12: bindConfigurationValues

import com.vaadin.data.Property.ValueChangeListener; //導入依賴的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));
}
 
開發者ID:hybridbpm,項目名稱:hybridbpm,代碼行數:17,代碼來源:GaugeChartConfLayout.java

示例13: addValueChangeListener

import com.vaadin.data.Property.ValueChangeListener; //導入依賴的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);
            }
        }
    });
}
 
開發者ID:eclipse,項目名稱:hawkbit,代碼行數:17,代碼來源:AutoStartOptionGroupLayout.java

示例14: addValueChangeListener

import com.vaadin.data.Property.ValueChangeListener; //導入依賴的package包/類
private void addValueChangeListener() {
    actionTypeOptionGroup.addValueChangeListener(new ValueChangeListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void valueChange(final ValueChangeEvent event) {
            if (event.getProperty().getValue().equals(ActionTypeOption.AUTO_FORCED)) {
                forcedTimeDateField.setEnabled(true);
                forcedTimeDateField.setRequired(true);
            } else {
                forcedTimeDateField.setEnabled(false);
                forcedTimeDateField.setRequired(false);
            }
        }
    });
}
 
開發者ID:eclipse,項目名稱:hawkbit,代碼行數:17,代碼來源:ActionTypeOptionGroupLayout.java

示例15: getCategoryFilterListener

import com.vaadin.data.Property.ValueChangeListener; //導入依賴的package包/類
/**
 * @return
 */
private ValueChangeListener getCategoryFilterListener() {
	return new ValueChangeListener() {

		/**
		 * 
		 */
		private static final long serialVersionUID = -2368474286053602744L;

		@SuppressWarnings("unchecked")
		@Override
		public void valueChange(ValueChangeEvent event) {
			String newValue = (String) event.getProperty().getValue();
			BeanItemContainer<VehicleInfo> container = ((BeanItemContainer<VehicleInfo>) grid
					.getContainerDataSource());
			container.removeContainerFilters(CATEGORY);
			if (null != newValue && !newValue.isEmpty()) {
				container.addContainerFilter(new SimpleStringFilter(
						CATEGORY, newValue, true, true));
			}
		}
	};
}
 
開發者ID:KrishnaPhani,項目名稱:KrishnasSpace,代碼行數:26,代碼來源:FilterGrid.java


注:本文中的com.vaadin.data.Property.ValueChangeListener類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。