本文整理匯總了Java中com.vaadin.data.Container.Hierarchical方法的典型用法代碼示例。如果您正苦於以下問題:Java Container.Hierarchical方法的具體用法?Java Container.Hierarchical怎麽用?Java Container.Hierarchical使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.vaadin.data.Container
的用法示例。
在下文中一共展示了Container.Hierarchical方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setContainerDataSource
import com.vaadin.data.Container; //導入方法依賴的package包/類
@Override
public void setContainerDataSource(Container.Indexed container) {
if (container != null) {
if (!(container instanceof Container.Hierarchical)) {
container = new IndexedContainerHierarchicalWrapper(container);
}
if (!(container instanceof Collapsible)) {
container = new ContainerCollapsibleWrapper(container);
}
}
super.setContainerDataSource(container);
}
示例2: populateContainer
import com.vaadin.data.Container; //導入方法依賴的package包/類
private void populateContainer(Container.Hierarchical container) {
container.addContainerProperty(PROPERTY_NAME, String.class, "");
Object root = "000";
addItem(root, container);
// add children
Object[] children = {"010", "020", "030"};
addChildren(children, root, container);
// add grandchildren
addChildren(new Object[]{"011", "012", "013"}, children[0], container);
addChildren(new Object[]{"021", "022"}, children[1], container);
}
示例3: createContainer
import com.vaadin.data.Container; //導入方法依賴的package包/類
@Override
protected Container.Hierarchical createContainer() {
// protected AbstractJcrContainer createContainer() {
Location location = subAppContext.getLocation();
if (location instanceof RerootBrowserLocation) {
RerootBrowserLocation browserLocation = (RerootBrowserLocation) location;
if (browserLocation.isShowPageOnly()) {
return new RootableHierarchicalJcrContainer(((JcrContentConnector) contentConnector).getContentConnectorDefinition(), browserLocation.getNodePath());
}
}
return new RootableHierarchicalJcrContainer(((JcrContentConnector) contentConnector).getContentConnectorDefinition(), null);
}
示例4: getHierarchical
import com.vaadin.data.Container; //導入方法依賴的package包/類
private Container.Hierarchical getHierarchical() {
return (Container.Hierarchical) container;
}
示例5: addChildren
import com.vaadin.data.Container; //導入方法依賴的package包/類
private void addChildren(Object[] itemIds, Object parentId, Container.Hierarchical container) {
for (Object itemId : itemIds) {
addItem(itemId, container);
container.setParent(itemId, parentId);
}
}
示例6: Utils
import com.vaadin.data.Container; //導入方法依賴的package包/類
public Utils(Container.Hierarchical container) {
this.hierachical=container;
}
示例7: testHierarchy
import com.vaadin.data.Container; //導入方法依賴的package包/類
@Test
public void testHierarchy() {
Container.Hierarchical container = (Container.Hierarchical) grid.getContainerDataSource();
Collection roots = container.rootItemIds();
Assert.assertEquals("There should be one root item", 1, roots.size());
Iterator it = roots.iterator();
Object root = it.next();
Collection children = container.getChildren(root);
Assert.assertEquals("There should be three children", 3, children.size());
it = children.iterator();
Object item010 = it.next();
Assert.assertEquals("Item's value should be \"010\"", "010",
container.getItem(item010).getItemProperty(PROPERTY_NAME).getValue());
Collection grandchildren = container.getChildren(item010);
Assert.assertEquals("There should be three children of \"010\"", 3, grandchildren.size());
it = grandchildren.iterator();
it.next();
Object item012 = it.next();
Assert.assertEquals("Item's value should be \"012\"", "012",
container.getItem(item012).getItemProperty(PROPERTY_NAME).getValue());
}
示例8: getContainer
import com.vaadin.data.Container; //導入方法依賴的package包/類
/**
* Get container data source that implements {@link com.vaadin.data.Container.Indexed} and {@link
* com.vaadin.data.Container.Hierarchical} as well.
*
* @return TreeGrid's container data source
*/
@SuppressWarnings("unchecked")
private <T extends Container.Indexed & Container.Hierarchical> T getContainer() {
// TreeGrid's data source has to implement both Indexed and Hierarchical so it is safe to cast.
return (T) getParentGrid().getContainerDataSource();
}