Package org.pentaho.mantle.client.solutionbrowser

Examples of org.pentaho.mantle.client.solutionbrowser.SolutionBrowserPanel


  public void setRepositoryFile( RepositoryFile repositoryFile ) {
    this.repositoryFile = repositoryFile;
  }

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


  public void setOutputName( String outputName ) {
    this.outputName = outputName;
  }

  protected void performOperation() {
    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 );
        }
View Full Code Here

      frame.setSize( width, height );
      dialogBox.center();
      frame.setSize( width, height );
    } else {
      SolutionBrowserPanel navigatorPerspective = SolutionBrowserPanel.getInstance();
      navigatorPerspective.getContentTabPanel().showNewURLTab( title, "", url, false ); //$NON-NLS-1$
    }
  }
View Full Code Here

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

  protected void performOperation( boolean feedback ) {
    final SolutionBrowserPanel navigatorPerspective = SolutionBrowserPanel.getInstance();

    retrieveCachedValues( navigatorPerspective.getContentTabPanel().getCurrentFrame() );
    boolean forceReload = false;
    if ( FileChooserDialog.getIsDirty() ) {
      forceReload = true;
      WaitPopup.getInstance().setVisibleById( true, spinnerId );
      FileChooserDialog.setIsDirty( Boolean.FALSE );
    }
    RepositoryFileTreeManager.getInstance().fetchRepositoryFileTree( new AsyncCallback<RepositoryFileTree>() {
      public void onFailure( Throwable caught ) {
      }

      public void onSuccess( RepositoryFileTree tree ) {

        retrieveCachedValues( navigatorPerspective.getContentTabPanel().getCurrentFrame() );

        if ( isSaveAs || name == null ) {
          String fileDir = "";
          if ( path != null && !StringUtils.isEmpty( path ) ) {
            // If has extension
            if ( path.endsWith( name ) ) {
              fileDir = path.substring( 0, path.lastIndexOf( "/" ) );
            } else {
              fileDir = path;
            }

          }
          WaitPopup.getInstance().setVisibleById( false, spinnerId );
          final FileChooserDialog dialog =
            new FileChooserDialog(
              FileChooserMode.SAVE,
              fileDir,
              tree,
              false,
              true,
              Messages.getString( "save" ), Messages.getString( "save" ), navigatorPerspective.getSolutionTree().isShowHiddenFiles() ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
          dialog.setSubmitOnEnter( MantleApplication.submitOnEnter );
          if ( isSaveAs ) {
            dialog.setTitle( Messages.getString( "saveAs" ) ); //$NON-NLS-1$
            dialog.setText( Messages.getString( "saveAs" ) ); //$NON-NLS-1$
          } else {
            dialog.setTitle( Messages.getString( "save" ) ); //$NON-NLS-1$
            dialog.setText( Messages.getString( "save" ) ); //$NON-NLS-1$
          }
          // TODO Uncomment the line below and delete the line after that once gwtwidets have been branched
          dialog.addFileChooserListener( new FileChooserListener() {

            public void dialogCanceled() {

            }

            @Override
            public void fileSelected( final RepositoryFile file, String filePath, String fileName, String title ) {
              SaveCommand.this.type = SolutionFileInfo.Type.XACTION;
              SaveCommand.this.name = fileName;
              SaveCommand.this.path = filePath;
              tabName = name;
              if ( tabName.indexOf( "analysisview.xaction" ) != -1 ) {
                // trim off the analysisview.xaction from the localized-name
                tabName = tabName.substring( 0, tabName.indexOf( "analysisview.xaction" ) - 1 );
              }

              JsArrayString extensions =
                getPossibleExtensions( navigatorPerspective.getContentTabPanel().getCurrentFrameElementId() );
              String fileExtension = null;
              if ( extensions.length() == 1 ) {
                fileExtension = extensions.get( 0 );
              }

              if ( dialog.doesSelectedFileExist( fileExtension ) ) {
                dialog.hide();
                PromptDialogBox overWriteDialog =
                  new PromptDialogBox(
                    Messages.getString( "question" ), Messages.getString( "yes" ), Messages.getString( "no" ), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
                    false, true );
                overWriteDialog.setContent( new Label( Messages.getString( "fileExistsOverwrite" ), false ) ); //$NON-NLS-1$
                overWriteDialog.setCallback( new IDialogCallback() {
                  public void okPressed() {
                    doSaveAs( navigatorPerspective.getContentTabPanel().getCurrentFrameElementId(), name, path, type,
                      true );
                    Window.setTitle( Messages.getString( "productName" ) + " - " + name ); //$NON-NLS-1$ //$NON-NLS-2$
                    FileChooserDialog.setIsDirty( Boolean.TRUE );
                  }

                  public void cancelPressed() {
                    dialog.show();
                  }
                } );
                overWriteDialog.center();
              } else {

                // [Fix for PIR-833]
                if ( file != null && !file.isFolder() && !fileName.equals( title )
                  && filePath.endsWith( file.getName() ) ) {
                  SaveCommand.this.path = filePath.substring( 0, filePath.lastIndexOf( "/" + file.getName() ) );
                }

                doSaveAs( navigatorPerspective.getContentTabPanel().getCurrentFrameElementId(), name, path, type, true );
                Window.setTitle( Messages.getString( "productName" ) + " - " + name ); //$NON-NLS-1$ //$NON-NLS-2$
                persistFileInfoInFrame();
                // navigatorPerspective.addRecent(fullPathWithName, name);
                clearValues();
              }
            }

            @Override
            public void fileSelectionChanged( RepositoryFile file, String filePath, String fileName, String title ) {
              // TODO Auto-generated method stub

            }

          } );
          dialog.center();
        } else {
          doSaveAs( navigatorPerspective.getContentTabPanel().getCurrentFrameElementId(), name, path, type, true );
          clearValues();
        }
        WaitPopup.getInstance().setVisibleById( false, spinnerId );
      }
    }, forceReload, null, null, SolutionBrowserPanel.getInstance().getSolutionTree().isShowHiddenFiles() );
View Full Code Here

    this.solutionPath = solutionPath;
  }

  protected void performOperation() {
    if ( this.getSolutionPath() != null ) {
      SolutionBrowserPanel sbp = SolutionBrowserPanel.getInstance();
      sbp.getFile( this.getSolutionPath(), new SolutionFileHandler() {
        @Override
        public void handle( RepositoryFile repositoryFile ) {
          NewFolderCommand.this.parentFolder = repositoryFile;
          performOperation( true );
        }
View Full Code Here

  }

  public void show() {
    String pathToShow = ( path != null ) ? path : FileDialog.lastPath;

    final SolutionBrowserPanel solutionBrowserPerspective = SolutionBrowserPanel.getInstance();

    final FileChooserDialog dialog =
        new FileChooserDialog( FileChooserMode.OPEN, pathToShow, repositoryFileTree, false, true, title, okText,
            solutionBrowserPerspective.getSolutionTree().isShowHiddenFiles() ) {

          @Override
          public void hide() {
            super.hide();
            GlassPane.getInstance().hide();
View Full Code Here

    this.solutionPath = solutionPath;
  }

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

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

  protected void performOperation( boolean feedback ) {
    final SolutionBrowserPanel solutionBrowserPerspective = SolutionBrowserPanel.getInstance();
    if ( !solutionBrowserPerspective.isNavigatorShowing() ) {
      PerspectiveManager.getInstance().setPerspective( PerspectiveManager.OPENED_PERSPECTIVE );
    }
    solutionBrowserPerspective.setNavigatorShowing( false );

    final String url = GWT.getHostPageBaseURL() + "api/user-settings/MANTLE_SHOW_NAVIGATOR"; //$NON-NLS-1$
    RequestBuilder builder = new RequestBuilder( RequestBuilder.POST, url );
    try {
      builder.setHeader( "If-Modified-Since", "01 Jan 1970 00:00:00 GMT" );
View Full Code Here

  public void setSolutionPath( String solutionPath ) {
    this.solutionPath = solutionPath;
  }

  public void execute() {
    final SolutionBrowserPanel sbp = SolutionBrowserPanel.getInstance();
    if ( this.getSolutionPath() != null ) {
      selectedList = new ArrayList<RepositoryFile>();
      sbp.getFile( this.getSolutionPath(), new SolutionFileHandler() {
        @Override
        public void handle( RepositoryFile repositoryFile ) {
          selectedList.add( repositoryFile );
          performOperation();
        }
      } );
    } else {
      selectedList = sbp.getFilesListPanel().getRepositoryFiles();
      performOperation();
    }
  }
View Full Code Here

  }

  protected void performOperation( boolean feedback ) {
    final IPluginPerspective activePerspective = PerspectiveManager.getInstance().getActivePerspective();

    final SolutionBrowserPanel solutionBrowserPerspective = SolutionBrowserPanel.getInstance();
    boolean forceReload = false;
    if ( FileChooserDialog.getIsDirty() ) {
      forceReload = true;
      WaitPopup.getInstance().setVisibleById( true, spinnerId );
      FileChooserDialog.setIsDirty( Boolean.FALSE );
    }

    RepositoryFileTreeManager.getInstance().fetchRepositoryFileTree( new AsyncCallback<RepositoryFileTree>() {
      public void onFailure( Throwable caught ) {
      }

      public void onSuccess( RepositoryFileTree tree ) {
        // TODO Uncomment the line below and delete the line after that once gwtwidets have been branched
        WaitPopup.getInstance().setVisibleById( false, spinnerId );
        final FileChooserDialog dialog =
            new FileChooserDialog( FileChooserMode.OPEN, lastPath, tree, false, true, solutionBrowserPerspective
                .getSolutionTree().isShowHiddenFiles() );
        dialog.setSubmitOnEnter( MantleApplication.submitOnEnter );
        dialog.addFileChooserListener( new FileChooserListener() {

          public void dialogCanceled() {
            // retain current active perspective
            PerspectiveManager.getInstance().setPerspective( activePerspective.getId() );
          }

          @Override
          public void fileSelected( RepositoryFile repositoryFile, String filePath, String fileName, String title ) {
            dialog.hide();
            solutionBrowserPerspective.openFile( repositoryFile, openMethod );
          }

          @Override
          public void fileSelectionChanged( RepositoryFile repositoryFile, String filePath, String fileName,
              String title ) {
View Full Code Here

TOP

Related Classes of org.pentaho.mantle.client.solutionbrowser.SolutionBrowserPanel

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.