Package org.pentaho.gwt.widgets.client.filechooser

Examples of org.pentaho.gwt.widgets.client.filechooser.RepositoryFileTree


import java.util.List;

public class RepositoryFileUtils {

  public static RepositoryFileTree convertToRepositoryFileTree( RepositoryFileTreeDto tree ) {
    RepositoryFileTree fileTree = new RepositoryFileTree();
    List<RepositoryFileTree> fileList = new ArrayList<RepositoryFileTree>();
    RepositoryFile file = convertToRepositoryFile( tree.getFile() );
    fileTree.setFile( file );
    for ( RepositoryFileTreeDto treeItem : tree.getChildren() ) {
      fileList.add( convertToRepositoryFileTree( treeItem ) );
    }
    fileTree.setChildren( fileList );
    return fileTree;
  }
View Full Code Here


    if ( mode == COMMAND.PROPERTIES ) {
      new FilePropertiesCommand( repositoryFile ).execute();
    } else if ( mode == COMMAND.DELETE ) {
      TreeItem item = sbp.getSolutionTree().getSelectedItem();
      RepositoryFileTree tree = (RepositoryFileTree) item.getUserObject();
      new DeleteFolderCommand( tree.getFile() ).execute();
    } else if ( mode == COMMAND.CREATE_FOLDER ) {
      TreeItem item = sbp.getSolutionTree().getSelectedItem();
      RepositoryFileTree tree = (RepositoryFileTree) item.getUserObject();
      new NewFolderCommand( tree.getFile() ).execute();
    } else if ( mode == COMMAND.EXPORT ) {
      new ExportFileCommand( repositoryFile ).execute();
    } else if ( mode == COMMAND.IMPORT ) {
      new ImportFileCommand( repositoryFile ).execute();
    } else if ( mode == COMMAND.PASTE ) {
View Full Code Here

   *
   */
  private void fixLeafNodes() {
    List<FileTreeItem> allNodes = getAllNodes();
    for ( FileTreeItem treeItem : allNodes ) {
      RepositoryFileTree userObject = (RepositoryFileTree) treeItem.getUserObject();
      if ( userObject != null && userObject.getChildren().size() == 0 ) { // This is a leaf node so change the
                                                                          // widget
        treeItem
            .setWidget( new LeafItemWidget( treeItem.getText(), "icon-tree-node", "icon-tree-leaf", "icon-folder" ) ); //$NON-NLS-1$
      } else {
        treeItem.setWidget( new LeafItemWidget( treeItem.getText(), "icon-tree-node", "icon-folder" ) ); //$NON-NLS-1$
View Full Code Here

    if ( item == solutionTree.getTrashItem() ) { // If we're populating from the trash then
      files = solutionTree.getTrashItems();
    } else {
      files = new ArrayList<RepositoryFile>();
      // Get the user object.
      RepositoryFileTree tree = (RepositoryFileTree) item.getUserObject();
      // Since we are only listing the files here. Get to each item of the tree and get the file from it
      for ( RepositoryFileTree treeItem : tree.getChildren() ) {
        String fileName = treeItem.getFile().getName();
        if ( filters != null ) {
          for ( int i = 0; i < filters.length(); i++ ) {
            if ( fileName.endsWith( filters.get( i ) ) ) {
              files.add( treeItem.getFile() );
View Full Code Here

          }
          if ( callback != null ) {
            callback.onSuccess( fileTree );
          }
        } else {
          fileTree = new RepositoryFileTree();
          RepositoryFile errorFile = new RepositoryFile();
          errorFile.setFolder( true );
          errorFile.setName( "!ERROR!" );
          fileTree.setFile( errorFile );
        }
View Full Code Here

TOP

Related Classes of org.pentaho.gwt.widgets.client.filechooser.RepositoryFileTree

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.