本文整理汇总了Java中com.vaadin.data.Property.ValueChangeNotifier方法的典型用法代码示例。如果您正苦于以下问题:Java Property.ValueChangeNotifier方法的具体用法?Java Property.ValueChangeNotifier怎么用?Java Property.ValueChangeNotifier使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vaadin.data.Property
的用法示例。
在下文中一共展示了Property.ValueChangeNotifier方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setPropertyDataSource
import com.vaadin.data.Property; //导入方法依赖的package包/类
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
public void setPropertyDataSource(final Property newDataSource)
{
// Stops listening the old data source changes
if (dataSource instanceof Property.ValueChangeNotifier)
{
((Property.ValueChangeNotifier)dataSource).removeValueChangeListener(propertyListener);
}
dataSource = newDataSource;
updateTextFromDataSource();
// Listens the new data source if possible
if (dataSource instanceof Property.ValueChangeNotifier)
{
((Property.ValueChangeNotifier)dataSource).addValueChangeListener(propertyListener);
}
markAsDirty();
}
示例2: addFieldChangeListener
import com.vaadin.data.Property; //导入方法依赖的package包/类
@Override
public void addFieldChangeListener(String fieldId, PropertyChangeListener listener) {
Component c = getComponentById(fieldId);
if (c instanceof Property.ValueChangeNotifier) {
FieldValueListener fl = new FieldValueListener();
fl.listener = listener;
((Property.ValueChangeNotifier) c).addListener(fl);
mapListeners.put(listener, fl);
} else {
LOG.warn("Listener not added to field because filed has not recognozible type. FieldId: {}", fieldId);
}
}
示例3: removeFieldChangeListener
import com.vaadin.data.Property; //导入方法依赖的package包/类
@Override
public void removeFieldChangeListener(String fieldId, PropertyChangeListener listener) {
Component c = getComponentById(fieldId);
if (c instanceof Property.ValueChangeNotifier) {
if (mapListeners.containsKey(listener)) {
FieldValueListener fl = mapListeners.remove(listener);
((Property.ValueChangeNotifier) c).removeListener(fl);
} else {
LOG.warn("Listener not removed because not added yet. FieldId: {}", fieldId);
}
} else {
LOG.warn("Listener not removed because filed has not recognozible type. FieldId: {}", fieldId);
}
}