public class JideTabbedPane
extends javax.swing.JTabbedPane
JidetabbedPane
is an enhanced version of JTabbedPane
. Different from
JTabbedPane
, it JideTabbedPane
is the same as JTabbedPane
.Modifier and Type | Class and Description |
---|---|
static interface |
JideTabbedPane.ColorProvider
An interface to provide colors for tab background and foreground.
|
static interface |
JideTabbedPane.GradientColorProvider
A ColorProvider that can supports gradient tab background.
|
protected class |
JideTabbedPane.IgnoreableSingleSelectionModel |
protected class |
JideTabbedPane.PageLastFocusTracker |
static class |
JideTabbedPane.TabListCellRenderer
The default tab list cell renderer used to renderer the list in the popup when tab list button is pressed.
|
javax.swing.JTabbedPane.AccessibleJTabbedPane, javax.swing.JTabbedPane.ModelListener
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
protected java.beans.PropertyChangeListener |
_focusChangeListener |
protected boolean |
_tabEditingAllowed |
protected TabEditingValidator |
_tabEditValidator |
static java.lang.String |
BOLDACTIVETAB_PROPERTY
Bound property name for if the active tab title is in bold
|
static java.lang.String |
BOX_STYLE_PROPERTY
Bound property name for box style
|
static int |
COLOR_THEME_DEFAULT
color style
|
static int |
COLOR_THEME_OFFICE2003 |
static int |
COLOR_THEME_VSNET |
static int |
COLOR_THEME_WIN2K |
static int |
COLOR_THEME_WINXP |
static java.lang.String |
GRIPPER_PROPERTY
Bound property name for gripper.
|
static java.lang.String |
HIDE_IF_ONE_TAB_PROPERTY
Bound property name for hide tab area if there is only one tab.
|
static JideTabbedPane.ColorProvider |
ONENOTE_COLOR_PROVIDER |
static java.lang.String |
PROPERTY_COLOR_THEME |
static java.lang.String |
PROPERTY_CONTENT_BORDER_INSETS |
static java.lang.String |
PROPERTY_DRAG_OVER_DISABLED |
static java.lang.String |
PROPERTY_TAB_COLOR_PROVIDER |
static java.lang.String |
PROPERTY_TAB_LEADING_COMPONENT |
static java.lang.String |
PROPERTY_TAB_RESIZE_MODE |
static java.lang.String |
PROPERTY_TAB_SHAPE |
static java.lang.String |
PROPERTY_TAB_TRAILING_COMPONENT |
static int |
RESIZE_MODE_COMPRESSED
A tab resize mode.
|
static int |
RESIZE_MODE_DEFAULT
A tab resize mode.
|
static int |
RESIZE_MODE_FIT
A tab resize mode.
|
static int |
RESIZE_MODE_FIXED
A tab resize mode.
|
static int |
RESIZE_MODE_NONE
A tab resize mode.
|
static java.lang.String |
SCROLL_TAB_ON_WHEEL_PROPERTY |
static int |
SHAPE_BOX |
static int |
SHAPE_DEFAULT |
static int |
SHAPE_ECLIPSE |
static int |
SHAPE_ECLIPSE3X |
static int |
SHAPE_EXCEL |
static int |
SHAPE_FLAT |
static int |
SHAPE_OFFICE2003 |
static int |
SHAPE_ROUNDED_FLAT |
static int |
SHAPE_ROUNDED_VSNET |
static int |
SHAPE_VSNET |
static int |
SHAPE_WINDOWS |
static int |
SHAPE_WINDOWS_SELECTED |
static java.lang.String |
SHOW_CLOSE_BUTTON_ON_TAB_PROPERTY
Bound property name for if showing close button on tab
|
static java.lang.String |
SHOW_CLOSE_BUTTON_PROPERTY
Bound property name for if showing close button
|
static java.lang.String |
SHOW_ICONS_PROPERTY
Bound property name for show icons on tab
|
static java.lang.String |
SHOW_TAB_AREA_PROPERTY
Bound property name for if the tab area is visible.
|
static java.lang.String |
SHOW_TAB_BUTTONS_PROPERTY
Bound property name for show tab button.
|
static java.lang.String |
SHOW_TAB_CONTENT_PROPERTY
Bound property name for if the tab area is visible.
|
static java.lang.String |
SHRINK_TAB_PROPERTY
Bound property name for shrink tabs.
|
static java.lang.String |
TAB_CLOSABLE_PROPERTY
Bound property name for tab closable.
|
static java.lang.String |
USE_DEFAULT_SHOW_CLOSE_BUTTON_ON_TAB_PROPERTY
Bound property name for using default show close button on tab value from UIDefaults
|
static java.lang.String |
USE_DEFAULT_SHOW_ICONS_PROPERTY
Bound property name for using default show icons on tab value from UIDefaults
|
changeEvent, changeListener, model, SCROLL_TAB_LAYOUT, tabPlacement, WRAP_TAB_LAYOUT
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Constructor and Description |
---|
JideTabbedPane()
Creates an empty
TabbedPane with a default tab placement of JTabbedPane.TOP . |
JideTabbedPane(int tabPlacement)
Creates an empty
TabbedPane with the specified tab placement of either:
JTabbedPane.TOP , JTabbedPane.BOTTOM , JTabbedPane.LEFT , or
JTabbedPane.RIGHT . |
JideTabbedPane(int tabPlacement,
int tabLayoutPolicy)
Creates an empty
JideTabbedPane with the specified tab placement and tab layout policy. |
Modifier and Type | Method and Description |
---|---|
void |
addNotify() |
void |
addTabEditingListener(TabEditingListener l)
Adds a
TabEditingListener to this tabbedpane. |
void |
cancelTabEditing() |
protected void |
clearVisComp() |
protected java.beans.PropertyChangeListener |
createFocusChangeListener() |
void |
editTabAt(int tabIndex)
Starts tab editing.
|
protected void |
fireStateChanged() |
protected void |
fireTabEditing(int id,
int index,
java.lang.String oldTitle,
java.lang.String newTitle) |
javax.swing.Action |
getCloseAction()
Gets close action.
|
int |
getColorTheme() |
java.awt.Insets |
getContentBorderInsets() |
int |
getDefaultColorTheme() |
int |
getDefaultTabResizeMode() |
int |
getDefaultTabStyle() |
java.lang.String |
getDisplayTitleAt(int index)
Gets the display title.
|
int |
getEditingTabIndex() |
javax.swing.Icon |
getIconForTab(int tabIndex)
Gets the icon for the tab after looking at the UIDefault "JideTabbedPane.showIconOnTab" and
isShowIconsOnTab() . |
java.awt.Component |
getLastFocusedComponent(java.awt.Component pageComponent)
Gets the last focused component of a particular page.
|
protected java.util.Hashtable |
getPageLastFocusTrackers() |
java.awt.Font |
getSelectedTabFont()
Gets the font for selected tab.
|
StringConverter |
getStringConverter()
Gets the string converter that converts the tab title to the display title.
|
int |
getTabAtLocation(int x,
int y) |
JideTabbedPane.ColorProvider |
getTabColorProvider()
Gets the tab color provider.
|
TabEditingListener[] |
getTabEditingListeners()
Returns an array of all the
TabEditingListener s added to this JTabbedPane with
addTabEditingListener . |
TabEditingValidator |
getTabEditingValidator() |
int |
getTabHeight()
Gets tab height.
|
java.awt.Component |
getTabLeadingComponent() |
javax.swing.ListCellRenderer |
getTabListCellRenderer()
Gets the tab list cell renderer.
|
int |
getTabResizeMode() |
int |
getTabShape() |
java.awt.Component |
getTabTrailingComponent() |
javax.swing.plaf.TabbedPaneUI |
getUI()
Returns the UI object which implements the L&F for this component.
|
java.lang.String |
getUIClassID()
Returns the name of the UI class that implements the L&F for this component.
|
boolean |
hasFocusComponent()
Checks if the JideTabbedPane has the focus component.
|
void |
insertTab(java.lang.String title,
javax.swing.Icon icon,
java.awt.Component component,
java.lang.String tip,
int index)
Overridden to add a
PageLastFocusTracker to each page, used to update the page's last focused
component. |
boolean |
isAutoFocusOnTabHideClose() |
boolean |
isAutoRequestFocus()
Checks if the UI should automatically request focus on selected component when doing the layout.
|
boolean |
isBoldActiveTab()
If the active tab is in bold.
|
boolean |
isCloseTabOnMouseMiddleButton()
Get the flag if clicking middle mouse button can close the tab.
|
boolean |
isDragOverDisabled()
Checks the dragOverDisabled property.
|
boolean |
isHideOneTab()
Checks if tab area will be hidden if there is only one tab.
|
boolean |
isRightClickSelect()
Returns true if you want right click on unselected tab will select that tab.
|
boolean |
isScrollSelectedTabOnWheel()
Checks if the selected tab will be changed on mouse wheel event.
|
boolean |
isShowCloseButton()
If close button is visible.
|
boolean |
isShowCloseButtonOnSelectedTab() |
boolean |
isShowCloseButtonOnTab()
Checks if the close button will be shown on tab.
|
boolean |
isShowGripper()
If the grip is visible.
|
boolean |
isShowIconsOnTab()
Checks if the icon will be shown on tab.
|
boolean |
isShowTabArea()
If the tab area is visible.
|
boolean |
isShowTabButtons()
Checks if tab buttons are always visible.
|
boolean |
isShowTabContent()
If the tab content is visible.
|
boolean |
isSuppressSetSelectedIndex() |
boolean |
isSuppressStateChangedEvents() |
boolean |
isTabClosableAt(int tabIndex)
Checks if the tab at tabIndex should show the close button.
|
boolean |
isTabEditing()
Checks if tab is in editing mode.
|
boolean |
isTabEditingAllowed()
Checks if the tab editing is allowed.
|
boolean |
isTabShown()
Checks if tab area is shown.
|
boolean |
isUseDefaultShowCloseButtonOnTab()
If the return is true, the value set to setShowCloseButtonOnTab() will be ignored.
|
boolean |
isUseDefaultShowIconsOnTab()
If the return is true, the value set to setShowIconsOnTab() will be ignored.
|
void |
moveSelectedTabTo(int tabIndex)
Moves selected tab from current position to the position specified in tabIndex.
|
void |
popupSelectedIndex(int index) |
void |
processMouseSelection(int tabIndex,
java.awt.event.MouseEvent e) |
void |
removeNotify() |
void |
removeTabAt(int index) |
void |
removeTabEditingListener(TabEditingListener l)
Removes a
TabEditingListener from this tabbedpane. |
protected void |
repaintContentBorder(int x,
int y,
int width,
int height)
Calls repaint on the specified rectangular area.
|
void |
repaintTabAreaAndContentBorder()
Repaints the tab area and the content border if any.
|
boolean |
requestFocusForVisibleComponent() |
void |
resetDefaultCloseAction()
Resets close action to default.
|
void |
scrollSelectedTabToVisible(boolean scrollLeft)
Scroll the selected tab visible in case the tab is outside of the viewport.
|
void |
setAutoFocusOnTabHideClose(boolean autoFocusonTabHideClose) |
void |
setAutoRequestFocus(boolean autoRequestFocus) |
void |
setBoldActiveTab(boolean boldActiveTab)
Sets if the active tab is in bold.
|
void |
setCloseAction(javax.swing.Action action)
Sets default close action for close button.
|
void |
setCloseTabOnMouseMiddleButton(boolean closeTabOnMouseMiddleButton)
Set the flag if clicking middle mouse button can close the tab.
|
void |
setColorTheme(int colorTheme) |
void |
setComponentAt(int index,
java.awt.Component component) |
void |
setContentBorderInsets(java.awt.Insets contentBorderInsets)
Sets the content border insets.
|
void |
setDragOverDisabled(boolean dragOverDisabled)
Sets the dragOverDisabled property.
|
void |
setHideOneTab(boolean hideOne)
Sets the value if tab area will be hidden if there is only one tab.
|
void |
setRightClickSelect(boolean rightClickSelect)
Sets if you want right click on unselected tab will select that tab.
|
void |
setScrollSelectedTabOnWheel(boolean scrollSelectedTabOnWheel)
If true, the selected tab will be changed on mouse wheel.
|
void |
setSelectedIndex(int index) |
void |
setSelectedTabFont(java.awt.Font selectedTabFont)
Sets the font for selected tab.
|
void |
setShowCloseButton(boolean showCloseButton)
Sets if the close button is visible.
|
void |
setShowCloseButtonOnSelectedTab(boolean i)
Shows the close button on the selected tab only.
|
void |
setShowCloseButtonOnTab(boolean showCloseButtonOnTab)
Sets to true if the close button will be shown on tab.
|
void |
setShowGripper(boolean showGripper)
Sets the visibility of grip.
|
void |
setShowIconsOnTab(boolean showIconsOnTab)
Sets to true if the icon will be shown on tab.
|
void |
setShowTabArea(boolean showTabArea)
Sets if the tab area is visible.
|
void |
setShowTabButtons(boolean showButtons)
Sets the value if tab buttons are always visible.
|
void |
setShowTabContent(boolean showTabContent)
Sets if the tab content is visible.
|
void |
setStringConverter(StringConverter stringConverter)
Sets the string converter.
|
void |
setSuppressSetSelectedIndex(boolean suppressSetSelectedIndex) |
void |
setSuppressStateChangedEvents(boolean suppress) |
void |
setTabClosableAt(int tabIndex,
boolean closable)
Checks if the tab at tabIndex should show the close button.
|
void |
setTabColorProvider(JideTabbedPane.ColorProvider tabColorProvider)
Sets the tab color provider.It allows you to set the background color of each tab.
|
void |
setTabEditingAllowed(boolean allowed)
Sets the value if the tab editing is allowed.
|
void |
setTabEditingValidator(TabEditingValidator tabEditValidator) |
void |
setTabLeadingComponent(java.awt.Component component)
Sets the tab leading component.
|
void |
setTabListCellRenderer(javax.swing.ListCellRenderer tabListCellRenderer)
Sets the tab list cell renderer.
|
void |
setTabResizeMode(int resizeMode)
Sets the tab resize mode.
|
void |
setTabShape(int tabShape) |
void |
setTabTrailingComponent(java.awt.Component component)
Sets the tab trailing component.
|
void |
setTitleAt(int index,
java.lang.String title) |
void |
setUI(javax.swing.plaf.TabbedPaneUI ui)
Sets the UI object which implements the L&F for this component.
|
void |
setUseDefaultShowCloseButtonOnTab(boolean useDefaultShowCloseButtonOnTab)
Set if use the default value from UIDefaults.
|
void |
setUseDefaultShowIconsOnTab(boolean useDefaultShowIconsOnTab)
Set if use the default value from UIDefaults.
|
void |
stopTabEditing() |
void |
updateUI()
Resets the UI property to a value from the current look and feel.
|
add, add, add, add, add, addChangeListener, addTab, addTab, addTab, createChangeListener, getAccessibleContext, getBackgroundAt, getBoundsAt, getChangeListeners, getComponentAt, getDisabledIconAt, getDisplayedMnemonicIndexAt, getForegroundAt, getIconAt, getMnemonicAt, getModel, getSelectedComponent, getSelectedIndex, getTabComponentAt, getTabCount, getTabLayoutPolicy, getTabPlacement, getTabRunCount, getTitleAt, getToolTipText, getToolTipTextAt, indexAtLocation, indexOfComponent, indexOfTab, indexOfTab, indexOfTabComponent, isEnabledAt, paramString, remove, remove, removeAll, removeChangeListener, setBackgroundAt, setDisabledIconAt, setDisplayedMnemonicIndexAt, setEnabledAt, setForegroundAt, setIconAt, setMnemonicAt, setModel, setSelectedComponent, setTabComponentAt, setTabLayoutPolicy, setTabPlacement, setToolTipTextAt
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public static final java.lang.String SHRINK_TAB_PROPERTY
public static final java.lang.String HIDE_IF_ONE_TAB_PROPERTY
public static final java.lang.String SHOW_TAB_BUTTONS_PROPERTY
public static final java.lang.String BOX_STYLE_PROPERTY
public static final java.lang.String SHOW_ICONS_PROPERTY
public static final java.lang.String USE_DEFAULT_SHOW_ICONS_PROPERTY
public static final java.lang.String SHOW_CLOSE_BUTTON_ON_TAB_PROPERTY
public static final java.lang.String SHOW_CLOSE_BUTTON_PROPERTY
public static final java.lang.String SHOW_TAB_AREA_PROPERTY
public static final java.lang.String SHOW_TAB_CONTENT_PROPERTY
public static final java.lang.String TAB_CLOSABLE_PROPERTY
public static final java.lang.String USE_DEFAULT_SHOW_CLOSE_BUTTON_ON_TAB_PROPERTY
public static final java.lang.String BOLDACTIVETAB_PROPERTY
public static final java.lang.String GRIPPER_PROPERTY
public static final java.lang.String PROPERTY_TAB_SHAPE
public static final java.lang.String PROPERTY_COLOR_THEME
public static final java.lang.String PROPERTY_TAB_RESIZE_MODE
public static final java.lang.String PROPERTY_TAB_LEADING_COMPONENT
public static final java.lang.String PROPERTY_TAB_TRAILING_COMPONENT
public static final java.lang.String PROPERTY_TAB_COLOR_PROVIDER
public static final java.lang.String PROPERTY_CONTENT_BORDER_INSETS
public static final java.lang.String PROPERTY_DRAG_OVER_DISABLED
public static final java.lang.String SCROLL_TAB_ON_WHEEL_PROPERTY
public static final int RESIZE_MODE_DEFAULT
getDefaultTabResizeMode()
which is defined in UIDefault "JideTabbedPane.defaultResizeMode". You can change this
in UIDefault. It will affect the resize mode of all JideTabbedPane
s.public static final int RESIZE_MODE_NONE
public static final int RESIZE_MODE_FIT
public static final int RESIZE_MODE_FIXED
public static final int RESIZE_MODE_COMPRESSED
public static final int COLOR_THEME_DEFAULT
public static final int COLOR_THEME_WIN2K
public static final int COLOR_THEME_OFFICE2003
public static final int COLOR_THEME_VSNET
public static final int COLOR_THEME_WINXP
public static final int SHAPE_DEFAULT
public static final int SHAPE_WINDOWS
public static final int SHAPE_VSNET
public static final int SHAPE_BOX
public static final int SHAPE_OFFICE2003
public static final int SHAPE_FLAT
public static final int SHAPE_ECLIPSE
public static final int SHAPE_ECLIPSE3X
public static final int SHAPE_EXCEL
public static final int SHAPE_ROUNDED_VSNET
public static final int SHAPE_ROUNDED_FLAT
public static final int SHAPE_WINDOWS_SELECTED
protected transient boolean _tabEditingAllowed
protected transient TabEditingValidator _tabEditValidator
public static JideTabbedPane.ColorProvider ONENOTE_COLOR_PROVIDER
protected java.beans.PropertyChangeListener _focusChangeListener
public JideTabbedPane()
TabbedPane
with a default tab placement of JTabbedPane.TOP
.JTabbedPane.addTab(java.lang.String, javax.swing.Icon, java.awt.Component, java.lang.String)
public JideTabbedPane(int tabPlacement)
TabbedPane
with the specified tab placement of either:
JTabbedPane.TOP
, JTabbedPane.BOTTOM
, JTabbedPane.LEFT
, or
JTabbedPane.RIGHT
.tabPlacement
- the placement for the tabs relative to the contentJTabbedPane.addTab(java.lang.String, javax.swing.Icon, java.awt.Component, java.lang.String)
public JideTabbedPane(int tabPlacement, int tabLayoutPolicy)
JideTabbedPane
with the specified tab placement and tab layout policy. Tab
placement may be either: JTabbedPane.TOP
or JTabbedPane.BOTTOM
Tab layout policy should
always be JTabbedPane.SCROLL_TAB_LAYOUT
. JTabbedPane
also supports
JTabbedPane.WRAP_TAB_LAYOUT
. However the style of tabs in JideTabbedPane
doesn't match
with JTabbedPane.WRAP_TAB_LAYOUT
very well, so we decided not to support it.tabPlacement
- the placement for the tabs relative to the contenttabLayoutPolicy
- the policy for laying out tabs when all tabs will not fit on one runjava.lang.IllegalArgumentException
- if tab placement or tab layout policy are not one of the above supported valuesJTabbedPane.addTab(java.lang.String, javax.swing.Icon, java.awt.Component, java.lang.String)
public javax.swing.plaf.TabbedPaneUI getUI()
getUI
in class javax.swing.JTabbedPane
TabbedPaneUI
objectsetUI(javax.swing.plaf.TabbedPaneUI)
public void setUI(javax.swing.plaf.TabbedPaneUI ui)
setUI
in class javax.swing.JTabbedPane
ui
- the new UI objectUIDefaults.getUI(javax.swing.JComponent)
public void updateUI()
updateUI
in class javax.swing.JTabbedPane
JComponent.updateUI()
public java.lang.String getUIClassID()
getUIClassID
in class javax.swing.JTabbedPane
JComponent.getUIClassID()
,
UIDefaults.getUI(javax.swing.JComponent)
public boolean isHideOneTab()
public void setHideOneTab(boolean hideOne)
hideOne
- true to hide tab areas if there is only one tab; false otherwise.public boolean isTabShown()
public boolean isShowTabButtons()
public void setShowTabButtons(boolean showButtons)
showButtons
- true to always show tab buttons; false otherwise.public void setCloseAction(javax.swing.Action action)
action
- the close action.public javax.swing.Action getCloseAction()
public void setAutoFocusOnTabHideClose(boolean autoFocusonTabHideClose)
public boolean isAutoFocusOnTabHideClose()
public void resetDefaultCloseAction()
public void setSuppressStateChangedEvents(boolean suppress)
public boolean isSuppressStateChangedEvents()
protected void fireStateChanged()
fireStateChanged
in class javax.swing.JTabbedPane
public boolean isSuppressSetSelectedIndex()
public void setSuppressSetSelectedIndex(boolean suppressSetSelectedIndex)
public void setSelectedIndex(int index)
setSelectedIndex
in class javax.swing.JTabbedPane
public void popupSelectedIndex(int index)
public void setComponentAt(int index, java.awt.Component component)
setComponentAt
in class javax.swing.JTabbedPane
public boolean isAutoRequestFocus()
public void setAutoRequestFocus(boolean autoRequestFocus)
public void moveSelectedTabTo(int tabIndex)
tabIndex
- new indexpublic boolean requestFocusForVisibleComponent()
public void processMouseSelection(int tabIndex, java.awt.event.MouseEvent e)
public int getTabHeight()
public boolean isRightClickSelect()
public void setRightClickSelect(boolean rightClickSelect)
rightClickSelect
- true if right click on unselected tab will select that tabpublic int getTabAtLocation(int x, int y)
public boolean isShowGripper()
public void setShowGripper(boolean showGripper)
showGripper
- true to show grippublic boolean isShowIconsOnTab()
public void setShowIconsOnTab(boolean showIconsOnTab)
showIconsOnTab
- true or false.public boolean isUseDefaultShowIconsOnTab()
public void setUseDefaultShowIconsOnTab(boolean useDefaultShowIconsOnTab)
useDefaultShowIconsOnTab
- true or false.public boolean isShowCloseButtonOnTab()
public void setShowCloseButtonOnTab(boolean showCloseButtonOnTab)
showCloseButtonOnTab
- true or false.public boolean isUseDefaultShowCloseButtonOnTab()
public void setUseDefaultShowCloseButtonOnTab(boolean useDefaultShowCloseButtonOnTab)
useDefaultShowCloseButtonOnTab
- true or false.public void setTabEditingAllowed(boolean allowed)
allowed
- true or false.public boolean isTabEditingAllowed()
public void setTabEditingValidator(TabEditingValidator tabEditValidator)
public TabEditingValidator getTabEditingValidator()
public boolean isShowCloseButton()
public void setShowCloseButton(boolean showCloseButton)
showCloseButton
- true or false.public boolean isShowTabArea()
public void setShowTabArea(boolean showTabArea)
showTabArea
- true or false.public boolean isShowTabContent()
public void setShowTabContent(boolean showTabContent)
showTabContent
- true or false.public StringConverter getStringConverter()
public void setStringConverter(StringConverter stringConverter)
stringConverter
- the StringConverter.public java.lang.String getDisplayTitleAt(int index)
index
- the index to displaypublic boolean isBoldActiveTab()
public void setBoldActiveTab(boolean boldActiveTab)
boldActiveTab
- the flagpublic void removeTabAt(int index)
removeTabAt
in class javax.swing.JTabbedPane
public void setTitleAt(int index, java.lang.String title)
setTitleAt
in class javax.swing.JTabbedPane
public boolean isTabClosableAt(int tabIndex)
tabIndex
- the tab indexjava.lang.IndexOutOfBoundsException
- if index is out of range (index < 0 || index >= tab count)public void setTabClosableAt(int tabIndex, boolean closable)
isShowCloseButtonOnTab()
return true.tabIndex
- the tab indexclosable
- the flag indicating if the tab is clossablejava.lang.IndexOutOfBoundsException
- if index is out of range (index < 0 || index >= tab count)protected java.util.Hashtable getPageLastFocusTrackers()
public java.awt.Component getLastFocusedComponent(java.awt.Component pageComponent)
pageComponent
- the page componentprotected void clearVisComp()
public void insertTab(java.lang.String title, javax.swing.Icon icon, java.awt.Component component, java.lang.String tip, int index)
PageLastFocusTracker
to each page, used to update the page's last focused
component.insertTab
in class javax.swing.JTabbedPane
public java.awt.Font getSelectedTabFont()
public void setSelectedTabFont(java.awt.Font selectedTabFont)
selectedTabFont
- new font for selected tab.public int getColorTheme()
public int getDefaultColorTheme()
public void setColorTheme(int colorTheme)
public int getTabResizeMode()
public void setTabResizeMode(int resizeMode)
RESIZE_MODE_DEFAULT
, RESIZE_MODE_NONE
,
RESIZE_MODE_FIT
, RESIZE_MODE_FIXED
and RESIZE_MODE_COMPRESSED
.resizeMode
- the new resize mode.public int getDefaultTabResizeMode()
public int getTabShape()
public int getDefaultTabStyle()
public void setTabShape(int tabShape)
public void setTabLeadingComponent(java.awt.Component component)
component
- the tab leading componentjava.lang.IllegalArgumentException
- if the component doesn't implement UIResource.public java.awt.Component getTabLeadingComponent()
public void setTabTrailingComponent(java.awt.Component component)
component
- the tab trailing componentjava.lang.IllegalArgumentException
- if the component doesn't implement UIResource.public java.awt.Component getTabTrailingComponent()
public boolean isShowCloseButtonOnSelectedTab()
public void setShowCloseButtonOnSelectedTab(boolean i)
i
- the flag indicating if close button should be shown in the selected tabpublic JideTabbedPane.ColorProvider getTabColorProvider()
public void setTabColorProvider(JideTabbedPane.ColorProvider tabColorProvider)
JTabbedPane.setBackgroundAt(int,java.awt.Color)
method is because this way queries the color. So it can
support unlimited number of tabs. When you don't know exactly how many tabs it will be, this way can still handle
it very well. There is ONENOTE_COLOR_PROVIDER
which provides the tab color as you see in Microsoft
OneNote 2003. You can also define your own ColorProvider to fit your application color theme.tabColorProvider
- the tab color providerpublic void editTabAt(int tabIndex)
setTabEditingAllowed(boolean)
is set to true.tabIndex
- the index of the tabpublic boolean isTabEditing()
public void stopTabEditing()
public void cancelTabEditing()
public int getEditingTabIndex()
protected java.beans.PropertyChangeListener createFocusChangeListener()
public void repaintTabAreaAndContentBorder()
protected void repaintContentBorder(int x, int y, int width, int height)
x
- the x coordinatey
- the y coordinatewidth
- the widthheight
- the heightpublic void addNotify()
addNotify
in class javax.swing.JComponent
public void removeNotify()
removeNotify
in class javax.swing.JComponent
public javax.swing.ListCellRenderer getTabListCellRenderer()
public void setTabListCellRenderer(javax.swing.ListCellRenderer tabListCellRenderer)
public static class TabListCellRenderer extends DefaultListCellRenderer {
public Component getListCellRendererComponent(JList list, Object value, int index,
boolean isSelected, boolean cellHasFocus) {
if (value instanceof JideTabbedPane) { // will always be true
JideTabbedPane tabbedPane = (JideTabbedPane) value;
String title = tabbedPane.getTitleAt(index);
Icon icon = tabbedPane.getIconAt(index);
JLabel label = (JLabel) super.getListCellRendererComponent(list, title, index,
isSelected, cellHasFocus);
label.setIcon(icon);
return label;
}
else {
return super.getListCellRendererComponent(list, value, index, isSelected,
cellHasFocus);
}
}
}
You can create your own cell renderer either extending JideTabbedPane.TabListCellRenderer
or starting from scratch.tabListCellRenderer
- the cell rendererpublic boolean hasFocusComponent()
public java.awt.Insets getContentBorderInsets()
public void setContentBorderInsets(java.awt.Insets contentBorderInsets)
contentBorderInsets
- the content border insetspublic boolean isDragOverDisabled()
setDragOverDisabled(boolean)
public void setDragOverDisabled(boolean dragOverDisabled)
dragOverDisabled
- the flag indicating if drag over is disabledpublic void scrollSelectedTabToVisible(boolean scrollLeft)
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 addTabEditingListener(TabEditingListener l)
TabEditingListener
to this tabbedpane.l
- the TabEditingListener
to addfireTabEditing(int, int, java.lang.String, java.lang.String)
,
removeTabEditingListener(com.jidesoft.swing.TabEditingListener)
public void removeTabEditingListener(TabEditingListener l)
TabEditingListener
from this tabbedpane.l
- the TabEditingListener
to removefireTabEditing(int, int, java.lang.String, java.lang.String)
,
addTabEditingListener(com.jidesoft.swing.TabEditingListener)
public TabEditingListener[] getTabEditingListeners()
TabEditingListener
s added to this JTabbedPane
with
addTabEditingListener
.TabEditingListener
s added or an empty array if no listeners have been addedprotected void fireTabEditing(int id, int index, java.lang.String oldTitle, java.lang.String newTitle)
public javax.swing.Icon getIconForTab(int tabIndex)
isShowIconsOnTab()
. Note that getIconAt method will always return the tab even though the icon is not displayed
because the two flags above.tabIndex
- the tab index.public boolean isScrollSelectedTabOnWheel()
public void setScrollSelectedTabOnWheel(boolean scrollSelectedTabOnWheel)
scrollSelectedTabOnWheel
- the flagpublic boolean isCloseTabOnMouseMiddleButton()
public void setCloseTabOnMouseMiddleButton(boolean closeTabOnMouseMiddleButton)
closeTabOnMouseMiddleButton
- the flag