本文整理汇总了Java中com.vaadin.data.Property.ValueChangeNotifier类的典型用法代码示例。如果您正苦于以下问题:Java ValueChangeNotifier类的具体用法?Java ValueChangeNotifier怎么用?Java ValueChangeNotifier使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ValueChangeNotifier类属于com.vaadin.data.Property包,在下文中一共展示了ValueChangeNotifier类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ItemPropertyValueChangeListener
import com.vaadin.data.Property.ValueChangeNotifier; //导入依赖的package包/类
/**
* Constructor
* @param item Item
* @param itemStore Item store
*/
public ItemPropertyValueChangeListener(Item item, ItemStore<Item> itemStore) {
super();
this.item = new WeakReference<>(item);
this.itemStore = itemStore;
if (item != null) {
// add value change listener to track property modifications
Collection<?> itemPropertyIds = item.getItemPropertyIds();
if (itemPropertyIds != null) {
trackedItemProperties = new HashSet<>(itemPropertyIds.size());
for (Object itemPropertyId : itemPropertyIds) {
Property<?> itemProperty = item.getItemProperty(itemPropertyId);
if (itemProperty instanceof ValueChangeNotifier) {
((ValueChangeNotifier) itemProperty).addValueChangeListener(this);
trackedItemProperties.add(new WeakReference<>(itemProperty));
}
}
}
}
}
示例2: testAddActionWrapper
import com.vaadin.data.Property.ValueChangeNotifier; //导入依赖的package包/类
@Test
public void testAddActionWrapper() {
assertNull(viewModelComposer.addActionWrapper(ValueChangeNotifier.class,
new ActionWrapper() {
@Override
public void addActionHandler(Object notifier,
final ActionHandler actionHandler) {
((ValueChangeNotifier) notifier)
.addValueChangeListener(new ValueChangeListener() {
private static final long serialVersionUID = -854400079672018869L;
@Override
public void valueChange(
ValueChangeEvent event) {
actionHandler.handle(event
.getProperty().getValue());
}
});
}
}));
}
示例3: detach
import com.vaadin.data.Property.ValueChangeNotifier; //导入依赖的package包/类
/**
* Detach this listener from item properties
*/
public void detach() {
if (trackedItemProperties != null) {
for (WeakReference<Property<?>> itemProperty : trackedItemProperties) {
Property<?> property = itemProperty.get();
if (property != null) {
((ValueChangeNotifier) property).removeValueChangeListener(this);
}
}
}
}
示例4: RfqModel
import com.vaadin.data.Property.ValueChangeNotifier; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public RfqModel(final BeanItem<RfqHeader> rfqHeaderItem)
{
super();
Application.autowire(this);
//
// RfQ Header
this.rfqHeaderItem = rfqHeaderItem;
final Property<?> priceProperty = rfqHeaderItem.getItemProperty(RfqHeader.PROPERTY_Price);
((ValueChangeNotifier)priceProperty).addValueChangeListener(priceChangeListener);
qtyPromisedSumProperty = rfqHeaderItem.getItemProperty(RfqHeader.PROPERTY_QtyPromised);
}
示例5: createRfqQuantitiesContainer
import com.vaadin.data.Property.ValueChangeNotifier; //导入依赖的package包/类
private RfqQuantityReportContainer createRfqQuantitiesContainer()
{
final RfqQuantityReportContainer rfqQuantitiesContainer = new RfqQuantityReportContainer();
final RfqHeader rfqHeader = rfqHeaderItem.getBean();
for (final RfqQuantityReport rfqQuantityReport : rfqHeader.getQuantities())
{
final BeanItem<RfqQuantityReport> rfqQuantityReportItem = rfqQuantitiesContainer.addBean(rfqQuantityReport);
final Property<?> qtyProperty = rfqQuantityReportItem.getItemProperty(RfqQuantityReport.PROPERTY_Qty);
((ValueChangeNotifier)qtyProperty).addValueChangeListener(qtyPromisedChangeListener);
}
return rfqQuantitiesContainer;
}
示例6: TransactionalPropertyWrapper
import com.vaadin.data.Property.ValueChangeNotifier; //导入依赖的package包/类
public TransactionalPropertyWrapper(Property wrappedProperty) {
this.wrappedProperty = wrappedProperty;
if (wrappedProperty instanceof ValueChangeNotifier) {
((ValueChangeNotifier) wrappedProperty)
.addListener(new ValueChangeListener() {
@Override
public void valueChange(ValueChangeEvent event) {
fireValueChange();
}
});
}
}
示例7: ValueChangeNotifierRegistration
import com.vaadin.data.Property.ValueChangeNotifier; //导入依赖的package包/类
public ValueChangeNotifierRegistration(ValueChangeNotifier notifier, ValueChangeListener listener) {
super();
this.notifier = notifier;
this.listener = listener;
}
示例8: adapt
import com.vaadin.data.Property.ValueChangeNotifier; //导入依赖的package包/类
/**
* Adapt a {@link ValueHolder} {@link com.holonplatform.vaadin.components.ValueHolder.ValueChangeListener} and
* register it in given notifier.
* @param <V> Value type
* @param source Source {@link ValueHolder}
* @param notifier Actual {@link ValueChangeNotifier}
* @param listener Listener to adapt
* @return Listener registration
*/
public static <V> Registration adapt(ValueHolder<V> source, ValueChangeNotifier notifier,
com.holonplatform.vaadin.components.ValueHolder.ValueChangeListener<V> listener) {
ObjectUtils.argumentNotNull(notifier, "ValueChangeNotifier must be not null");
ObjectUtils.argumentNotNull(listener, "ValueChangeListener must be not null");
final com.vaadin.data.Property.ValueChangeListener vcl = new ValueChangeListenerAdapter<>(source, listener);
notifier.addValueChangeListener(vcl);
return new ValueChangeNotifierRegistration(notifier, vcl);
}