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

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


  public void editFile() {
    if ( filesListPanel.getSelectedFileItems() == null || filesListPanel.getSelectedFileItems().size() != 1 ) {
      return;
    }

    RepositoryFile file = filesListPanel.getSelectedFileItems().get( 0 ).getRepositoryFile();
    if ( file.getName().endsWith( ".analysisview.xaction" ) ) { //$NON-NLS-1$
      openFile( file, COMMAND.RUN );
    } else {
      // check to see if a plugin supports editing
      ContentTypePlugin plugin = PluginOptionsHelper.getContentTypePlugin( file.getName() );
      if ( plugin != null && plugin.hasCommand( COMMAND.EDIT ) ) {
        // load the editor for this plugin
        String editUrl =
          getPath()
            + "api/repos/" + pathToId( file.getPath() ) + "/" + ( plugin != null && ( plugin.getCommandPerspective( COMMAND.EDIT ) != null ) ? plugin.getCommandPerspective( COMMAND.EDIT ) : "editor" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$      
        // See if it's already loaded
        for ( int i = 0; i < contentTabPanel.getTabCount(); i++ ) {
          Widget w = contentTabPanel.getTab( i ).getContent();
          if ( w instanceof IFrameTabPanel && ( (IFrameTabPanel) w ).getUrl().endsWith( editUrl ) ) {
            // Already up, select and exit
            contentTabPanel.selectTab( i );
            return;
          }
        }

        contentTabPanel
          .showNewURLTab(
            Messages.getString( "editingColon" ) + file.getTitle(), Messages.getString( "editingColon" ) + file.getTitle(), editUrl, true ); //$NON-NLS-1$ //$NON-NLS-2$

      } else {
        MessageDialogBox dialogBox = new MessageDialogBox( Messages.getString( "error" ), //$NON-NLS-1$
          Messages.getString( "cannotEditFileType" ), //$NON-NLS-1$
          true, false, true );
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

  }

  public void deselect() {
    for ( int i = 0; i < filesList.getRowCount(); i++ ) {
      FileItem item = (FileItem) filesList.getWidget( i, 0 );
      RepositoryFile file = item.getRepositoryFile();
      if ( file.isHidden() ) {
        item.setStyleName( "hiddenFileLabel" ); //$NON-NLS-1$
      } else {
        item.setStyleName( "fileLabel" ); //$NON-NLS-1$
      }
View Full Code Here

  }

  public void setSelectedFileItems( List<FileItem> fileItems ) {
    // Deselect all prior selections
    for ( FileItem fileItem : selectedFileItems ) {
      RepositoryFile file = fileItem.getRepositoryFile();
      if ( file.isHidden() ) {
        fileItem.setStyleName( "hiddenFileLabel" );
      } else {
        fileItem.setStyleName( "fileLabel" );
      }

    }
    // clear the prior selections list
    selectedFileItems.clear();
    // Add all the new items
    selectedFileItems.addAll( fileItems );
    // and make sure they're selected
    for ( FileItem fileItem : selectedFileItems ) {
      RepositoryFile file = fileItem.getRepositoryFile();
      if ( file.isHidden() ) {
        fileItem.setStyleName( "hiddenFileLabelSelected" );
      } else {
        fileItem.setStyleName( "fileLabelSelected" );
      }
    }
View Full Code Here

  public void selectNextItem( List<FileItem> currentItems ) {
    if ( currentItems == null || currentItems.size() < 1 ) {
      return;
    }
    FileItem currentItem = currentItems.get( currentItems.size() - 1 );
    RepositoryFile currentRepositoryFile = currentItem.getRepositoryFile();
    int myIndex = -1;
    for ( int i = 0; i < getFileCount(); i++ ) {
      FileItem fileItem = getFileItem( i );
      if ( fileItem == currentItem ) {
        myIndex = i;
      }
    }
    if ( myIndex >= 0 && myIndex < getFileCount() - 1 ) {
      if ( currentRepositoryFile.isHidden() ) {
        currentItem.setStyleName( "hiddenFileLabel" ); //$NON-NLS-1$
      } else {
        currentItem.setStyleName( "fileLabel" ); //$NON-NLS-1$ 
      }

      FileItem nextItem = getFileItem( myIndex + 1 );
      RepositoryFile nextRepositoryFile = nextItem.getRepositoryFile();
      if ( nextRepositoryFile.isHidden() ) {
        nextItem.setStyleName( "hiddenFileLabelSelected" ); //$NON-NLS-1$
      } else {
        nextItem.setStyleName( "fileLabelSelected" ); //$NON-NLS-1$ 
      }
View Full Code Here

TOP

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

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.