Search in sources :

Example 1 with SolutionBrowserPanel

use of org.pentaho.mantle.client.solutionbrowser.SolutionBrowserPanel in project pentaho-platform by pentaho.

the class DeleteFolderCommand method performOperation.

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);
            }
        });
    } else {
        performOperation(true);
    }
}
Also used : SolutionFileHandler(org.pentaho.mantle.client.events.SolutionFileHandler) RepositoryFile(org.pentaho.gwt.widgets.client.filechooser.RepositoryFile) SolutionBrowserPanel(org.pentaho.mantle.client.solutionbrowser.SolutionBrowserPanel)

Example 2 with SolutionBrowserPanel

use of org.pentaho.mantle.client.solutionbrowser.SolutionBrowserPanel in project pentaho-platform by pentaho.

the class FileCommand method execute.

public void execute() {
    if (popupMenu != null) {
        popupMenu.hide();
    }
    SolutionBrowserPanel sbp = SolutionBrowserPanel.getInstance();
    FilesListPanel flp = sbp.getFilesListPanel();
    if (flp.getSelectedFileItems() == null || flp.getSelectedFileItems().size() < 1) {
        return;
    }
    List<FileItem> selectedItems = flp.getSelectedFileItems();
    FileItem selectedItem = selectedItems.get(0);
    if (mode == COMMAND.RUN || mode == COMMAND.NEWWINDOW) {
        if (selectedItem != null) {
            sbp.openFile(selectedItem.getRepositoryFile(), mode);
        }
    } else if (mode == COMMAND.PROPERTIES) {
        new FilePropertiesCommand(fileSummary == null ? fileSummaryProvider.getRepositoryFiles().get(0) : fileSummary).execute();
    } else if (mode == COMMAND.EDIT) {
        sbp.editFile();
    } else if (mode == COMMAND.CREATE_FOLDER) {
        new NewFolderCommand(fileSummary).execute();
    } else if (mode == COMMAND.BACKGROUND) {
        new RunInBackgroundCommand(selectedItem).execute(true);
    } else if (mode == COMMAND.SCHEDULE_NEW) {
        ScheduleHelper.createSchedule(selectedItem.getRepositoryFile(), new ScheduleCallback(selectedItem.getRepositoryFile()));
    } else if (mode == COMMAND.SHARE) {
        new ShareFileCommand().execute();
    } else if (mode == COMMAND.IMPORT) {
        new ImportFileCommand(fileSummary == null ? fileSummaryProvider.getRepositoryFiles().get(0) : fileSummary).execute();
    } else if (mode == COMMAND.EXPORT) {
        new ExportFileCommand(fileSummary == null ? fileSummaryProvider.getRepositoryFiles().get(0) : fileSummary).execute();
    } else if (mode == COMMAND.FAVORITE) {
        sbp.addFavorite(selectedItem.getRepositoryFile().getPath(), selectedItem.getRepositoryFile().getTitle());
        FavoritePickList.getInstance().save("favorites");
    } else if (mode == COMMAND.FAVORITE_REMOVE) {
        sbp.removeFavorite(selectedItem.getRepositoryFile().getPath());
        FavoritePickList.getInstance().save("favorites");
    }
}
Also used : ScheduleCallback(org.pentaho.mantle.client.solutionbrowser.ScheduleCallback) ShareFileCommand(org.pentaho.mantle.client.commands.ShareFileCommand) ImportFileCommand(org.pentaho.mantle.client.commands.ImportFileCommand) FilePropertiesCommand(org.pentaho.mantle.client.commands.FilePropertiesCommand) NewFolderCommand(org.pentaho.mantle.client.commands.NewFolderCommand) SolutionBrowserPanel(org.pentaho.mantle.client.solutionbrowser.SolutionBrowserPanel) RunInBackgroundCommand(org.pentaho.mantle.client.commands.RunInBackgroundCommand) ExportFileCommand(org.pentaho.mantle.client.commands.ExportFileCommand)

Example 3 with SolutionBrowserPanel

use of org.pentaho.mantle.client.solutionbrowser.SolutionBrowserPanel in project pentaho-platform by pentaho.

the class ShareFileCommand method execute.

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();
    }
}
Also used : SolutionFileHandler(org.pentaho.mantle.client.events.SolutionFileHandler) RepositoryFile(org.pentaho.gwt.widgets.client.filechooser.RepositoryFile) SolutionBrowserPanel(org.pentaho.mantle.client.solutionbrowser.SolutionBrowserPanel)

Example 4 with SolutionBrowserPanel

use of org.pentaho.mantle.client.solutionbrowser.SolutionBrowserPanel in project pentaho-platform by pentaho.

the class ShowBrowserCommand method execute.

public void execute() {
    final SolutionBrowserPanel solutionBrowserPerspective = SolutionBrowserPanel.getInstance();
    solutionBrowserPerspective.setNavigatorShowing(state);
    if (solutionBrowserPerspective != null) {
        if (PerspectiveManager.getInstance().getActivePerspective().getId().equalsIgnoreCase(PerspectiveManager.OPENED_PERSPECTIVE)) {
            PerspectiveManager.getInstance().setPerspective(PerspectiveManager.OPENED_PERSPECTIVE);
        }
    }
    // $NON-NLS-1$
    final String url = GWT.getHostPageBaseURL() + "api/user-settings/MANTLE_SHOW_NAVIGATOR";
    RequestBuilder builder = new RequestBuilder(RequestBuilder.POST, url);
    try {
        builder.setHeader("If-Modified-Since", "01 Jan 1970 00:00:00 GMT");
        builder.sendRequest("" + state, EmptyRequestCallback.getInstance());
    } catch (RequestException e) {
    // showError(e);
    }
}
Also used : RequestBuilder(com.google.gwt.http.client.RequestBuilder) RequestException(com.google.gwt.http.client.RequestException) SolutionBrowserPanel(org.pentaho.mantle.client.solutionbrowser.SolutionBrowserPanel)

Example 5 with SolutionBrowserPanel

use of org.pentaho.mantle.client.solutionbrowser.SolutionBrowserPanel in project pentaho-platform by pentaho.

the class ImportFileCommand method performOperation.

protected void performOperation() {
    if (this.getSolutionPath() != null) {
        SolutionBrowserPanel sbp = SolutionBrowserPanel.getInstance();
        sbp.getFile(this.getSolutionPath(), new SolutionFileHandler() {

            @Override
            public void handle(RepositoryFile repositoryFile) {
                ImportFileCommand.this.repositoryFile = repositoryFile;
                performOperation(true);
            }
        });
    } else {
        performOperation(true);
    }
}
Also used : SolutionFileHandler(org.pentaho.mantle.client.events.SolutionFileHandler) RepositoryFile(org.pentaho.gwt.widgets.client.filechooser.RepositoryFile) SolutionBrowserPanel(org.pentaho.mantle.client.solutionbrowser.SolutionBrowserPanel)

Aggregations

SolutionBrowserPanel (org.pentaho.mantle.client.solutionbrowser.SolutionBrowserPanel)11 RepositoryFile (org.pentaho.gwt.widgets.client.filechooser.RepositoryFile)7 SolutionFileHandler (org.pentaho.mantle.client.events.SolutionFileHandler)4 FileChooserDialog (org.pentaho.gwt.widgets.client.filechooser.FileChooserDialog)3 FileChooserListener (org.pentaho.gwt.widgets.client.filechooser.FileChooserListener)3 RequestBuilder (com.google.gwt.http.client.RequestBuilder)2 RequestException (com.google.gwt.http.client.RequestException)2 PromptDialogBox (org.pentaho.gwt.widgets.client.dialogs.PromptDialogBox)2 RepositoryFileTree (org.pentaho.gwt.widgets.client.filechooser.RepositoryFileTree)2 JsArrayString (com.google.gwt.core.client.JsArrayString)1 Frame (com.google.gwt.user.client.ui.Frame)1 Label (com.google.gwt.user.client.ui.Label)1 IDialogCallback (org.pentaho.gwt.widgets.client.dialogs.IDialogCallback)1 FileFilter (org.pentaho.gwt.widgets.client.filechooser.FileFilter)1 ExportFileCommand (org.pentaho.mantle.client.commands.ExportFileCommand)1 FilePropertiesCommand (org.pentaho.mantle.client.commands.FilePropertiesCommand)1 ImportFileCommand (org.pentaho.mantle.client.commands.ImportFileCommand)1 NewFolderCommand (org.pentaho.mantle.client.commands.NewFolderCommand)1 RunInBackgroundCommand (org.pentaho.mantle.client.commands.RunInBackgroundCommand)1 ShareFileCommand (org.pentaho.mantle.client.commands.ShareFileCommand)1