use of org.pentaho.mantle.client.solutionbrowser.tabs.IFrameTabPanel in project pentaho-platform by pentaho.
the class SolutionBrowserPanel method editFile.
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()) + "/" + // $NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
(plugin != null && (plugin.getCommandPerspective(COMMAND.EDIT) != null) ? plugin.getCommandPerspective(COMMAND.EDIT) : "editor");
// 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, // $NON-NLS-1$ //$NON-NLS-2$
true);
} else {
MessageDialogBox dialogBox = new // $NON-NLS-1$
MessageDialogBox(// $NON-NLS-1$
Messages.getString("error"), // $NON-NLS-1$
Messages.getString("cannotEditFileType"), true, false, true);
dialogBox.center();
}
}
}
use of org.pentaho.mantle.client.solutionbrowser.tabs.IFrameTabPanel in project pentaho-platform by pentaho.
the class MantlePopupPanel method hide.
@Override
public void hide() {
super.hide();
IFrameTabPanel iframeTab = SolutionBrowserPanel.getInstance().getContentTabPanel().getCurrentFrame();
if (iframeTab == null || iframeTab.getFrame() == null) {
return;
}
Frame currentFrame = iframeTab.getFrame();
FrameUtils.setEmbedVisibility(currentFrame, true);
}
use of org.pentaho.mantle.client.solutionbrowser.tabs.IFrameTabPanel in project pentaho-platform by pentaho.
the class MantleTabPanel method getTabByFrameId.
private PentahoTab getTabByFrameId(String frameId) {
PentahoTab tab;
for (int i = 0; i < getTabCount(); i++) {
tab = getTab(i);
IFrameTabPanel panel = getFrame(tab);
if (panel.getFrame().getElement().getAttribute("id").equals(frameId)) {
return tab;
}
}
return null;
}
use of org.pentaho.mantle.client.solutionbrowser.tabs.IFrameTabPanel in project pentaho-platform by pentaho.
the class MantleTabPanel method setContentEditSelected.
public void setContentEditSelected(boolean selected) {
IFrameTabPanel panel = getCurrentFrame();
if (panel != null) {
panel.setEditSelected(selected);
Widget selectTabContent = null;
if (getTab(getSelectedTabIndex()) != null) {
selectTabContent = getTab(getSelectedTabIndex()).getContent();
}
List<FileItem> selectedItems = SolutionBrowserPanel.getInstance().getFilesListPanel().getSelectedFileItems();
EventBusUtil.EVENT_BUS.fireEvent(new SolutionBrowserUndefinedEvent(selectTabContent, selectedItems));
}
}
use of org.pentaho.mantle.client.solutionbrowser.tabs.IFrameTabPanel in project pentaho-platform by pentaho.
the class MantleTabPanel method setFileInfoInFrame.
/**
* Store representation of file in the frame for reference later when save is called
*
* @param selectedFileItem
*/
public void setFileInfoInFrame(FileItem selectedFileItem) {
IFrameTabPanel tp = getCurrentFrame();
if (tp != null && selectedFileItem != null) {
SolutionFileInfo fileInfo = new SolutionFileInfo();
fileInfo.setName(selectedFileItem.getName());
fileInfo.setPath(selectedFileItem.getPath());
tp.setFileInfo(fileInfo);
}
}
Aggregations