Search in sources :

Example 1 with PentahoTab

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

Example 2 with PentahoTab

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;
}
Also used : PentahoTab(org.pentaho.gwt.widgets.client.tabs.PentahoTab) IFrameTabPanel(org.pentaho.mantle.client.solutionbrowser.tabs.IFrameTabPanel)

Example 3 with PentahoTab

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

Example 4 with PentahoTab

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

Example 5 with PentahoTab

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();
    }
}
Also used : PentahoTab(org.pentaho.gwt.widgets.client.tabs.PentahoTab) IFrameTabPanel(org.pentaho.mantle.client.solutionbrowser.tabs.IFrameTabPanel)

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