本文整理汇总了Java中com.vaadin.ui.Tree.setItemCaptionPropertyId方法的典型用法代码示例。如果您正苦于以下问题:Java Tree.setItemCaptionPropertyId方法的具体用法?Java Tree.setItemCaptionPropertyId怎么用?Java Tree.setItemCaptionPropertyId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vaadin.ui.Tree
的用法示例。
在下文中一共展示了Tree.setItemCaptionPropertyId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getView
import com.vaadin.ui.Tree; //导入方法依赖的package包/类
@Override
public Component getView(final WidgetContext widgetContext) {
Tree tree = new Tree("Services", new FilterableHierarchicalContainer(new NCSServiceContainer(m_ncsComponentRepository)));
tree.setMultiSelect(true);
tree.setImmediate(true);
tree.setItemCaptionMode(Tree.ITEM_CAPTION_MODE_PROPERTY);
tree.setItemCaptionPropertyId("name");
tree.addListener(new ValueChangeListener() {
@Override
public void valueChange(ValueChangeEvent event) {
Collection<Long> selectedIds = (Collection<Long>) event.getProperty().getValue();
Criteria criteria = NCSEdgeProvider.createCriteria(selectedIds);
widgetContext.getGraphContainer().setCriteria(criteria);
}
});
return tree;
}
示例2: createOrganizationTree
import com.vaadin.ui.Tree; //导入方法依赖的package包/类
private Tree createOrganizationTree(Organization organization) {
Tree organizationTree = new Tree();
organizationTree.setImmediate(false);
organizationTree.setWidth("100.0%");
organizationTree.setHeight("100.0%");
organizationTree.setContainerDataSource(createDataSource(organization));
organizationTree.setItemIconPropertyId("icon");
organizationTree.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
organizationTree.setItemCaptionPropertyId("description");
// Expand all items that can be
for (Object itemId: organizationTree.getItemIds())
organizationTree.expandItem(itemId);
organizationTree.setData(organization);
organizationTree.addActionHandler(this);
return organizationTree;
}
示例3: initView
import com.vaadin.ui.Tree; //导入方法依赖的package包/类
private void initView() {
this.loadingSign = new ProgressBar();
this.loadingSign.setIndeterminate(true);
this.loadingSign.setId("loadingSign");
Label title = new Label("Available models");
title.setId("label_availableModels");
addComponent(title);
this.availableModelsTree = new Tree();
this.availableModelsTree.setId("tree_availableModels");
this.availableModelsTree.setWidth(30, Unit.EM);
Tree tree = availableModelsTree;
tree.addContainerProperty(CAPTION_PROPERTY, String.class, "");
tree.setItemCaptionMode(AbstractSelect.ITEM_CAPTION_MODE_PROPERTY);
tree.setItemCaptionPropertyId(CAPTION_PROPERTY);
this.buttonStartSession = new Button("Start");
this.buttonStartSession.setId("button_start");
this.buttonStartSession.addClickListener(new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
String selectedModelPath = (String) tree.getValue();
if(selectedModelPath.endsWith(".wtspec4m")) {
startSession(selectedModelPath);
}
}
});
addComponent(this.buttonStartSession);
addComponent(this.loadingSign);
Panel treeViewContainer = new Panel();
treeViewContainer.setId("panel_treeViewContainer");
treeViewContainer.setContent(this.availableModelsTree);
addComponent(treeViewContainer);
}