本文整理汇总了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();
}
示例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();
}
示例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();
}
示例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 );
}