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


Java ConstUI.getTreeStrings方法代码示例

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


在下文中一共展示了ConstUI.getTreeStrings方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: refreshViewAndLog

import org.pentaho.di.ui.core.ConstUI; //导入方法依赖的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.ConstUI; //导入方法依赖的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: addDoubleClick

import org.pentaho.di.ui.core.ConstUI; //导入方法依赖的package包/类
public static final void addDoubleClick( final TreeItem treeItem, final DoubleClickInterface doubleClick ) {
  final String[] path1 = ConstUI.getTreeStrings( treeItem );
  final Tree tree = treeItem.getParent();

  if ( doubleClick != null ) {
    final SelectionAdapter selectionAdapter = new SelectionAdapter() {
      public void widgetDefaultSelected( SelectionEvent selectionEvent ) {
        TreeItem[] items = tree.getSelection();
        for ( int i = 0; i < items.length; i++ ) {
          String[] path2 = ConstUI.getTreeStrings( items[i] );
          if ( equalPaths( path1, path2 ) ) {
            doubleClick.action( treeItem );
          }
        }
      }
    };
    tree.addSelectionListener( selectionAdapter );

    // Clean up when we do a refresh too.
    treeItem.addDisposeListener( new DisposeListener() {
      public void widgetDisposed( DisposeEvent disposeEvent ) {
        tree.removeSelectionListener( selectionAdapter );
      }
    } );
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:27,代码来源:TreeItemAccelerator.java

示例4: handleOK

import org.pentaho.di.ui.core.ConstUI; //导入方法依赖的package包/类
public void handleOK()
{
    TreeItem ti[] = wTree.getSelection();
    if (ti.length == 1)
    {
        String tree[] = ConstUI.getTreeStrings(ti[0]);
        selection = rep.getDirectoryTree().findDirectory(tree);
        dispose();
    }
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:11,代码来源:SelectDirectoryDialog.java

示例5: ok

import org.pentaho.di.ui.core.ConstUI; //导入方法依赖的package包/类
private void ok()
{
	// Something has to be selected!
	if (wTree.getSelectionCount()>0)
	{
		TreeItem ti = wTree.getSelection()[0];
		
		// No directory!
		if (!ti.getForeground().equals(dircolor))
		{
			int level = ConstUI.getTreeLevel(ti);
			if (level>0)
			{
				String path[] = ConstUI.getTreeStrings(ti.getParentItem());
				objectName = ti.getText(0);
                   objectType = ti.getText(1);
				objectDirectory = rep.getDirectoryTree().findDirectory(path);
				
				if (objectDirectory!=null)
				{
					dispose();
				}
				else
				{
					MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_ERROR );
					mb.setMessage(Messages.getString("SelectObjectDialog.Dialog.DirectoryNotFound.Message")); //$NON-NLS-1$
					mb.setText(Messages.getString("SelectObjectDialog.Dialog.DirectoryNotFound.Title")); //$NON-NLS-1$
					mb.open();
				}
			}
		}
	}
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:34,代码来源:SelectObjectDialog.java

示例6: addDoubleClick

import org.pentaho.di.ui.core.ConstUI; //导入方法依赖的package包/类
public static final void addDoubleClick(final TreeItem treeItem, final DoubleClickInterface doubleClick)
{
    final String[] path1 = ConstUI.getTreeStrings(treeItem);
    final Tree tree = treeItem.getParent();
    
    if (doubleClick!=null)
    {
        final SelectionAdapter selectionAdapter = new SelectionAdapter()
        {
            public void widgetDefaultSelected(SelectionEvent selectionEvent)
            {
                TreeItem[] items = tree.getSelection();
                for (int i=0;i<items.length;i++)
                {
                    String[] path2 = ConstUI.getTreeStrings(items[i]);
                    if (equalPaths(path1, path2)) doubleClick.action(treeItem);
                }
            }
        };
        tree.addSelectionListener(selectionAdapter);
        
        // Clean up when we do a refresh too.
        treeItem.addDisposeListener(new DisposeListener()
            {
                public void widgetDisposed(DisposeEvent disposeEvent)
                {
                    tree.removeSelectionListener(selectionAdapter);
                }
            }
        );
    }
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:33,代码来源:TreeItemAccelerator.java

示例7: setExpandedFromMemory

import org.pentaho.di.ui.core.ConstUI; //导入方法依赖的package包/类
private static void setExpandedFromMemory(Tree tree, String treeName, TreeItem treeItem)
{
    TreeMemory treeMemory = TreeMemory.getInstance();
    
    String[] path = ConstUI.getTreeStrings(treeItem);
    boolean expanded = treeMemory.isExpanded(treeName, path);
    treeItem.setExpanded(expanded);
    
    TreeItem[] items = treeItem.getItems();
    for (int i=0;i<items.length;i++)
    {
        setExpandedFromMemory(tree, treeName, items[i]);
    }
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:15,代码来源:TreeMemory.java

示例8: handleOK

import org.pentaho.di.ui.core.ConstUI; //导入方法依赖的package包/类
public void handleOK()
{
    TreeItem ti[] = wTree.getSelection();
    if (ti.length == 1)
    {
        String tree[] = ConstUI.getTreeStrings(ti[0]);
        selection = repositoryTree.findDirectory(tree);
        dispose();
    }
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:11,代码来源:SelectDirectoryDialog.java

示例9: TreeEntry

import org.pentaho.di.ui.core.ConstUI; //导入方法依赖的package包/类
public TreeEntry(TreeItem treeItem) {
  String[] path = ConstUI.getTreeStrings(treeItem);
  this.length = path.length;
  if (path.length > 0) {
    itemType = path[0];
  }
  if (path.length > 1) {
    name = path[1];
  }
  if (path.length == 3) {
    treeItem = treeItem.getParentItem();
  }
  status = treeItem.getText(9);
  id = treeItem.getText(13);
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:16,代码来源:SpoonSlave.java

示例10: setExpandedFromMemory

import org.pentaho.di.ui.core.ConstUI; //导入方法依赖的package包/类
private static void setExpandedFromMemory( Tree tree, String treeName, TreeItem treeItem ) {
  TreeMemory treeMemory = TreeMemory.getInstance();

  String[] path = ConstUI.getTreeStrings( treeItem );
  boolean expanded = treeMemory.isExpanded( treeName, path );
  treeItem.setExpanded( expanded );

  TreeItem[] items = treeItem.getItems();
  for ( int i = 0; i < items.length; i++ ) {
    setExpandedFromMemory( tree, treeName, items[i] );
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:13,代码来源:TreeMemory.java

示例11: handleOK

import org.pentaho.di.ui.core.ConstUI; //导入方法依赖的package包/类
public void handleOK() {
  TreeItem[] ti = wTree.getSelection();
  if ( ti.length == 1 ) {
    String[] tree = ConstUI.getTreeStrings( ti[ 0 ] );
    selection = repositoryTree.findDirectory( tree );
    dispose();
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:9,代码来源:SelectDirectoryDialog.java

示例12: getDirectory

import org.pentaho.di.ui.core.ConstUI; //导入方法依赖的package包/类
public RepositoryDirectoryInterface getDirectory( TreeItem ti ) {
  RepositoryDirectoryInterface repdir = null;

  int level = ConstUI.getTreeLevel( ti );
  String[] path = ConstUI.getTreeStrings( ti );

  if ( level > 1 ) {
    int cat = getItemCategory( ti );
    String[] realpath;
    switch ( cat ) {
      case ITEM_CATEGORY_JOB:
      case ITEM_CATEGORY_TRANSFORMATION:
        // The first 3 levels of text[] don't belong to the path to this transformation!
        realpath = new String[level - 2];
        for ( int i = 0; i < realpath.length; i++ ) {
          realpath[i] = path[i + 2];
        }

        repdir = directoryTree.findDirectory( realpath );

        break;
      case ITEM_CATEGORY_JOB_DIRECTORY:
      case ITEM_CATEGORY_TRANSFORMATION_DIRECTORY:
        // The first 3 levels of text[] don't belong to the path to this transformation!
        realpath = new String[level - 1];
        for ( int i = 0; i < realpath.length; i++ ) {
          realpath[i] = path[i + 2];
        }

        repdir = directoryTree.findDirectory( realpath );

        break;
      default:
        break;
    }
  }
  return repdir;
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:39,代码来源:RepositoryExplorerDialog.java

示例13: doDoubleClick

import org.pentaho.di.ui.core.ConstUI; //导入方法依赖的package包/类
public void doDoubleClick()
{
	final TreeItem tisel[]=wTree.getSelection();
	if (tisel.length==1 || sameCategory(tisel))
	{
		final TreeItem ti = tisel[0];
		final int level = ConstUI.getTreeLevel(ti);
	
		int cat = getItemCategory(ti);
		if ((level >= 2) &&
				((cat == ITEM_CATEGORY_JOB_DIRECTORY) || (cat == ITEM_CATEGORY_TRANSFORMATION_DIRECTORY) || 
						(cat == ITEM_CATEGORY_JOB) || (cat == ITEM_CATEGORY_TRANSFORMATION)))
		{
			String realpath[];
			if ((cat == ITEM_CATEGORY_JOB_DIRECTORY) || (cat == ITEM_CATEGORY_TRANSFORMATION_DIRECTORY))
			{
				// The first levels of path[] don't belong to the path to this directory!
				realpath = new String[level - 1];
			}
			else
			{
				// The first 3 levels of path[] don't belong to the path to this transformation or Job!
				realpath = new String[level - 2];
			}	
			
			final String path[] = ConstUI.getTreeStrings(ti);
			for (int i = 0; i < realpath.length; i++)
			{
				realpath[i] = path[i + 2];
			}
			// Find the directory in the directory tree...
			final RepositoryDirectory repdir = rep.getDirectoryTree().findDirectory(realpath);

			switch (cat) {
			case ITEM_CATEGORY_JOB_DIRECTORY:
			case ITEM_CATEGORY_TRANSFORMATION_DIRECTORY: {
				if (!userinfo.isReadonly())	createDirectory(ti, repdir);
				break;
			}
			case ITEM_CATEGORY_TRANSFORMATION: {
				openTransformation(ti.getText(), repdir);
				break;
			}
			case ITEM_CATEGORY_JOB: {
				openJob(ti.getText(), repdir);
				break;
			}
			default:
			}
			
		}
	}
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:54,代码来源:RepositoryExplorerDialog.java

示例14: getItemCategory

import org.pentaho.di.ui.core.ConstUI; //导入方法依赖的package包/类
private int getItemCategory(TreeItem ti)
{
	int cat = ITEM_CATEGORY_NONE;
	
	int level = ConstUI.getTreeLevel(ti);
	String path[] = ConstUI.getTreeStrings(ti);
	
	String item = ""; //$NON-NLS-1$
	String parent = ""; //$NON-NLS-1$
	
	if (ti!=null) 
	{
		item = ti.getText();
		if (ti.getParentItem()!=null)
		{
			parent = ti.getParentItem().getText();
		}
	}
	
	
	// Level 1:
	if (level==0)
	{
		cat = ITEM_CATEGORY_ROOT;
	}
	else
	if (level==1)
	{
		     if (item.equals(STRING_USERS))           cat = ITEM_CATEGORY_USERS_ROOT;
		else if (item.equals(STRING_PROFILES))        cat = ITEM_CATEGORY_PROFILES_ROOT;
           else if (item.equals(STRING_DATABASES))       cat = ITEM_CATEGORY_DATABASES_ROOT;
           else if (item.equals(STRING_PARTITIONS))      cat = ITEM_CATEGORY_PARTITIONS_ROOT;
           else if (item.equals(STRING_SLAVES))          cat = ITEM_CATEGORY_SLAVES_ROOT;
           else if (item.equals(STRING_CLUSTERS))        cat = ITEM_CATEGORY_CLUSTERS_ROOT;
           else if (item.equals(STRING_TRANSFORMATIONS)) cat = ITEM_CATEGORY_TRANSFORMATIONS_ROOT;
           else if (item.equals(STRING_JOBS))            cat = ITEM_CATEGORY_JOBS_ROOT;
	}
	else
	if (level>=2)
	{
		     if (parent.equals(STRING_USERS)) cat = ITEM_CATEGORY_USER;
		else if (parent.equals(STRING_PROFILES)) cat = ITEM_CATEGORY_PROFILE;
           else if (parent.equals(STRING_DATABASES)) cat = ITEM_CATEGORY_DATABASE;
           else if (parent.equals(STRING_PARTITIONS)) cat = ITEM_CATEGORY_PARTITION;
           else if (parent.equals(STRING_SLAVES)) cat = ITEM_CATEGORY_SLAVE;
           else if (parent.equals(STRING_CLUSTERS)) cat = ITEM_CATEGORY_CLUSTER;
                
		final Color dircolor = GUIResource.getInstance().getColorDirectory();
           if (path[1].equals(STRING_TRANSFORMATIONS))
           {
               if (ti.getForeground().equals(dircolor)) 
                    cat = ITEM_CATEGORY_TRANSFORMATION_DIRECTORY;
               else cat = ITEM_CATEGORY_TRANSFORMATION;
           }
           else
           if (path[1].equals(STRING_JOBS))
           {
               if (ti.getForeground().equals(dircolor)) 
                    cat = ITEM_CATEGORY_JOB_DIRECTORY;
               else cat = ITEM_CATEGORY_JOB;
           }
	}
	
	return cat;
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:66,代码来源:RepositoryExplorerDialog.java

示例15: handleOK

import org.pentaho.di.ui.core.ConstUI; //导入方法依赖的package包/类
public void handleOK()
{
	if (justLook) 
	{
		dispose();
		return;
	} 
	TreeItem ti[]=wTree.getSelection();
	if (ti.length==1)
	{
		// Get the parent.
           String table = ti[0].getText();
           String[] path = ConstUI.getTreeStrings(ti[0]);
		if (path.length==3)
		{
				if (STRING_TABLES.equalsIgnoreCase(path[1]) ||
					STRING_VIEWS.equalsIgnoreCase(path[1]) ||
					STRING_SYNONYMS.equalsIgnoreCase(path[1]))
			{
                   schemaName = null;
				tableName = table;
					if (dbMeta.getDatabaseType()==DatabaseMeta.TYPE_DATABASE_MSSQL) {
						String st[] = tableName.split("\\.",2);
						if (st.length>1) { // we have a dot in there and need to separate
		                    schemaName = st[0];
							tableName = st[1];
					}
					}
                   dispose();
			}
           }
           if (path.length==4)
           {
			if (STRING_SCHEMAS.equals(path[1]) || STRING_CATALOG.equals(path[1])) 
			{
                   if (splitSchemaAndTable)
                   {
                       schemaName = path[2];
                       tableName = path[3];
                   }
                   else
                   {
                       schemaName = null;
                       tableName = dbMeta.getQuotedSchemaTableCombination(path[2], path[3]);
                   }
                   dispose();
			}
		}
	}
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:51,代码来源:DatabaseExplorerDialog.java


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