本文整理匯總了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);
}
}