use of org.pentaho.gwt.widgets.client.tabs.PentahoTab in project pentaho-platform by pentaho.
the class MantleTabPanel method selectTab.
public void selectTab(final PentahoTab selectedTab) {
// Save previous tab's solution browser panel navigator state
PentahoTab prevTab = getSelectedTab();
if (prevTab != null && prevTab instanceof MantleTab) {
MantleTab mantlePrevTab = (MantleTab) prevTab;
boolean prevState = SolutionBrowserPanel.getInstance().isNavigatorShowing();
if (mantlePrevTab != null) {
mantlePrevTab.setSolutionBrowserShowing(prevState);
}
}
super.selectTab(selectedTab);
if (selectedTab == null) {
return;
}
if (selectedTab instanceof MantleTab) {
// restore previous state of solution browser panel navigator
MantleTab mantleTab = (MantleTab) selectedTab;
SolutionBrowserPanel.getInstance().setNavigatorShowing(mantleTab.isSolutionBrowserShowing());
}
Widget selectTabContent = null;
if (getTab(getSelectedTabIndex()) != null) {
selectTabContent = getTab(getSelectedTabIndex()).getContent();
}
List<FileItem> selectedItems = SolutionBrowserPanel.getInstance().getFilesListPanel().getSelectedFileItems();
EventBusUtil.EVENT_BUS.fireEvent(new SolutionBrowserSelectEvent(selectTabContent, selectedItems));
// $NON-NLS-1$ //$NON-NLS-2$
Window.setTitle(Messages.getString("productName") + " - " + selectedTab.getLabelText());
// first turn off all tabs that should be
for (int i = 0; i < getTabCount(); i++) {
final PentahoTab tab = getTab(i);
if (tab.getContent() instanceof IFrameTabPanel) {
if (tab.getContent() != selectedTab.getContent()) {
FrameUtils.setEmbedVisibility(((IFrameTabPanel) tab.getContent()).getFrame(), false);
}
}
}
// now turn on the select tab
if (selectedTab.getContent() instanceof IFrameTabPanel) {
FrameUtils.setEmbedVisibility(((IFrameTabPanel) selectedTab.getContent()).getFrame(), true);
// fix for BISERVER-6027 - on selection, set the focus into a textbox
// element to allow IE mouse access in these elements
// this was made native due to BISERVER-7400
ieFix(((IFrameTabPanel) selectedTab.getContent()).getFrame().getElement());
IFrameTabPanel tabPanel = (IFrameTabPanel) selectedTab.getContent();
if (tabPanel.getUrl() != null) {
onTabSelect(getFrameElement(selectedTab));
}
}
}
use of org.pentaho.gwt.widgets.client.tabs.PentahoTab in project pentaho-platform by pentaho.
the class MantleTabPanel method closeOtherTabs.
public void closeOtherTabs(PentahoTab exceptThisTab) {
int tabCount = getTabCount();
List<PentahoTab> tabs = new ArrayList<PentahoTab>(tabCount - 1);
for (int i = 0; i < tabCount; i++) {
PentahoTab tabItem = getTab(i);
if (exceptThisTab != tabItem) {
tabs.add(tabItem);
}
}
for (PentahoTab tab : tabs) {
closeTab(tab, true);
}
selectTab(exceptThisTab);
}
Aggregations