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


Java TreeUtil类代码示例

本文整理汇总了Java中org.pentaho.di.ui.core.widget.TreeUtil的典型用法代码示例。如果您正苦于以下问题:Java TreeUtil类的具体用法?Java TreeUtil怎么用?Java TreeUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: refreshViewAndLog

import org.pentaho.di.ui.core.widget.TreeUtil; //导入依赖的package包/类
protected void refreshViewAndLog()
{
    String[] selectionPath = null;
    if (wTree.getSelectionCount()==1)
    {
        selectionPath = ConstUI.getTreeStrings( wTree.getSelection()[0] );
    }

    refreshView(); 

    if (selectionPath!=null) // Select the same one again
    {
        TreeItem treeItem = TreeUtil.findTreeItem(wTree, selectionPath);
        if (treeItem!=null) wTree.setSelection(treeItem);
    }
    
    showLog();
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:19,代码来源:SpoonSlave.java

示例2: refreshViewAndLog

import org.pentaho.di.ui.core.widget.TreeUtil; //导入依赖的package包/类
protected void refreshViewAndLog() {
  String[] selectionPath = null;
  if (wTree.getSelectionCount() == 1) {
    selectionPath = ConstUI.getTreeStrings(wTree.getSelection()[0]);
  }

  refreshView();

  if (selectionPath != null) // Select the same one again
  {
    TreeItem treeItem = TreeUtil.findTreeItem(wTree, selectionPath);
    if (treeItem != null) {
      wTree.setSelection(treeItem);
      wTree.showItem(treeItem);
      treeItemSelected(treeItem);
      treeItem.setExpanded(true);
    }
  }

  showLog();
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:22,代码来源:SpoonSlave.java

示例3: refreshViewAndLog

import org.pentaho.di.ui.core.widget.TreeUtil; //导入依赖的package包/类
protected void refreshViewAndLog() {
  String[] selectionPath = null;
  TreeItem selectedItem;
  TreeEntry treeEntry = null;
  if ( wTree.getSelectionCount() == 1 ) {
    selectedItem = wTree.getSelection()[ 0 ];
    treeEntry = new TreeEntry( selectedItem );
    selectionPath = ConstUI.getTreeStrings( selectedItem );
  }

  refreshView();

  if ( treeEntry != null ) { // Select the same one again

    TreeItem treeItem = treeEntry.getTreeItem( wTree );
    if ( treeItem == null ) {
      treeItem = TreeUtil.findTreeItem( wTree, selectionPath );
    }
    if ( treeItem != null ) {
      wTree.setSelection( treeItem );
      if ( treeEntry.length < 3 ) {
        wTree.showItem( treeItem );
        treeItemSelected( treeItem );
        treeItem.setExpanded( true );
      }
    }
  }

  showLog();
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:31,代码来源:SpoonSlave.java

示例4: refreshTree

import org.pentaho.di.ui.core.widget.TreeUtil; //导入依赖的package包/类
public void refreshTree() throws MetaStoreException {
  tree.removeAll();

  // Top level: the MetaStore
  //
  for ( int m = 0; m < metaStoreList.size(); m++ ) {
    IMetaStore metaStore = metaStoreList.get( m );
    TreeItem metaStoreItem = new TreeItem( tree, SWT.NONE );

    metaStoreItem.setText( 0, Const.NVL( metaStore.getName(), "metastore-" + ( m + 1 ) ) );
    metaStoreItem.setText( 1, Const.NVL( metaStore.getDescription(), "" ) );

    // level: Namespace
    //
    List<String> namespaces = metaStore.getNamespaces();
    for ( String namespace : namespaces ) {
      TreeItem namespaceItem = new TreeItem( metaStoreItem, SWT.NONE );

      namespaceItem.setText( 0, Const.NVL( namespace, "" ) );

      // level: element type
      //
      List<IMetaStoreElementType> elementTypes = metaStore.getElementTypes( namespace );
      for ( IMetaStoreElementType elementType : elementTypes ) {
        TreeItem elementTypeItem = new TreeItem( namespaceItem, SWT.NONE );

        elementTypeItem.setText( 0, Const.NVL( elementType.getName(), "" ) );
        elementTypeItem.setText( 1, Const.NVL( elementType.getDescription(), "" ) );

        // level: element
        //
        List<IMetaStoreElement> elements = metaStore.getElements( namespace, elementType );
        for ( final IMetaStoreElement element : elements ) {
          TreeItem elementItem = new TreeItem( elementTypeItem, SWT.NONE );

          elementItem.setText( 0, Const.NVL( element.getName(), "" ) );
          elementItem.setText( 2, Const.NVL( element.getId(), "" ) );

          elementItem.addListener( SWT.Selection, new Listener() {

            @Override
            public void handleEvent( Event event ) {
              log.logBasic( "Selected : " + element.getName() );
            }
          } );

          addAttributesToTree( elementItem, element );
        }

      }
    }
  }
  TreeUtil.setOptimalWidthOnColumns( tree );
  TreeMemory.setExpandedFromMemory( tree, META_STORE_EXPLORER_DIALOG_TREE );
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:56,代码来源:MetaStoreExplorerDialog.java


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