• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java UIRepositoryContent类的典型用法和代码示例

java 1次浏览

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

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

示例1: openContent

点赞 3

import org.pentaho.di.ui.repository.repositoryexplorer.model.UIRepositoryContent; //导入依赖的package包/类
public void openContent(Object[] items) {
  if ((items != null) && (items.length > 0)) {
    for (Object o : items) {
      if (o instanceof UIRepositoryDirectory) {
        ((UIRepositoryDirectory) o).toggleExpanded();
        List<Object> selectedFolder = new ArrayList<Object>();
        selectedFolder.add(o);
        folderTree.setSelectedItems(selectedFolder);
      } else if ((mainController != null && mainController.getCallback() != null)
          && (o instanceof UIRepositoryContent)) {
        if (mainController.getCallback().open((UIRepositoryContent) o, null)) {
          //TODO: fire request to close dialog
        }
      }
    }
  }
}
 

开发者ID:yintaoxue,
项目名称:read-open-source-code,
代码行数:18,
代码来源:BrowseController.java

示例2: renameContent

点赞 3

import org.pentaho.di.ui.repository.repositoryexplorer.model.UIRepositoryContent; //导入依赖的package包/类
public void renameContent() throws Exception {
  try {
    Collection<UIRepositoryContent> content = fileTable.getSelectedItems();
    UIRepositoryObject contentToRename = content.iterator().next();
    renameRepositoryObject(contentToRename);
    if (contentToRename instanceof UIRepositoryDirectory) {
      directoryBinding.fireSourceChanged();
    }
    selectedItemsBinding.fireSourceChanged();
  } catch (Throwable th) {
    messageBox.setTitle(BaseMessages.getString(PKG, "Dialog.Error")); //$NON-NLS-1$
    messageBox.setAcceptLabel(BaseMessages.getString(PKG, "Dialog.Ok")); //$NON-NLS-1$
    messageBox.setMessage(BaseMessages.getString(PKG, th.getLocalizedMessage()));
    messageBox.open();
  }
}
 

开发者ID:yintaoxue,
项目名称:read-open-source-code,
代码行数:17,
代码来源:BrowseController.java

示例3: openContent

点赞 3

import org.pentaho.di.ui.repository.repositoryexplorer.model.UIRepositoryContent; //导入依赖的package包/类
public void openContent( Object[] items ) {
  if ( ( items != null ) && ( items.length > 0 ) ) {
    for ( Object o : items ) {
      if ( o instanceof UIRepositoryDirectory ) {
        ( (UIRepositoryDirectory) o ).toggleExpanded();
        List<Object> selectedFolder = new ArrayList<Object>();
        selectedFolder.add( o );
        folderTree.setSelectedItems( selectedFolder );
      } else if ( ( mainController != null && mainController.getCallback() != null )
          && ( o instanceof UIRepositoryContent ) ) {

        try {
          mainController.getCallback().open( (UIRepositoryContent) o, null );
        } catch ( Exception e ) {
          mainController.handleLostRepository( e );
        }
        // TODO: fire request to close dialog

      }
    }
  }
}
 

开发者ID:pentaho,
项目名称:pentaho-kettle,
代码行数:23,
代码来源:BrowseController.java

示例4: renameContent

点赞 3

import org.pentaho.di.ui.repository.repositoryexplorer.model.UIRepositoryContent; //导入依赖的package包/类
public void renameContent() throws Exception {
  try {
    Collection<UIRepositoryContent> content = fileTable.getSelectedItems();
    UIRepositoryObject contentToRename = content.iterator().next();
    renameRepositoryObject( contentToRename );
    if ( contentToRename instanceof UIRepositoryDirectory ) {
      directoryBinding.fireSourceChanged();
    }
    selectedItemsBinding.fireSourceChanged();
  } catch ( Throwable th ) {
    if ( mainController == null || !mainController.handleLostRepository( th ) ) {
      messageBox.setTitle( BaseMessages.getString( PKG, "Dialog.Error" ) );
      messageBox.setAcceptLabel( BaseMessages.getString( PKG, "Dialog.Ok" ) );
      messageBox.setMessage( BaseMessages.getString( PKG, th.getLocalizedMessage() ) );
      messageBox.open();
    }
  }
}
 

开发者ID:pentaho,
项目名称:pentaho-kettle,
代码行数:19,
代码来源:BrowseController.java

示例5: openRevision

点赞 3

import org.pentaho.di.ui.repository.repositoryexplorer.model.UIRepositoryContent; //导入依赖的package包/类
public void openRevision() {
  Collection<UIRepositoryContent> content = fileTable.getSelectedItems();
  UIRepositoryContent contentToOpen = content.iterator().next();

  Collection<UIRepositoryObjectRevision> revision = revisionTable.getSelectedItems();

  // TODO: Is it a requirement to allow opening multiple revisions?
  UIRepositoryObjectRevision revisionToOpen = revision.iterator().next();
  if ( mainController != null && mainController.getCallback() != null ) {
    try {
      // TODO: fire request to close dialog
      mainController.getCallback().open( contentToOpen, revisionToOpen.getName() );
    } catch ( Exception e ) {
      if ( mainController != null ) {
        mainController.handleLostRepository( e );
      }
    }
  }
}
 

开发者ID:pentaho,
项目名称:pentaho-kettle,
代码行数:20,
代码来源:RevisionController.java

示例6: areAnyRepositoryObjectsLocked

点赞 3

import org.pentaho.di.ui.repository.repositoryexplorer.model.UIRepositoryContent; //导入依赖的package包/类
private boolean areAnyRepositoryObjectsLocked( DropEvent event, UIRepositoryObjects repositoryObjects )
  throws KettleException {
  for ( UIRepositoryObject ro : repositoryObjects ) {
    if ( ro instanceof ILockObject ) {
      final UIRepositoryContent contentToLock = (UIRepositoryContent) ro;
      if ( ( (ILockObject) contentToLock ).isLocked() ) {
        // Content is locked, move is not allowed.
        event.setAccepted( false );
        messageBox.setTitle( BaseMessages.getString( PKG, "Dialog.Error" ) ); //$NON-NLS-1$
        messageBox.setAcceptLabel( BaseMessages.getString( PKG, "Dialog.Ok" ) ); //$NON-NLS-1$
        messageBox.setMessage( BaseMessages.getString( PKG, "BrowseController.FolderMoveNotAllowed" ) ); //$NON-NLS-1$
        messageBox.open();
        return true;
      }
    }
  }
  return false;
}
 

开发者ID:pentaho,
项目名称:pentaho-kettle,
代码行数:19,
代码来源:RepositoryLockController.java

示例7: onDragFromLocalTable

点赞 2

import org.pentaho.di.ui.repository.repositoryexplorer.model.UIRepositoryContent; //导入依赖的package包/类
public void onDragFromLocalTable( DropEvent event ) {
  try {
    Collection<Object> selectedRepoObjects = fileTable.getSelectedItems();
    if ( selectedRepoObjects.size() > 0 ) {
      for ( Object ro : selectedRepoObjects ) {
        if ( ro instanceof UIRepositoryObject && ro instanceof ILockObject ) {
          final UIRepositoryContent contentToLock = (UIRepositoryContent) ro;
          if ( ( (ILockObject) contentToLock ).isLocked() ) {
            // Content is locked, not allowed to move
            event.setAccepted( false );
            messageBox.setTitle( BaseMessages.getString( PKG, "Dialog.Error" ) ); //$NON-NLS-1$
            messageBox.setAcceptLabel( BaseMessages.getString( PKG, "Dialog.Ok" ) ); //$NON-NLS-1$
            messageBox.setMessage( BaseMessages.getString( PKG, "BrowseController.MoveNotAllowed" ) ); //$NON-NLS-1$
            messageBox.open();
            break;
          } else {
            // Content is not locked, check default permissions
            browseController.onDragFromLocalTable( event );
          }
        } else if ( ro instanceof UIRepositoryDirectory
            && repositoryDirectoryHasLockedObject( event, (UIRepositoryDirectory) ro ) ) {
          // locked content nested in this directory. move not allowed.
          event.setAccepted( false );
          break;
        }
      }
    }
  } catch ( Exception e ) {
    throw new RuntimeException( e );
  }
}
 

开发者ID:pentaho,
项目名称:pentaho-kettle,
代码行数:32,
代码来源:RepositoryLockController.java

示例8: sourceToTarget

点赞 2

import org.pentaho.di.ui.repository.repositoryexplorer.model.UIRepositoryContent; //导入依赖的package包/类
@Override
public Boolean sourceToTarget( List<UIRepositoryObject> selectedRepoObjects ) {
  boolean result = false;

  try {
    if ( selectedRepoObjects.size() == 1 && selectedRepoObjects.get( 0 ) instanceof UIRepositoryDirectory ) {
      return true;
    } else if ( selectedRepoObjects.size() == 1 && selectedRepoObjects.get( 0 ) instanceof ILockObject ) {
      final UIRepositoryContent contentToLock = (UIRepositoryContent) selectedRepoObjects.get( 0 );

      if ( ( (ILockObject) contentToLock ).isLocked() ) {
        if ( repository instanceof PurRepository
                //repository can be Proxy of repository and first part condition will fail
                || repository.getRepositoryMeta() instanceof PurRepositoryMeta ) {
          result = service.canUnlockFileById( contentToLock.getObjectId() );
        } else {
          result =
              ( (ILockObject) contentToLock ).getRepositoryLock().getLogin().equalsIgnoreCase(
                  repository.getUserInfo().getLogin() );
        }
      } else {
        // Content is not locked, permit locking
        result = true;
      }
    }
  } catch ( Exception e ) {
    throw new RuntimeException( e );
  }

  return result;
}
 

开发者ID:pentaho,
项目名称:pentaho-kettle,
代码行数:32,
代码来源:RepositoryLockController.java

示例9: viewLockNote

点赞 2

import org.pentaho.di.ui.repository.repositoryexplorer.model.UIRepositoryContent; //导入依赖的package包/类
public void viewLockNote() throws Exception {
  List<UIRepositoryObject> selectedRepoObjects = browseController.getSelectedFileItems();
  if ( selectedRepoObjects.size() > 0 && selectedRepoObjects.get( 0 ) instanceof UIRepositoryContent ) {
    final UIRepositoryContent contentToLock = (UIRepositoryContent) selectedRepoObjects.get( 0 );

    XulMessageBox msgBox = (XulMessageBox) document.createElement( "messagebox" ); //$NON-NLS-1$
    msgBox.setTitle( BaseMessages.getString( PKG, "PurRepository.LockNote.Title" ) ); //$NON-NLS-1$
    msgBox.setMessage( ( (ILockObject) contentToLock ).getLockMessage() );

    msgBox.open();
  }
}
 

开发者ID:pentaho,
项目名称:pentaho-kettle,
代码行数:13,
代码来源:RepositoryLockController.java

示例10: setMenuItemEnabledState

点赞 2

import org.pentaho.di.ui.repository.repositoryexplorer.model.UIRepositoryContent; //导入依赖的package包/类
public void setMenuItemEnabledState( List<UIRepositoryObject> selectedRepoObjects ) {
  try {
    boolean result = false;
    if ( selectedRepoObjects.size() == 1 && selectedRepoObjects.get( 0 ) instanceof UIRepositoryDirectory ) {
      lockFileMenuItem.setDisabled( true );
      deleteFileMenuItem.setDisabled( false );
      renameFileMenuItem.setDisabled( false );
    } else if ( selectedRepoObjects.size() == 1 && selectedRepoObjects.get( 0 ) instanceof ILockObject ) {
      final UIRepositoryContent contentToLock = (UIRepositoryContent) selectedRepoObjects.get( 0 );
      if ( ( (ILockObject) contentToLock ).isLocked() ) {
        if ( repository instanceof PurRepository
                //repository can be Proxy of repository and first part condition will fail
                || repository.getRepositoryMeta() instanceof PurRepositoryMeta ) {
          result = service.canUnlockFileById( contentToLock.getObjectId() );

        } else {
          result =
              ( (ILockObject) contentToLock ).getRepositoryLock().getLogin().equalsIgnoreCase(
                  repository.getUserInfo().getLogin() );
        }
        lockFileMenuItem.setDisabled( !result );
        deleteFileMenuItem.setDisabled( !result );
        renameFileMenuItem.setDisabled( !result );
      } else {
        lockFileMenuItem.setDisabled( false );
        deleteFileMenuItem.setDisabled( false );
        renameFileMenuItem.setDisabled( false );
      }
    } else {
      lockFileMenuItem.setDisabled( true );
      deleteFileMenuItem.setDisabled( true );
      renameFileMenuItem.setDisabled( true );
    }
  } catch ( Exception e ) {
    throw new RuntimeException( e );
  }

}
 

开发者ID:pentaho,
项目名称:pentaho-kettle,
代码行数:39,
代码来源:RepositoryLockController.java

示例11: applyOnObjectOnly

点赞 2

import org.pentaho.di.ui.repository.repositoryexplorer.model.UIRepositoryContent; //导入依赖的package包/类
/**
 * applyOnObjectOnly is called to save acl for a file object only
 * 
 * @param roList
 * @param hideDialog
 */
private void applyOnObjectOnly( List<UIRepositoryObject> roList, boolean hideDialog ) {
  try {
    if ( roList.get( 0 ) instanceof UIRepositoryDirectory ) {
      UIRepositoryDirectory rd = (UIRepositoryDirectory) roList.get( 0 );
      if ( rd instanceof IAclObject ) {
        ( (IAclObject) rd ).setAcls( viewAclsModel );
      } else {
        throw new IllegalStateException( BaseMessages.getString( PKG, "PermissionsController.NoAclSupport" ) ); //$NON-NLS-1$
      }

    } else {
      UIRepositoryContent rc = (UIRepositoryContent) roList.get( 0 );
      if ( rc instanceof ILockObject && ( (ILockObject) rc ).isLocked() ) {
        messageBox.setTitle( BaseMessages.getString( PKG, "Dialog.Error" ) );//$NON-NLS-1$
        messageBox.setAcceptLabel( BaseMessages.getString( PKG, "Dialog.Ok" ) );//$NON-NLS-1$
        messageBox.setMessage( BaseMessages.getString( PKG, "PermissionsController.LockedObjectWarning" ) ); //$NON-NLS-1$
        messageBox.open();
        viewAclsModel.setModelDirty( false );
        return;
      } else if ( rc instanceof IAclObject ) {
        ( (IAclObject) rc ).setAcls( viewAclsModel );
      } else {
        throw new IllegalStateException( BaseMessages.getString( PKG, "PermissionsController.NoAclSupport" ) ); //$NON-NLS-1$
      }
    }
    /*
     * if (hideDialog) { applyAclConfirmationDialog.hide(); }
     */
    viewAclsModel.setModelDirty( false );
    messageBox.setTitle( BaseMessages.getString( PKG, "Dialog.Success" ) ); //$NON-NLS-1$
    messageBox.setAcceptLabel( BaseMessages.getString( PKG, "Dialog.Ok" ) ); //$NON-NLS-1$
    messageBox.setMessage( BaseMessages.getString( PKG, "PermissionsController.PermissionAppliedSuccessfully" ) ); //$NON-NLS-1$
    messageBox.open();
  } catch ( AccessDeniedException ade ) {
    /*
     * if (hideDialog) { applyAclConfirmationDialog.hide(); }
     */
    if ( mainController == null || !mainController.handleLostRepository( ade ) ) {
      messageBox.setTitle( BaseMessages.getString( PKG, "Dialog.Error" ) ); //$NON-NLS-1$
      messageBox.setAcceptLabel( BaseMessages.getString( PKG, "Dialog.Ok" ) ); //$NON-NLS-1$
      messageBox.setMessage( ade.getLocalizedMessage() );
      messageBox.open();
    }
  } catch ( KettleException kex ) {
    if ( mainController == null || !mainController.handleLostRepository( kex ) ) {
      messageBox.setTitle( BaseMessages.getString( PKG, "Dialog.Error" ) ); //$NON-NLS-1$
      messageBox.setAcceptLabel( BaseMessages.getString( PKG, "Dialog.Ok" ) ); //$NON-NLS-1$
      messageBox.setMessage( kex.getLocalizedMessage() );
      messageBox.open();
    }
  }
}
 

开发者ID:pentaho,
项目名称:pentaho-kettle,
代码行数:59,
代码来源:PermissionsController.java

示例12: open

点赞 1

import org.pentaho.di.ui.repository.repositoryexplorer.model.UIRepositoryContent; //导入依赖的package包/类
/**
 * request that specified object be opened in 'Spoon' display
 * @param object
 * @return boolean indicating if repository explorer dialog should close
 */
boolean open(UIRepositoryContent object, String revision);
 

开发者ID:yintaoxue,
项目名称:read-open-source-code,
代码行数:7,
代码来源:RepositoryExplorerCallback.java

示例13: open

点赞 1

import org.pentaho.di.ui.repository.repositoryexplorer.model.UIRepositoryContent; //导入依赖的package包/类
/**
 * request that specified object be opened in 'Spoon' display
 *
 * @param object
 * @return boolean indicating if repository explorer dialog should close
 */
boolean open( UIRepositoryContent object, String revision ) throws Exception;
 

开发者ID:pentaho,
项目名称:pentaho-kettle,
代码行数:8,
代码来源:RepositoryExplorerCallback.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)