/** * Scroll the selected tab visible in case the tab is outside of the viewport. * * @param scrollLeft true to scroll the first tab visible first then scroll left to make the selected tab visible. * This will get a more consistent result. If false, it will simple scroll the selected tab * visible. Sometimes the tab will appear as the first visible tab or the last visible tab * depending on the previous viewport position. */ public void scrollSelectedTabToVisible(boolean scrollLeft) { ((JideTabbedPaneUI) getUI()).ensureActiveTabIsVisible(scrollLeft); }
public int getEditingTabIndex() { return ((JideTabbedPaneUI) getUI()).getEditingTabIndex(); }
/** * Gets tab height. * * @return height of tab */ public int getTabHeight() { if (getTabPlacement() == TOP || getTabPlacement() == BOTTOM) { return ((JideTabbedPaneUI) getUI()).getTabPanel().getHeight(); } else { return ((JideTabbedPaneUI) getUI()).getTabPanel().getWidth(); } }
/** * Checks if tab is in editing mode. * * @return true if editing. */ public boolean isTabEditing() { return ((JideTabbedPaneUI) getUI()).isTabEditing(); }
/** * Starts tab editing. This works only when {@link #setTabEditingAllowed(boolean)} is set to true. * * @param tabIndex the index of the tab */ public void editTabAt(int tabIndex) { boolean started = ((JideTabbedPaneUI) getUI()).editTabAt(tabIndex); if (started) { fireTabEditing(TabEditingEvent.TAB_EDITING_STARTED, tabIndex, getTitleAt(tabIndex), null); } }
public void cancelTabEditing() { int tabIndex = getEditingTabIndex(); if (tabIndex != -1) { ((JideTabbedPaneUI) getUI()).cancelTabEditing(); fireTabEditing(TabEditingEvent.TAB_EDITING_CANCELLED, tabIndex, getTitleAt(tabIndex), getTitleAt(tabIndex)); } }
public void stopTabEditing() { int tabIndex = getEditingTabIndex(); if (tabIndex != -1 && tabIndex < getTabCount()) { String oldTitle = getTitleAt(tabIndex); ((JideTabbedPaneUI) getUI()).stopTabEditing(); String newTitle = getTitleAt(tabIndex); fireTabEditing(TabEditingEvent.TAB_EDITING_STOPPED, tabIndex, oldTitle, newTitle); } }
((JideTabbedPaneUI) getUI()).getTabPanel().repaint(delay);