本文整理汇总了Java中com.vaadin.data.Property.ValueChangeListener方法的典型用法代码示例。如果您正苦于以下问题:Java Property.ValueChangeListener方法的具体用法?Java Property.ValueChangeListener怎么用?Java Property.ValueChangeListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vaadin.data.Property
的用法示例。
在下文中一共展示了Property.ValueChangeListener方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getListSelectionListener
import com.vaadin.data.Property; //导入方法依赖的package包/类
protected ValueChangeListener getListSelectionListener() {
return new Property.ValueChangeListener() {
private static final long serialVersionUID = 1L;
public void valueChange(ValueChangeEvent event) {
Item item = taskTable.getItem(event.getProperty().getValue()); // the value of the property is the itemId of the table entry
if(item != null) {
String id = (String) item.getItemProperty("id").getValue();
setDetailComponent(createDetailComponent(id));
UriFragment taskFragment = getUriFragment(id);
ExplorerApp.get().setCurrentUriFragment(taskFragment);
} else {
// Nothing is selected
setDetailComponent(null);
ExplorerApp.get().setCurrentUriFragment(getUriFragment(null));
}
}
};
}
示例2: createFieldComponent
import com.vaadin.data.Property; //导入方法依赖的package包/类
@Override
protected AbstractSelect createFieldComponent() {
final AbstractSelect supplierPageSelect = super.createFieldComponent();
supplierPageSelect.setItemCaptionMode(AbstractSelect.ItemCaptionMode.EXPLICIT_DEFAULTS_ID);
final AbstractSelect templateSelect = findTemplateSelect();
if (templateSelect == null) {
throw new RuntimeException("Cannot find template ComboBox");
}
Property.ValueChangeListener listener = getValueChangeListener(templateSelect, supplierPageSelect);
templateSelect.addValueChangeListener(listener);
listener.valueChange(new Field.ValueChangeEvent(templateSelect));
supplierPageSelect.setVisible(utils.requiresParentTemplate((String) templateSelect.getValue()));
return supplierPageSelect;
}
示例3: getValueChangeListener
import com.vaadin.data.Property; //导入方法依赖的package包/类
private Property.ValueChangeListener getValueChangeListener(final AbstractSelect templateComboBox,
final AbstractSelect supplierPageSelect) {
final Map<String, String> parentTemplates = utils.getParentTemplates();
return new Property.ValueChangeListener() {
@Override
public void valueChange(Property.ValueChangeEvent event) {
String templateId = (String) templateComboBox.getValue();
boolean requiresSupplierPage = parentTemplates.containsKey(templateId);
if (requiresSupplierPage) {
supplierPageSelect.removeAllItems();
String parentTemplateId = parentTemplates.get(templateId);
final Map<String, String> pages = utils.findPagesUsingTemplate(parentTemplateId);
for (Map.Entry<String, String> entry : pages.entrySet()) {
supplierPageSelect.addItem(entry.getValue());
supplierPageSelect.setItemCaption(entry.getValue(), entry.getKey());
}
supplierPageSelect.setRequired(true);
supplierPageSelect.setVisible(true);
} else {
supplierPageSelect.setValue(null);
supplierPageSelect.setRequired(false);
supplierPageSelect.setVisible(false);
}
}
};
}
示例4: createDateValueChangeListener
import com.vaadin.data.Property; //导入方法依赖的package包/类
protected Property.ValueChangeListener createDateValueChangeListener() {
return e -> {
if (!checkRange(constructDate())) {
return;
}
updateInstance();
if (component != null) {
// Repaint error state
component.markAsDirty();
}
};
}
示例5: setValueChangeListener
import com.vaadin.data.Property; //导入方法依赖的package包/类
public ComboBoxBuilder setValueChangeListener(final Property.ValueChangeListener valueChangeListener) {
this.valueChangeListener = valueChangeListener;
return this;
}
示例6: addValueChangedListener
import com.vaadin.data.Property; //导入方法依赖的package包/类
public void addValueChangedListener(Property.ValueChangeListener listener) {
tree.addValueChangeListener(listener);
}