當前位置: 首頁>>代碼示例>>Java>>正文


Java Container.Hierarchical方法代碼示例

本文整理匯總了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);
}
 
開發者ID:vaadin,項目名稱:tree-grid,代碼行數:14,代碼來源:TreeGrid.java

示例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);
    }
 
開發者ID:vaadin,項目名稱:tree-grid,代碼行數:16,代碼來源:HierarchyTest.java

示例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);
}
 
開發者ID:rah003,項目名稱:neat-tweaks,代碼行數:14,代碼來源:RootableTreePresenter.java

示例4: getHierarchical

import com.vaadin.data.Container; //導入方法依賴的package包/類
private Container.Hierarchical getHierarchical() {
    return (Container.Hierarchical) container;
}
 
開發者ID:vaadin,項目名稱:tree-grid,代碼行數:4,代碼來源:DemoItemSorter.java

示例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);
    }
}
 
開發者ID:vaadin,項目名稱:tree-grid,代碼行數:7,代碼來源:HierarchyTest.java

示例6: Utils

import com.vaadin.data.Container; //導入方法依賴的package包/類
public Utils(Container.Hierarchical container) {
    this.hierachical=container;
}
 
開發者ID:rogozinds,項目名稱:GridTree,代碼行數:4,代碼來源:Utils.java

示例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());
}
 
開發者ID:vaadin,項目名稱:tree-grid,代碼行數:32,代碼來源:HierarchyTest.java

示例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();
}
 
開發者ID:vaadin,項目名稱:tree-grid,代碼行數:12,代碼來源:HierarchyDataGenerator.java


注:本文中的com.vaadin.data.Container.Hierarchical方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。