use of org.pentaho.gwt.widgets.client.tabs.PentahoTab in project pentaho-platform by pentaho.
the class SaveCommand method doTabRename.
// used via JSNI
private void doTabRename() {
if (tabName != null) {
// Save-As does not modify the name of the tab.
PentahoTab tab = SolutionBrowserPanel.getInstance().getContentTabPanel().getSelectedTab();
tab.setLabelText(tabName);
tab.setLabelTooltip(tabName);
}
}
use of org.pentaho.gwt.widgets.client.tabs.PentahoTab 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.gwt.widgets.client.tabs.PentahoTab in project pentaho-platform by pentaho.
the class MantleTabPanel method setCurrentTabSaveEnabled.
public void setCurrentTabSaveEnabled(boolean enabled) {
PentahoTab tab = getTab(getSelectedTabIndex());
setTabSaveEnabled(tab, enabled);
}
use of org.pentaho.gwt.widgets.client.tabs.PentahoTab in project pentaho-platform by pentaho.
the class MantleTabPanel method closeAllTabs.
public void closeAllTabs() {
// get a copy of the tabs to create a separate list
ArrayList<PentahoTab> tabs = new ArrayList<PentahoTab>(getTabCount());
for (int i = 0; i < getTabCount(); i++) {
tabs.add(getTab(i));
}
for (PentahoTab tab : tabs) {
closeTab(tab, true);
}
allTabsClosed();
}
use of org.pentaho.gwt.widgets.client.tabs.PentahoTab in project pentaho-platform by pentaho.
the class MantleTabPanel method closeTab.
/**
* Called by JSNI call from parameterized xaction prompt pages to "cancel". The only 'key' to pass up is the URL. To
* handle the possibility of multiple tabs with the same url, this method first checks the assumption that the current
* active tab initiates the call. Otherwise it checks from tail up for the first tab with a matching url and closes
* that one. *
*
* @param url
*/
private void closeTab(String url) {
int curpos = getSelectedTabIndex();
if (StringUtils.isEmpty(url)) {
// and then remove
if (curpos >= 0 && getTabCount() > 0) {
closeTab(curpos, true);
}
}
PentahoTab pt = getTab(curpos);
if (pt != null && pt.getContent() != null) {
IFrameTabPanel curPanel = (IFrameTabPanel) getTab(curpos).getContent();
if (url.contains(curPanel.getUrl())) {
closeTab(curpos, true);
}
for (int i = getTabCount() - 1; i >= 0; i--) {
curPanel = (IFrameTabPanel) getTab(i).getContent();
if (url.contains(curPanel.getUrl())) {
closeTab(i, true);
break;
}
}
}
if (getTabCount() == 0) {
allTabsClosed();
}
}
Aggregations