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);
}
}
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");
}
}
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();
}
}
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);
}
}
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);
}
}
Aggregations