Search in sources :

Example 6 with PentahoTab

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));
        }
    }
}
Also used : FileItem(org.pentaho.mantle.client.solutionbrowser.filelist.FileItem) PentahoTab(org.pentaho.gwt.widgets.client.tabs.PentahoTab) Widget(com.google.gwt.user.client.ui.Widget) IFrameTabPanel(org.pentaho.mantle.client.solutionbrowser.tabs.IFrameTabPanel) SolutionBrowserSelectEvent(org.pentaho.mantle.client.events.SolutionBrowserSelectEvent)

Example 7 with PentahoTab

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);
}
Also used : PentahoTab(org.pentaho.gwt.widgets.client.tabs.PentahoTab) ArrayList(java.util.ArrayList)

Aggregations

PentahoTab (org.pentaho.gwt.widgets.client.tabs.PentahoTab)7 IFrameTabPanel (org.pentaho.mantle.client.solutionbrowser.tabs.IFrameTabPanel)3 ArrayList (java.util.ArrayList)2 Widget (com.google.gwt.user.client.ui.Widget)1 SolutionBrowserSelectEvent (org.pentaho.mantle.client.events.SolutionBrowserSelectEvent)1 FileItem (org.pentaho.mantle.client.solutionbrowser.filelist.FileItem)1