Package org.pentaho.mantle.client.solutionbrowser.filelist

Examples of org.pentaho.mantle.client.solutionbrowser.filelist.FileItem


    final SolutionBrowserPanel sbp = SolutionBrowserPanel.getInstance();
    if ( this.getSolutionPath() != null ) {
      sbp.getFile( this.getSolutionPath(), new SolutionFileHandler() {
        @Override
        public void handle( RepositoryFile repositoryFile ) {
          RunInBackgroundCommand.this.repositoryFile = new FileItem( repositoryFile, null, null, false, null );
          showDialog( true );
        }
      } );
    } else {
      performOperation( true );
View Full Code Here


  public void onTabDeselected( SolutionBrowserDeselectEvent event ) {
    onSolutionBrowserEvent( event );
  }

  private void onSolutionBrowserEvent( ISolutionBrowserEvent event ) {
    FileItem selectedItem = null;
    if ( event.getFileItems() != null && event.getFileItems().size() > 0 ) {
      selectedItem = event.getFileItems().get( 0 );
    }
    try {
      handleSolutionBrowserEvent( event.getWidget(), selectedItem );
View Full Code Here

    MantleApplication.overlayPanel.setVisible( true );
  }

  @Override
  protected Widget newDragProxy( DragContext context ) {
    FileItem item = (FileItem) context.draggable;
    FileItem newItem = item.makeDragProxy();
    preview = newItem;
    return newItem;
  }
View Full Code Here

      protected void performOperation() {
        performOperation( false );
      }

      protected void performOperation( boolean feedback ) {
        final FileItem selectedFileItem = filesListPanel.getSelectedFileItems().get( 0 );
        String url = null;
        url =
          "api/repo/files/" + SolutionBrowserPanel.pathToId( filesListPanel.getSelectedFileItems().get( 0 ).getRepositoryFile().getPath() ) + "/generatedContent"; //$NON-NLS-1$ //$NON-NLS-2$
        url = getPath() + url;

        if ( mode == FileCommand.COMMAND.BACKGROUND ) {
          MessageDialogBox dialogBox = new MessageDialogBox( Messages.getString( "info" ), //$NON-NLS-1$
            Messages.getString( "backgroundExecutionWarning" ), //$NON-NLS-1$
            true, false, true );
          dialogBox.center();

          url += "&background=true"; //$NON-NLS-1$

          RequestBuilder builder = new RequestBuilder( RequestBuilder.GET, url );
          try {
            builder.setHeader( "If-Modified-Since", "01 Jan 1970 00:00:00 GMT" );
            builder.sendRequest( null, new RequestCallback() {

              public void onError( Request request, Throwable exception ) {
                MessageDialogBox dialogBox =
                  new MessageDialogBox(
                    Messages.getString( "error" ), Messages.getString( "couldNotBackgroundExecute" ), false, false, true ); //$NON-NLS-1$ //$NON-NLS-2$
                dialogBox.center();
              }

              public void onResponseReceived( Request request, Response response ) {
              }

            } );
          } catch ( RequestException e ) {
            // ignored
          }
        } else if ( mode == FileCommand.COMMAND.NEWWINDOW ) {
          // popup blockers might attack this
          Window.open( url, "_blank", "menubar=yes,location=no,resizable=yes,scrollbars=yes,status=no" ); //$NON-NLS-1$ //$NON-NLS-2$
        } else if ( mode == FileCommand.COMMAND.SUBSCRIBE ) {
          final String myurl = url + "&subscribepage=yes"; //$NON-NLS-1$
          contentTabPanel.showNewURLTab( selectedFileItem.getLocalizedName(), selectedFileItem.getLocalizedName(),
            myurl, true );
        } else {
          contentTabPanel.showNewURLTab( selectedFileItem.getLocalizedName(), selectedFileItem.getLocalizedName(), url,
            true );
        }
      }

    };
View Full Code Here

  @Override
  public void dragEnd() {
    if ( currentFrameAcceptsDrops() == false ) {
      return;
    }
    FileItem item = (FileItem) context.draggable;
    context.vetoException = new Exception();
    super.dragEnd();
    preview.removeFromParent();
    preview = null;
    MantleApplication.overlayPanel.setVisible( false );
    notifyContentDragEnd( item.getPath(), item.getName(), item.getLocalizedName() );
    currentDragItem = null;
  }
View Full Code Here

TOP

Related Classes of org.pentaho.mantle.client.solutionbrowser.filelist.FileItem

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.