当前位置: 首页>>代码示例>>Java>>正文


Java ValueChangeNotifier类代码示例

本文整理汇总了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));
				}
			}
		}
	}
}
 
开发者ID:holon-platform,项目名称:holon-vaadin7,代码行数:26,代码来源:ItemPropertyValueChangeListener.java

示例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());
						}
					});
		}
	}));
}
 
开发者ID:davherrmann,项目名称:annoMVVM,代码行数:22,代码来源:ViewModelComposerTest.java

示例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);
			}
		}
	}
}
 
开发者ID:holon-platform,项目名称:holon-vaadin7,代码行数:14,代码来源:ItemPropertyValueChangeListener.java

示例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);
}
 
开发者ID:metasfresh,项目名称:metasfresh-procurement-webui,代码行数:16,代码来源:RfqModel.java

示例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;
}
 
开发者ID:metasfresh,项目名称:metasfresh-procurement-webui,代码行数:14,代码来源:RfqModel.java

示例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();
                    }
                });
    }
}
 
开发者ID:macquail,项目名称:FieldGroupV6,代码行数:14,代码来源:TransactionalPropertyWrapper.java

示例7: ValueChangeNotifierRegistration

import com.vaadin.data.Property.ValueChangeNotifier; //导入依赖的package包/类
public ValueChangeNotifierRegistration(ValueChangeNotifier notifier, ValueChangeListener listener) {
	super();
	this.notifier = notifier;
	this.listener = listener;
}
 
开发者ID:holon-platform,项目名称:holon-vaadin7,代码行数:6,代码来源:ValueChangeNotifierRegistration.java

示例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);
}
 
开发者ID:holon-platform,项目名称:holon-vaadin7,代码行数:18,代码来源:ValueChangeNotifierRegistration.java


注:本文中的com.vaadin.data.Property.ValueChangeNotifier类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。