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