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


Java RepositoryElementMetaInterface.getObjectType方法代码示例

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


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

示例1: addToTree

import org.pentaho.di.repository.RepositoryElementMetaInterface; //导入方法依赖的package包/类
private static void addToTree( TreeItem ti, String filterString, Pattern pattern,
    List<RepositoryElementMetaInterface> repositoryObjects ) {
  for ( int i = 0; i < repositoryObjects.size(); i++ ) {
    boolean add = false;
    RepositoryElementMetaInterface repositoryObject = repositoryObjects.get( i );

    if ( filterString == null && pattern == null ) {
      add = true;
    } else {
      add |= addItem( repositoryObject.getName(), filterString, pattern );
      add |= addItem( repositoryObject.getDescription(), filterString, pattern );
      add |= addItem( repositoryObject.getModifiedUser(), filterString, pattern );
      if ( !add && repositoryObject.getModifiedDate() != null ) {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat( DATE_FORMAT );
        add = addItem( simpleDateFormat.format( repositoryObject.getModifiedDate() ), filterString, pattern );
      }
      if ( !add && repositoryObject.getObjectType() != null ) {
        add = addItem( repositoryObject.getObjectType().getTypeDescription(), filterString, pattern );
      }
    }

    if ( add ) {
      createTreeItem( ti, repositoryObject );
    }
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:27,代码来源:RepositoryDirectoryUI.java

示例2: createTreeItem

import org.pentaho.di.repository.RepositoryElementMetaInterface; //导入方法依赖的package包/类
private static void createTreeItem( TreeItem parent, RepositoryElementMetaInterface repositoryObject ) {
  TreeItem tiObject = new TreeItem( parent, SWT.NONE );
  tiObject.setData( repositoryObject );
  if ( repositoryObject.getObjectType() == RepositoryObjectType.TRANSFORMATION ) {
    tiObject.setImage( GUIResource.getInstance().getImageTransRepo() );
  } else if ( repositoryObject.getObjectType() == RepositoryObjectType.JOB ) {
    tiObject.setImage( GUIResource.getInstance().getImageJobRepo() );
  }

  SimpleDateFormat simpleDateFormat = new SimpleDateFormat( DATE_FORMAT );
  tiObject.setText( 0, Const.NVL( repositoryObject.getName(), "" ) );
  tiObject.setText( 1, Const.NVL( repositoryObject.getObjectType().getTypeDescription(), "" ).toUpperCase() );
  tiObject.setText( 2, Const.NVL( repositoryObject.getModifiedUser(), "" ) );
  tiObject.setText( 3, repositoryObject.getModifiedDate() != null ? simpleDateFormat
    .format( repositoryObject.getModifiedDate() ) : "" );
  tiObject.setText( 4, Const.NVL( repositoryObject.getDescription(), "" ) );

  if ( repositoryObject.isDeleted() ) {
    tiObject.setForeground( GUIResource.getInstance().getColorRed() );
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:22,代码来源:RepositoryDirectoryUI.java

示例3: delSelectedObjects

import org.pentaho.di.repository.RepositoryElementMetaInterface; //导入方法依赖的package包/类
public boolean delSelectedObjects()
{
	TreeItem items[] = wTree.getSelection();
	boolean error = false;

	MessageBox mb = new MessageBox(shell, SWT.ICON_WARNING | SWT.YES | SWT.NO);
	mb.setMessage(BaseMessages.getString(PKG, "RepositoryExplorerDialog.Trans.Delete.Confirm.Message1")+(items.length>1?BaseMessages.getString(PKG, "RepositoryExplorerDialog.Trans.Delete.Confirm.Message2")+items.length+BaseMessages.getString(PKG, "RepositoryExplorerDialog.Trans.Delete.Confirm.Message3"):BaseMessages.getString(PKG, "RepositoryExplorerDialog.Trans.Delete.Confirm.Message4"))); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
	mb.setText(BaseMessages.getString(PKG, "RepositoryExplorerDialog.Trans.Delete.Confirm.Title")); //$NON-NLS-1$
	int answer = mb.open();
	
	if (answer!=SWT.YES)
	{
		return false;
	}
	
	for (int i=0;i<items.length;i++)
	{
		final RepositoryElementMetaInterface repositoryObject = objectMap.get(ConstUI.getTreePath(items[i], 0));
		if (repositoryObject!=null) {
			
			try {
				switch(repositoryObject.getObjectType()) {
				case TRANSFORMATION : rep.deleteTransformation(repositoryObject.getObjectId()); break;
				case JOB            : rep.deleteJob(repositoryObject.getObjectId()); break;
				default: 
					break;
				}
			} catch(Exception e) {
				new ErrorDialog(shell, BaseMessages.getString(PKG, "RepositoryExplorerDialog.Trans.Delete.ErrorRemoving.Title"), BaseMessages.getString(PKG, "RepositoryExplorerDialog.Trans.Delete.ErrorRemoving.Message")+repositoryObject.getName()+"]", e); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
				error=true;
			}
		}
	}
	refreshTree();
	
	return !error;
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:38,代码来源:RepositoryExplorerDialog.java

示例4: ok

import org.pentaho.di.repository.RepositoryElementMetaInterface; //导入方法依赖的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) {
        repositoryObject = (RepositoryElementMetaInterface) ti.getData();
        if (repositoryObject != null) {
          objectName = repositoryObject.getName();
          objectDirectory = repositoryObject.getRepositoryDirectory();
          objectId = repositoryObject.getObjectId();
          objectType = repositoryObject.getObjectType();
        } else {
          // For backward compatibility, we should rarely end up here...
          //
          String path[] = ConstUI.getTreeStrings(ti.getParentItem());
          objectName = ti.getText(0);
          objectType = null;
          for (RepositoryObjectType type : RepositoryObjectType.values()) {
            if (type.getTypeDescription().equalsIgnoreCase(ti.getText(1))) {
              objectType = type;
              break;
            }
          }
          objectDirectory = directoryTree.findDirectory(path);
        }

        if (objectDirectory != null) {
          dispose();
        } else {
          MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_ERROR);
          mb.setMessage(BaseMessages.getString(PKG, "SelectObjectDialog.Dialog.DirectoryNotFound.Message")); //$NON-NLS-1$
          mb.setText(BaseMessages.getString(PKG, "SelectObjectDialog.Dialog.DirectoryNotFound.Title")); //$NON-NLS-1$
          mb.open();
        }
      }
    }
  }
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:43,代码来源:SelectObjectDialog.java

示例5: ok

import org.pentaho.di.repository.RepositoryElementMetaInterface; //导入方法依赖的package包/类
private void ok() {
  // Something has to be selected!
  if ( wTree.getSelectionCount() > 0 ) {
    TreeItem ti = wTree.getSelection()[ 0 ];

    // No directory!
    if ( !Boolean.TRUE.equals( wTree.getSelection()[ 0 ].getData( "isFolder" ) ) ) {
      int level = ConstUI.getTreeLevel( ti );
      if ( level > 0 ) {
        repositoryObject = (RepositoryElementMetaInterface) ti.getData();
        if ( repositoryObject != null ) {
          objectName = repositoryObject.getName();
          objectDirectory = repositoryObject.getRepositoryDirectory();
          objectId = repositoryObject.getObjectId();
          objectType = repositoryObject.getObjectType();
        } else {
          // For backward compatibility, we should rarely end up here...
          //
          String[] path = ConstUI.getTreeStrings( ti.getParentItem() );
          objectName = ti.getText( 0 );
          objectType = null;
          for ( RepositoryObjectType type : RepositoryObjectType.values() ) {
            if ( type.getTypeDescription().equalsIgnoreCase( ti.getText( 1 ) ) ) {
              objectType = type;
              break;
            }
          }
          objectDirectory = directoryTree.findDirectory( path );
        }

        if ( objectDirectory != null ) {
          dispose();
        } else {
          MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR );
          mb.setMessage( BaseMessages.getString( PKG, "SelectObjectDialog.Dialog.DirectoryNotFound.Message" ) );
          mb.setText( BaseMessages.getString( PKG, "SelectObjectDialog.Dialog.DirectoryNotFound.Title" ) );
          mb.open();
        }
      }
    }
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:43,代码来源:SelectObjectDialog.java

示例6: delSelectedObjects

import org.pentaho.di.repository.RepositoryElementMetaInterface; //导入方法依赖的package包/类
public boolean delSelectedObjects() {
  TreeItem[] items = wTree.getSelection();
  boolean error = false;

  MessageBox mb = new MessageBox( shell, SWT.ICON_WARNING | SWT.YES | SWT.NO );
  mb
    .setMessage( BaseMessages.getString( PKG, "RepositoryExplorerDialog.Trans.Delete.Confirm.Message1" )
      + ( items.length > 1
        ? BaseMessages.getString( PKG, "RepositoryExplorerDialog.Trans.Delete.Confirm.Message2" )
          + items.length + BaseMessages.getString( PKG, "RepositoryExplorerDialog.Trans.Delete.Confirm.Message3" )
        : BaseMessages.getString( PKG, "RepositoryExplorerDialog.Trans.Delete.Confirm.Message4" ) ) );
  mb.setText( BaseMessages.getString( PKG, "RepositoryExplorerDialog.Trans.Delete.Confirm.Title" ) );
  int answer = mb.open();

  if ( answer != SWT.YES ) {
    return false;
  }

  for ( int i = 0; i < items.length; i++ ) {
    final RepositoryElementMetaInterface repositoryObject = objectMap.get( ConstUI.getTreePath( items[i], 0 ) );
    if ( repositoryObject != null ) {

      try {
        switch ( repositoryObject.getObjectType() ) {
          case TRANSFORMATION:
            rep.deleteTransformation( repositoryObject.getObjectId() );
            break;
          case JOB:
            rep.deleteJob( repositoryObject.getObjectId() );
            break;
          default:
            break;
        }
      } catch ( Exception e ) {
        new ErrorDialog(
          shell,
          BaseMessages.getString( PKG, "RepositoryExplorerDialog.Trans.Delete.ErrorRemoving.Title" ), BaseMessages
            .getString( PKG, "RepositoryExplorerDialog.Trans.Delete.ErrorRemoving.Message" )
            + repositoryObject.getName() + "]", e );
        error = true;
      }
    }
  }
  refreshTree();

  return !error;
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:48,代码来源:RepositoryExplorerDialog.java


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