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


Java MultiSelectionEvent类代码示例

本文整理汇总了Java中com.vaadin.event.selection.MultiSelectionEvent的典型用法代码示例。如果您正苦于以下问题:Java MultiSelectionEvent类的具体用法?Java MultiSelectionEvent怎么用?Java MultiSelectionEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


MultiSelectionEvent类属于com.vaadin.event.selection包,在下文中一共展示了MultiSelectionEvent类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updateSelection

import com.vaadin.event.selection.MultiSelectionEvent; //导入依赖的package包/类
private void updateSelection(final SerializableConsumer<Collection<T>> handler, final boolean userOriginated, final boolean sortingNeeded) {
    final LinkedHashSet<T> oldSelection = new LinkedHashSet<>(getSelectedItems());
    final List<T> selection = new ArrayList<>(getSelectedItems());
    handler.accept(selection);

    if (sortingNeeded) {
        this.sortingSelection = Collections.unmodifiableCollection(selection);
    }

    // TODO selection is private, have to use reflection (remove later)
    try {
        final Field f1 = getSelectionBaseClass().getDeclaredField("selection");
        f1.setAccessible(true);
        f1.set(this, selection);
    }
    catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) {
        e.printStackTrace();
    }

    doSetSelectedKeys(selection);

    fireEvent(new MultiSelectionEvent<>(this, oldSelection, userOriginated));

    getDataCommunicator().reset();
    getDataProvider().refreshAll();
}
 
开发者ID:bonprix,项目名称:vaadin-combobox-multiselect,代码行数:27,代码来源:ComboBoxMultiselect.java

示例2: ListBuilder

import com.vaadin.event.selection.MultiSelectionEvent; //导入依赖的package包/类
public ListBuilder() {
	super();
	registerRpc(new ListBuilderServerRpc() {

		@Override
		public void updateValue(List<String> newValue) {
			List<String> clone = new ArrayList<>(newValue);
			for (T item : orderedValue) {
				clone.remove(getDataCommunicator().getKeyMapper().key(item));
			}
			LinkedHashSet<T> oldSelection = new LinkedHashSet<>(orderedValue);
			orderedValue = newValue.stream().map(key -> getDataCommunicator().getKeyMapper().get(key))
					.collect(Collectors.toCollection(LinkedHashSet::new));
			updateState();
			if (clone.isEmpty()) {
				fireEvent(new MultiSelectionEvent<>(ListBuilder.this, oldSelection, true));
			}
		}
	});
}
 
开发者ID:tepi,项目名称:ListBuilder,代码行数:21,代码来源:ListBuilder.java

示例3: buildSelectionEvent

import com.vaadin.event.selection.MultiSelectionEvent; //导入依赖的package包/类
protected SelectionEvent<T> buildSelectionEvent(MultiSelectionEvent<ITEM> event) {
	return new DefaultSelectionEvent<>(fromInternalValue(event.getAllSelectedItems()), event.isUserOriginated());
}
 
开发者ID:holon-platform,项目名称:holon-vaadin,代码行数:4,代码来源:MultiSelectField.java


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