Package com.jidesoft.swing
Class JideTabbedPane
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JTabbedPane
-
- com.jidesoft.swing.JideTabbedPane
-
- All Implemented Interfaces:
java.awt.image.ImageObserver
,java.awt.MenuContainer
,java.io.Serializable
,javax.accessibility.Accessible
,javax.swing.SwingConstants
public class JideTabbedPane extends javax.swing.JTabbedPane
JideTabbedPane
is an enhanced version ofJTabbedPane
. Different fromJTabbedPane
, it- has an option to hide tab area if there is only one component in the tabbed pane.
- has an option to resize tab width so that all tabs can be fitted in one row.
- has an option to show a close button along with scroll left and scroll right buttons in tab area.
JideTabbedPane
is the same asJTabbedPane
.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class 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
class
JideTabbedPane.NoFocusButton
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.-
Nested classes/interfaces inherited from class javax.swing.JTabbedPane
javax.swing.JTabbedPane.AccessibleJTabbedPane, javax.swing.JTabbedPane.ModelListener
-
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
-
-
Field Summary
Fields Modifier and Type Field 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 boldstatic java.lang.String
BOX_STYLE_PROPERTY
Bound property name for box stylestatic int
BUTTON_CLOSE
static int
BUTTON_EAST
static int
BUTTON_LIST
static int
BUTTON_NORTH
static int
BUTTON_SOUTH
static int
BUTTON_WEST
static int
COLOR_THEME_DEFAULT
color stylestatic 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_SELECTED_INDEX
static java.lang.String
PROPERTY_SHOW_CLOSE_BUTTON_ON_MOUSE_OVER
static java.lang.String
PROPERTY_TAB_AREA_INSETS
static java.lang.String
PROPERTY_TAB_COLOR_PROVIDER
static java.lang.String
PROPERTY_TAB_INSETS
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 tabstatic java.lang.String
SHOW_CLOSE_BUTTON_PROPERTY
Bound property name for if showing close buttonstatic java.lang.String
SHOW_ICONS_PROPERTY
Bound property name for show icons on tabstatic 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 UIDefaultsstatic java.lang.String
USE_DEFAULT_SHOW_ICONS_PROPERTY
Bound property name for using default show icons on tab value from UIDefaults-
Fields inherited from class javax.swing.JTabbedPane
changeEvent, changeListener, model, SCROLL_TAB_LAYOUT, tabPlacement, WRAP_TAB_LAYOUT
-
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
Fields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
-
Constructor Summary
Constructors Constructor Description JideTabbedPane()
Creates an emptyTabbedPane
with a default tab placement ofJTabbedPane.TOP
.JideTabbedPane(int tabPlacement)
Creates an emptyTabbedPane
with the specified tab placement of either:JTabbedPane.TOP
,JTabbedPane.BOTTOM
,JTabbedPane.LEFT
, orJTabbedPane.RIGHT
.JideTabbedPane(int tabPlacement, int tabLayoutPolicy)
Creates an emptyJideTabbedPane
with the specified tab placement and tab layout policy.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.Component
add(java.awt.Component component)
void
addNotify()
void
addTabEditingListener(TabEditingListener l)
Adds aTabEditingListener
to this tabbedpane.protected java.awt.Point
calculateTabListPopupPosition(javax.swing.JButton listButton)
Calculates the position where the tab list popup is to be displayed based on the list button being clicked.void
cancelTabEditing()
protected void
clearVisComp()
protected java.beans.PropertyChangeListener
createFocusChangeListener()
JideTabbedPane.NoFocusButton
createNoFocusButton(int type)
Creates no focus buttons for JideTabbedPane.protected javax.swing.JList
createTabList(java.awt.Insets insets)
Creates the tab list.protected JidePopup
createTabListPopup()
Creates tab list popup.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" andisShowIconsOnTab()
.java.awt.Component
getLastFocusedComponent(java.awt.Component pageComponent)
Gets the last focused component of a particular page.protected java.util.Hashtable
getPageLastFocusTrackers()
java.lang.String
getResourceString(java.lang.String key)
Gets the resource string used in JideTabbedPane.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
getTabAlignment()
Returns the alignment of the tabs for this tabbed pane.java.awt.Insets
getTabAreaInsets()
int
getTabAtLocation(int x, int y)
JideTabbedPane.ColorProvider
getTabColorProvider()
Gets the tab color provider.TabEditingListener[]
getTabEditingListeners()
Returns an array of all theTabEditingListener
s added to thisJTabbedPane
withaddTabEditingListener
.TabEditingValidator
getTabEditingValidator()
int
getTabHeight()
Gets tab height.java.awt.Insets
getTabInsets()
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
hideTabListPopup()
Hides the tab list popup if it's visible.void
insertTab(java.lang.String title, javax.swing.Icon icon, java.awt.Component component, java.lang.String tip, int index)
Overridden to add aPageLastFocusTracker
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
isHideTrailingWhileNoButtons()
Get the flag that if the trailing component should be hidden while no buttons are visible.boolean
isLayoutTrailingComponentBeforeButtons()
Gets the flag indicating if the trailing component should be layout before the default buttons.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
isShowCloseButtonOnMouseOver()
Gets the flag indicating if the close button should only be displayed when the mouse is over the tab.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
isTabListPopupVisible()
Checks if the tab list popup is visible.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
removeAll()
void
removeNotify()
void
removeTabAt(int index)
void
removeTabEditingListener(TabEditingListener l)
Removes aTabEditingListener
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 c)
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
setHideTrailingWhileNoButtons(boolean hideTrailingWhileNoButtons)
Set the flag that if the trailing component should be hidden while no buttons are visible.void
setLayoutTrailingComponentBeforeButtons(boolean layoutTrailingComponentBeforeButtons)
Sets the flag indicating if the trailing component should be layout before the default buttons.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
setShowCloseButtonOnMouseOver(boolean showCloseButtonOnMouseOverOnly)
Sets the flag indicating if the close button should only be displayed when the mouse is over the tab.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
setTabAlignment(int tabAlignment)
Sets the tab alignment for the tabs of a tabbed pane.void
setTabAreaInsets(java.awt.Insets tabAreaInsets)
Sets the tab area insets.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
setTabInsets(java.awt.Insets tabInsets)
Sets the tab insets.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
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
showTabListPopup(javax.swing.JButton listButton)
Shows the tab list popup by clicking on the list button.void
stopTabEditing()
void
updateUI()
Resets the UI property to a value from the current look and feel.-
Methods inherited from class javax.swing.JTabbedPane
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, removeChangeListener, setBackgroundAt, setDisabledIconAt, setDisplayedMnemonicIndexAt, setEnabledAt, setForegroundAt, setIconAt, setMnemonicAt, setModel, setSelectedComponent, setTabComponentAt, setTabLayoutPolicy, setTabPlacement, setTitleAt, setToolTipTextAt
-
Methods inherited from class javax.swing.JComponent
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
-
Methods inherited from class java.awt.Container
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
-
Methods inherited from class java.awt.Component
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, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
-
-
-
Field Detail
-
SHRINK_TAB_PROPERTY
public static final java.lang.String SHRINK_TAB_PROPERTY
Bound property name for shrink tabs.- See Also:
- Constant Field Values
-
HIDE_IF_ONE_TAB_PROPERTY
public static final java.lang.String HIDE_IF_ONE_TAB_PROPERTY
Bound property name for hide tab area if there is only one tab.- See Also:
- Constant Field Values
-
SHOW_TAB_BUTTONS_PROPERTY
public static final java.lang.String SHOW_TAB_BUTTONS_PROPERTY
Bound property name for show tab button.- See Also:
- Constant Field Values
-
BOX_STYLE_PROPERTY
public static final java.lang.String BOX_STYLE_PROPERTY
Bound property name for box style- See Also:
- Constant Field Values
-
SHOW_ICONS_PROPERTY
public static final java.lang.String SHOW_ICONS_PROPERTY
Bound property name for show icons on tab- See Also:
- Constant Field Values
-
USE_DEFAULT_SHOW_ICONS_PROPERTY
public static final java.lang.String USE_DEFAULT_SHOW_ICONS_PROPERTY
Bound property name for using default show icons on tab value from UIDefaults- See Also:
- Constant Field Values
-
SHOW_CLOSE_BUTTON_ON_TAB_PROPERTY
public static final java.lang.String SHOW_CLOSE_BUTTON_ON_TAB_PROPERTY
Bound property name for if showing close button on tab- See Also:
- Constant Field Values
-
SHOW_CLOSE_BUTTON_PROPERTY
public static final java.lang.String SHOW_CLOSE_BUTTON_PROPERTY
Bound property name for if showing close button- See Also:
- Constant Field Values
-
SHOW_TAB_AREA_PROPERTY
public static final java.lang.String SHOW_TAB_AREA_PROPERTY
Bound property name for if the tab area is visible.- See Also:
- Constant Field Values
-
SHOW_TAB_CONTENT_PROPERTY
public static final java.lang.String SHOW_TAB_CONTENT_PROPERTY
Bound property name for if the tab area is visible.- See Also:
- Constant Field Values
-
TAB_CLOSABLE_PROPERTY
public static final java.lang.String TAB_CLOSABLE_PROPERTY
Bound property name for tab closable.- See Also:
- Constant Field Values
-
USE_DEFAULT_SHOW_CLOSE_BUTTON_ON_TAB_PROPERTY
public static final 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- See Also:
- Constant Field Values
-
BOLDACTIVETAB_PROPERTY
public static final java.lang.String BOLDACTIVETAB_PROPERTY
Bound property name for if the active tab title is in bold- See Also:
- Constant Field Values
-
GRIPPER_PROPERTY
public static final java.lang.String GRIPPER_PROPERTY
Bound property name for gripper.- See Also:
- Constant Field Values
-
PROPERTY_TAB_SHAPE
public static final java.lang.String PROPERTY_TAB_SHAPE
- See Also:
- Constant Field Values
-
PROPERTY_COLOR_THEME
public static final java.lang.String PROPERTY_COLOR_THEME
- See Also:
- Constant Field Values
-
PROPERTY_TAB_RESIZE_MODE
public static final java.lang.String PROPERTY_TAB_RESIZE_MODE
- See Also:
- Constant Field Values
-
PROPERTY_TAB_LEADING_COMPONENT
public static final java.lang.String PROPERTY_TAB_LEADING_COMPONENT
- See Also:
- Constant Field Values
-
PROPERTY_TAB_TRAILING_COMPONENT
public static final java.lang.String PROPERTY_TAB_TRAILING_COMPONENT
- See Also:
- Constant Field Values
-
PROPERTY_TAB_COLOR_PROVIDER
public static final java.lang.String PROPERTY_TAB_COLOR_PROVIDER
- See Also:
- Constant Field Values
-
PROPERTY_CONTENT_BORDER_INSETS
public static final java.lang.String PROPERTY_CONTENT_BORDER_INSETS
- See Also:
- Constant Field Values
-
PROPERTY_TAB_AREA_INSETS
public static final java.lang.String PROPERTY_TAB_AREA_INSETS
- See Also:
- Constant Field Values
-
PROPERTY_TAB_INSETS
public static final java.lang.String PROPERTY_TAB_INSETS
- See Also:
- Constant Field Values
-
PROPERTY_DRAG_OVER_DISABLED
public static final java.lang.String PROPERTY_DRAG_OVER_DISABLED
- See Also:
- Constant Field Values
-
SCROLL_TAB_ON_WHEEL_PROPERTY
public static final java.lang.String SCROLL_TAB_ON_WHEEL_PROPERTY
- See Also:
- Constant Field Values
-
PROPERTY_SELECTED_INDEX
public static final java.lang.String PROPERTY_SELECTED_INDEX
- See Also:
- Constant Field Values
-
PROPERTY_SHOW_CLOSE_BUTTON_ON_MOUSE_OVER
public static final java.lang.String PROPERTY_SHOW_CLOSE_BUTTON_ON_MOUSE_OVER
- See Also:
- Constant Field Values
-
BUTTON_CLOSE
public static final int BUTTON_CLOSE
- See Also:
- Constant Field Values
-
BUTTON_EAST
public static final int BUTTON_EAST
- See Also:
- Constant Field Values
-
BUTTON_WEST
public static final int BUTTON_WEST
- See Also:
- Constant Field Values
-
BUTTON_NORTH
public static final int BUTTON_NORTH
- See Also:
- Constant Field Values
-
BUTTON_SOUTH
public static final int BUTTON_SOUTH
- See Also:
- Constant Field Values
-
BUTTON_LIST
public static final int BUTTON_LIST
- See Also:
- Constant Field Values
-
RESIZE_MODE_DEFAULT
public static final int RESIZE_MODE_DEFAULT
A tab resize mode. The default resize mode means it will use the resize mode ofgetDefaultTabResizeMode()
which is defined in UIDefault "JideTabbedPane.defaultResizeMode". You can change this in UIDefault. It will affect the resize mode of allJideTabbedPane
s.- See Also:
- Constant Field Values
-
RESIZE_MODE_NONE
public static final int RESIZE_MODE_NONE
A tab resize mode. The none resize mode means the tab will not resize when tabbed pane width changes.- See Also:
- Constant Field Values
-
RESIZE_MODE_FIT
public static final int RESIZE_MODE_FIT
A tab resize mode. The fit resize mode means the tabs will shrink if the tabbed pane width shrinks so there is no way to display the full contents of the tabs.- See Also:
- Constant Field Values
-
RESIZE_MODE_FIXED
public static final int RESIZE_MODE_FIXED
A tab resize mode. All tabs will be at a fixed width. The fixed width is defined as UIDefault "JideTabbedPane.fixedStyleRectSize" which is an integer.- See Also:
- Constant Field Values
-
RESIZE_MODE_COMPRESSED
public static final int RESIZE_MODE_COMPRESSED
A tab resize mode. In this mode, the select tab will have full tab width. Non-selected tab will only display the icon. The actual width of non-selected tab is determined by UIDefault "JideTabbedPane.compressedStyleNoIconRectSize" which is an integer.- See Also:
- Constant Field Values
-
COLOR_THEME_DEFAULT
public static final int COLOR_THEME_DEFAULT
color style- See Also:
- Constant Field Values
-
COLOR_THEME_WIN2K
public static final int COLOR_THEME_WIN2K
- See Also:
- Constant Field Values
-
COLOR_THEME_OFFICE2003
public static final int COLOR_THEME_OFFICE2003
- See Also:
- Constant Field Values
-
COLOR_THEME_VSNET
public static final int COLOR_THEME_VSNET
- See Also:
- Constant Field Values
-
COLOR_THEME_WINXP
public static final int COLOR_THEME_WINXP
- See Also:
- Constant Field Values
-
SHAPE_DEFAULT
public static final int SHAPE_DEFAULT
- See Also:
- Constant Field Values
-
SHAPE_WINDOWS
public static final int SHAPE_WINDOWS
- See Also:
- Constant Field Values
-
SHAPE_VSNET
public static final int SHAPE_VSNET
- See Also:
- Constant Field Values
-
SHAPE_BOX
public static final int SHAPE_BOX
- See Also:
- Constant Field Values
-
SHAPE_OFFICE2003
public static final int SHAPE_OFFICE2003
- See Also:
- Constant Field Values
-
SHAPE_FLAT
public static final int SHAPE_FLAT
- See Also:
- Constant Field Values
-
SHAPE_ECLIPSE
public static final int SHAPE_ECLIPSE
- See Also:
- Constant Field Values
-
SHAPE_ECLIPSE3X
public static final int SHAPE_ECLIPSE3X
- See Also:
- Constant Field Values
-
SHAPE_EXCEL
public static final int SHAPE_EXCEL
- See Also:
- Constant Field Values
-
SHAPE_ROUNDED_VSNET
public static final int SHAPE_ROUNDED_VSNET
- See Also:
- Constant Field Values
-
SHAPE_ROUNDED_FLAT
public static final int SHAPE_ROUNDED_FLAT
- See Also:
- Constant Field Values
-
SHAPE_WINDOWS_SELECTED
public static final int SHAPE_WINDOWS_SELECTED
- See Also:
- Constant Field Values
-
_tabEditingAllowed
protected transient boolean _tabEditingAllowed
-
_tabEditValidator
protected transient TabEditingValidator _tabEditValidator
-
ONENOTE_COLOR_PROVIDER
public static JideTabbedPane.ColorProvider ONENOTE_COLOR_PROVIDER
-
_focusChangeListener
protected java.beans.PropertyChangeListener _focusChangeListener
-
-
Constructor Detail
-
JideTabbedPane
public JideTabbedPane()
Creates an emptyTabbedPane
with a default tab placement ofJTabbedPane.TOP
.- See Also:
JTabbedPane.addTab(java.lang.String, javax.swing.Icon, java.awt.Component, java.lang.String)
-
JideTabbedPane
public JideTabbedPane(int tabPlacement)
Creates an emptyTabbedPane
with the specified tab placement of either:JTabbedPane.TOP
,JTabbedPane.BOTTOM
,JTabbedPane.LEFT
, orJTabbedPane.RIGHT
.- Parameters:
tabPlacement
- the placement for the tabs relative to the content- See Also:
JTabbedPane.addTab(java.lang.String, javax.swing.Icon, java.awt.Component, java.lang.String)
-
JideTabbedPane
public JideTabbedPane(int tabPlacement, int tabLayoutPolicy)
Creates an emptyJideTabbedPane
with the specified tab placement and tab layout policy. Tab placement may be either:JTabbedPane.TOP
orJTabbedPane.BOTTOM
Tab layout policy should always beJTabbedPane.SCROLL_TAB_LAYOUT
.JTabbedPane
also supportsJTabbedPane.WRAP_TAB_LAYOUT
. However the style of tabs inJideTabbedPane
doesn't match withJTabbedPane.WRAP_TAB_LAYOUT
very well, so we decided not to support it.- Parameters:
tabPlacement
- the placement for the tabs relative to the contenttabLayoutPolicy
- the policy for laying out tabs when all tabs will not fit on one run- Throws:
java.lang.IllegalArgumentException
- if tab placement or tab layout policy are not one of the above supported values- See Also:
JTabbedPane.addTab(java.lang.String, javax.swing.Icon, java.awt.Component, java.lang.String)
-
-
Method Detail
-
getUI
public javax.swing.plaf.TabbedPaneUI getUI()
Returns the UI object which implements the L&F for this component.- Overrides:
getUI
in classjavax.swing.JTabbedPane
- Returns:
- a
TabbedPaneUI
object - See Also:
setUI(javax.swing.plaf.TabbedPaneUI)
-
setUI
public void setUI(javax.swing.plaf.TabbedPaneUI ui)
Sets the UI object which implements the L&F for this component.- Overrides:
setUI
in classjavax.swing.JTabbedPane
- Parameters:
ui
- the new UI object- See Also:
UIDefaults.getUI(javax.swing.JComponent)
-
updateUI
public void updateUI()
Resets the UI property to a value from the current look and feel.- Overrides:
updateUI
in classjavax.swing.JTabbedPane
- See Also:
JComponent.updateUI()
-
getUIClassID
public java.lang.String getUIClassID()
Returns the name of the UI class that implements the L&F for this component.- Overrides:
getUIClassID
in classjavax.swing.JTabbedPane
- Returns:
- the string "TabbedPaneUI"
- See Also:
JComponent.getUIClassID()
,UIDefaults.getUI(javax.swing.JComponent)
-
isHideOneTab
public boolean isHideOneTab()
Checks if tab area will be hidden if there is only one tab.
If the showTabButtons option is true, isHideOneTab will always return false so that there is a place to place those tab buttons.- Returns:
- true if tab areas will be hidden if there is only one tab; false otherwise.
-
setHideOneTab
public void setHideOneTab(boolean hideOne)
Sets the value if tab area will be hidden if there is only one tab. PropertyChangeEvent of HIDE_IF_ONE_TAB_PROPERTY will be fired.
If the showTabButtons option is true, no matter what option you pass to setHideOneTab, isHideOneTab will always return false.- Parameters:
hideOne
- true to hide tab areas if there is only one tab; false otherwise.
-
isTabShown
public boolean isTabShown()
Checks if tab area is shown.- Returns:
- true if tab area is visible; false otherwise.
-
isShowTabButtons
public boolean isShowTabButtons()
Checks if tab buttons are always visible. Tab buttons are scroll left button, scroll right button and close button which appear to the right of tabs in tab area.
If the showTabButtons is set to true, isHideOneTab will always return false so that there is a place to place those tab buttons.- Returns:
- true if tab buttons are always visible; false otherwise.
-
setShowTabButtons
public void setShowTabButtons(boolean showButtons)
Sets the value if tab buttons are always visible. PropertyChangeEvent of SHOW_TAB_BUTTONS_PROPERTY will be fired.- Parameters:
showButtons
- true to always show tab buttons; false otherwise.
-
setCloseAction
public void setCloseAction(javax.swing.Action action)
Sets default close action for close button.- Parameters:
action
- the close action.
-
getCloseAction
public javax.swing.Action getCloseAction()
Gets close action.- Returns:
- close action
-
setAutoFocusOnTabHideClose
public void setAutoFocusOnTabHideClose(boolean autoFocusonTabHideClose)
-
isAutoFocusOnTabHideClose
public boolean isAutoFocusOnTabHideClose()
-
resetDefaultCloseAction
public void resetDefaultCloseAction()
Resets close action to default. Default action is to remove currently selected tab.
-
setSuppressStateChangedEvents
public void setSuppressStateChangedEvents(boolean suppress)
-
isSuppressStateChangedEvents
public boolean isSuppressStateChangedEvents()
-
fireStateChanged
protected void fireStateChanged()
- Overrides:
fireStateChanged
in classjavax.swing.JTabbedPane
-
isSuppressSetSelectedIndex
public boolean isSuppressSetSelectedIndex()
-
setSuppressSetSelectedIndex
public void setSuppressSetSelectedIndex(boolean suppressSetSelectedIndex)
-
setSelectedIndex
public void setSelectedIndex(int index)
- Overrides:
setSelectedIndex
in classjavax.swing.JTabbedPane
-
popupSelectedIndex
public void popupSelectedIndex(int index)
-
setComponentAt
public void setComponentAt(int index, java.awt.Component c)
- Overrides:
setComponentAt
in classjavax.swing.JTabbedPane
-
isAutoRequestFocus
public boolean isAutoRequestFocus()
Checks if the UI should automatically request focus on selected component when doing the layout. This method is only used internally when the tab is being moved.- Returns:
- true or false. Default is true.
-
setAutoRequestFocus
public void setAutoRequestFocus(boolean autoRequestFocus)
-
moveSelectedTabTo
public void moveSelectedTabTo(int tabIndex)
Moves selected tab from current position to the position specified in tabIndex.- Parameters:
tabIndex
- new index
-
requestFocusForVisibleComponent
public boolean requestFocusForVisibleComponent()
-
isHideTrailingWhileNoButtons
public boolean isHideTrailingWhileNoButtons()
Get the flag that if the trailing component should be hidden while no buttons are visible. Be default, the flag is false. If you want to connect visibility of those two components, please set it to true.- Returns:
- true if the trailing component would be hidden while no buttons are visible. Otherwise false.
- See Also:
isShowTabArea()
,isShowTabButtons()
,setHideTrailingWhileNoButtons(boolean)
-
setHideTrailingWhileNoButtons
public void setHideTrailingWhileNoButtons(boolean hideTrailingWhileNoButtons)
Set the flag that if the trailing component should be hidden while no buttons are visible.- Parameters:
hideTrailingWhileNoButtons
- the flag- See Also:
isHideTrailingWhileNoButtons()
-
isLayoutTrailingComponentBeforeButtons
public boolean isLayoutTrailingComponentBeforeButtons()
Gets the flag indicating if the trailing component should be layout before the default buttons.- Returns:
- true if the trailing component should be layout to the left/up. Otherwise false.
- See Also:
setLayoutTrailingComponentBeforeButtons(boolean)
-
setLayoutTrailingComponentBeforeButtons
public void setLayoutTrailingComponentBeforeButtons(boolean layoutTrailingComponentBeforeButtons)
Sets the flag indicating if the trailing component should be layout before the default buttons. The default value is false. If you want your trailing component preceding to the default buttons, please set this flag to true.- Parameters:
layoutTrailingComponentBeforeButtons
- the flag
-
processMouseSelection
public void processMouseSelection(int tabIndex, java.awt.event.MouseEvent e)
-
getTabHeight
public int getTabHeight()
Gets tab height.- Returns:
- height of tab
-
isRightClickSelect
public boolean isRightClickSelect()
Returns true if you want right click on unselected tab will select that tab.- Returns:
- true if right click on unselected tab will select that tab
-
setRightClickSelect
public void setRightClickSelect(boolean rightClickSelect)
Sets if you want right click on unselected tab will select that tab.- Parameters:
rightClickSelect
- true if right click on unselected tab will select that tab
-
getTabAtLocation
public int getTabAtLocation(int x, int y)
-
isShowGripper
public boolean isShowGripper()
If the grip is visible.- Returns:
- true if grip is visible
-
setShowGripper
public void setShowGripper(boolean showGripper)
Sets the visibility of grip.- Parameters:
showGripper
- true to show grip
-
isShowIconsOnTab
public boolean isShowIconsOnTab()
Checks if the icon will be shown on tab.- Returns:
- true if the icon will be shown on tab.
-
setShowIconsOnTab
public void setShowIconsOnTab(boolean showIconsOnTab)
Sets to true if the icon will be shown on tab. The value set to this method will be used only when isUseDefaultShowIconsOnTab() returns false.- Parameters:
showIconsOnTab
- true or false.
-
isUseDefaultShowIconsOnTab
public boolean isUseDefaultShowIconsOnTab()
If the return is true, the value set to setShowIconsOnTab() will be ignored.- Returns:
- if use default value from UIDefaults in L&F.
-
setUseDefaultShowIconsOnTab
public void setUseDefaultShowIconsOnTab(boolean useDefaultShowIconsOnTab)
Set if use the default value from UIDefaults.- Parameters:
useDefaultShowIconsOnTab
- true or false.
-
isShowCloseButtonOnTab
public boolean isShowCloseButtonOnTab()
Checks if the close button will be shown on tab.- Returns:
- true if close button will be shown on tab.
-
setShowCloseButtonOnTab
public void setShowCloseButtonOnTab(boolean showCloseButtonOnTab)
Sets to true if the close button will be shown on tab. If you ever call this method, we will automatically call setUseDefaultShowCloseButtonOnTab(false). It will also automatically call setShowCloseButton(true) if the showCloseButtonOnTab parameter is true.- Parameters:
showCloseButtonOnTab
- true or false.
-
isUseDefaultShowCloseButtonOnTab
public boolean isUseDefaultShowCloseButtonOnTab()
If the return is true, the value set to setShowCloseButtonOnTab() will be ignored.- Returns:
- if use default value from UIDefaults in L&F.
-
setUseDefaultShowCloseButtonOnTab
public void setUseDefaultShowCloseButtonOnTab(boolean useDefaultShowCloseButtonOnTab)
Set if use the default value from UIDefaults.- Parameters:
useDefaultShowCloseButtonOnTab
- true or false.
-
setTabEditingAllowed
public void setTabEditingAllowed(boolean allowed)
Sets the value if the tab editing is allowed. Tab editing allows user to edit the tab title directly by double clicking on the tab.- Parameters:
allowed
- true or false.
-
isTabEditingAllowed
public boolean isTabEditingAllowed()
Checks if the tab editing is allowed.- Returns:
- true if tab editing is allowed. Otherwise false.
-
setTabEditingValidator
public void setTabEditingValidator(TabEditingValidator tabEditValidator)
-
getTabEditingValidator
public TabEditingValidator getTabEditingValidator()
-
isShowCloseButton
public boolean isShowCloseButton()
If close button is visible.- Returns:
- true if the close button is visible.
-
setShowCloseButton
public void setShowCloseButton(boolean showCloseButton)
Sets if the close button is visible. Close button can be either side by side with scroll buttons, or on each tab. If you call setShowCloseButton(false), it will hide close buttons for both cases.- Parameters:
showCloseButton
- true or false.
-
isShowTabArea
public boolean isShowTabArea()
If the tab area is visible.- Returns:
- true if the tab area is visible.
-
setShowTabArea
public void setShowTabArea(boolean showTabArea)
Sets if the tab area is visible. If not visible, you can programatically call setSelectedIndex to change ta. User will not be able to do it by clicking on tabs since they are not visible.- Parameters:
showTabArea
- true or false.
-
isShowTabContent
public boolean isShowTabContent()
If the tab content is visible.- Returns:
- true if the tab content is visible.
-
setShowTabContent
public void setShowTabContent(boolean showTabContent)
Sets if the tab content is visible.- Parameters:
showTabContent
- true or false.
-
getStringConverter
public StringConverter getStringConverter()
Gets the string converter that converts the tab title to the display title.- Returns:
- the converter that converts the tab title to the display title.
-
setStringConverter
public void setStringConverter(StringConverter stringConverter)
Sets the string converter.- Parameters:
stringConverter
- the StringConverter.- See Also:
getStringConverter()
-
getDisplayTitleAt
public java.lang.String getDisplayTitleAt(int index)
Gets the display title. Display title is result of using string converter that converts from the title to a display title. There is no setter for display title. You control the value by using a different string converter.- Parameters:
index
- the index to display- Returns:
- the display title.
-
isBoldActiveTab
public boolean isBoldActiveTab()
If the active tab is in bold.- Returns:
- if the active tab is in bold.
-
setBoldActiveTab
public void setBoldActiveTab(boolean boldActiveTab)
Sets if the active tab is in bold.- Parameters:
boldActiveTab
- the flag
-
removeTabAt
public void removeTabAt(int index)
- Overrides:
removeTabAt
in classjavax.swing.JTabbedPane
-
isTabClosableAt
public boolean isTabClosableAt(int tabIndex)
Checks if the tab at tabIndex should show the close button. This is only a valid if showCloseButtonOnTab attribute is true. By default, this method always return true. Subclass can override this method to return a different value.- Parameters:
tabIndex
- the tab index- Returns:
- the flag.
- Throws:
java.lang.IndexOutOfBoundsException
- if index is out of range (index < 0 || index >= tab count)
-
setTabClosableAt
public void setTabClosableAt(int tabIndex, boolean closable)
Checks if the tab at tabIndex should show the close button. This is only a valid if showCloseButtonOnTab attribute is true. By default, this method always return true. Subclass can override this method to return a different value. Please note, this attribute has effect only whenisShowCloseButtonOnTab()
return true.- Parameters:
tabIndex
- the tab indexclosable
- the flag indicating if the tab is closable- Throws:
java.lang.IndexOutOfBoundsException
- if index is out of range (index < 0 || index >= tab count)
-
getPageLastFocusTrackers
protected java.util.Hashtable getPageLastFocusTrackers()
-
getLastFocusedComponent
public java.awt.Component getLastFocusedComponent(java.awt.Component pageComponent)
Gets the last focused component of a particular page.- Parameters:
pageComponent
- the page component- Returns:
- the last focused component of a particular page.
-
clearVisComp
protected void clearVisComp()
-
insertTab
public void insertTab(java.lang.String title, javax.swing.Icon icon, java.awt.Component component, java.lang.String tip, int index)
Overridden to add aPageLastFocusTracker
to each page, used to update the page's last focused component.- Overrides:
insertTab
in classjavax.swing.JTabbedPane
-
getSelectedTabFont
public java.awt.Font getSelectedTabFont()
Gets the font for selected tab.- Returns:
- the font for selected tab.
-
setSelectedTabFont
public void setSelectedTabFont(java.awt.Font selectedTabFont)
Sets the font for selected tab.- Parameters:
selectedTabFont
- new font for selected tab.
-
getColorTheme
public int getColorTheme()
-
getDefaultColorTheme
public int getDefaultColorTheme()
-
setColorTheme
public void setColorTheme(int colorTheme)
-
getTabResizeMode
public int getTabResizeMode()
-
setTabResizeMode
public void setTabResizeMode(int resizeMode)
Sets the tab resize mode. There are five resize modes. -RESIZE_MODE_DEFAULT
,RESIZE_MODE_NONE
,RESIZE_MODE_FIT
,RESIZE_MODE_FIXED
andRESIZE_MODE_COMPRESSED
.- Parameters:
resizeMode
- the new resize mode.
-
getDefaultTabResizeMode
public int getDefaultTabResizeMode()
-
getTabShape
public int getTabShape()
-
getDefaultTabStyle
public int getDefaultTabStyle()
-
setTabShape
public void setTabShape(int tabShape)
-
setTabLeadingComponent
public void setTabLeadingComponent(java.awt.Component component)
Sets the tab leading component. The tab leading component will appear before the tabs in the tab area. Please note, you must implement UIResource for the component you want to use as tab leading component.- Parameters:
component
- the tab leading component- Throws:
java.lang.IllegalArgumentException
- if the component doesn't implement UIResource.
-
getTabLeadingComponent
public java.awt.Component getTabLeadingComponent()
-
setTabTrailingComponent
public void setTabTrailingComponent(java.awt.Component component)
Sets the tab trailing component. The tab trailing component will appear after the tabs in the tab area. Please note, you must implement UIResource for the component you want to use as tab trailing component.- Parameters:
component
- the tab trailing component- Throws:
java.lang.IllegalArgumentException
- if the component doesn't implement UIResource.
-
add
public java.awt.Component add(java.awt.Component component)
- Overrides:
add
in classjavax.swing.JTabbedPane
-
getTabTrailingComponent
public java.awt.Component getTabTrailingComponent()
-
isShowCloseButtonOnSelectedTab
public boolean isShowCloseButtonOnSelectedTab()
-
setShowCloseButtonOnSelectedTab
public void setShowCloseButtonOnSelectedTab(boolean i)
Shows the close button on the selected tab only. You also need to setShowCloseButtonOnTab(true) and setShowCloseButton(true) if you want to setShowCloseButtonOnSelectedTab(true).- Parameters:
i
- the flag indicating if close button should be shown in the selected tab
-
isShowCloseButtonOnMouseOver
public boolean isShowCloseButtonOnMouseOver()
Gets the flag indicating if the close button should only be displayed when the mouse is over the tab.- Returns:
- true if the close button should only be displayed when the mouse is over the tab. Otherwise false.
- Since:
- 3.3.3
- See Also:
setShowCloseButtonOnMouseOver(boolean)
-
setShowCloseButtonOnMouseOver
public void setShowCloseButtonOnMouseOver(boolean showCloseButtonOnMouseOverOnly)
Sets the flag indicating if the close button should only be displayed when the mouse is over the tab. The default value of the flag is false to keep default behavior not changed.- Parameters:
showCloseButtonOnMouseOverOnly
- the flag- Since:
- 3.3.3
-
getTabColorProvider
public JideTabbedPane.ColorProvider getTabColorProvider()
Gets the tab color provider.- Returns:
- tab color provider.
-
setTabColorProvider
public void setTabColorProvider(JideTabbedPane.ColorProvider tabColorProvider)
Sets the tab color provider.It allows you to set the background color of each tab. The reason to use this way instead ofJTabbedPane.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 isONENOTE_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.- Parameters:
tabColorProvider
- the tab color provider
-
editTabAt
public void editTabAt(int tabIndex)
Starts tab editing. This works only whensetTabEditingAllowed(boolean)
is set to true.- Parameters:
tabIndex
- the index of the tab
-
isTabEditing
public boolean isTabEditing()
Checks if tab is in editing mode.- Returns:
- true if editing.
-
stopTabEditing
public void stopTabEditing()
-
cancelTabEditing
public void cancelTabEditing()
-
getEditingTabIndex
public int getEditingTabIndex()
-
createFocusChangeListener
protected java.beans.PropertyChangeListener createFocusChangeListener()
-
repaintTabAreaAndContentBorder
public void repaintTabAreaAndContentBorder()
Repaints the tab area and the content border if any. This is mainly for the focus border in JideTabbedPane Office2003 and Eclipse3x style.
-
repaintContentBorder
protected void repaintContentBorder(int x, int y, int width, int height)
Calls repaint on the specified rectangular area.- Parameters:
x
- the x coordinatey
- the y coordinatewidth
- the widthheight
- the height
-
addNotify
public void addNotify()
- Overrides:
addNotify
in classjavax.swing.JComponent
-
removeNotify
public void removeNotify()
- Overrides:
removeNotify
in classjavax.swing.JComponent
-
getTabListCellRenderer
public javax.swing.ListCellRenderer getTabListCellRenderer()
Gets the tab list cell renderer. This renderer is used to render the list in the popup when tab list button is pressed.- Returns:
- the tab list cell renderer.
- See Also:
setTabListCellRenderer(javax.swing.ListCellRenderer)
-
setTabListCellRenderer
public void setTabListCellRenderer(javax.swing.ListCellRenderer tabListCellRenderer)
Sets the tab list cell renderer. This renderer is used to render the list in the popup when tab list button is pressed. In this list cell renderer, the value will always be the JideTabbedPane. The index will tell you which tab it is. See below for the default cell renderer we used.
You can create your own cell renderer either extendingpublic 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); } } }
JideTabbedPane.TabListCellRenderer
or starting from scratch.- Parameters:
tabListCellRenderer
- the cell renderer
-
hasFocusComponent
public boolean hasFocusComponent()
Checks if the JideTabbedPane has the focus component. If true, in some styles such as Office2003 style, we will paint a background on the insets to indicate the tabbed pane has focus.- Returns:
- true if the JideTabbedPane has the focus component. Otherwise false.
-
getContentBorderInsets
public java.awt.Insets getContentBorderInsets()
-
setContentBorderInsets
public void setContentBorderInsets(java.awt.Insets contentBorderInsets)
Sets the content border insets. It's the inserts around the JideTabbedPane's content. The direction of the insets is when the tabs are on top. We will rotate it automatically when the tabs are on other directions.- Parameters:
contentBorderInsets
- the content border insets
-
getTabAreaInsets
public java.awt.Insets getTabAreaInsets()
-
setTabAreaInsets
public void setTabAreaInsets(java.awt.Insets tabAreaInsets)
Sets the tab area insets. It's the inserts around the tabs. The direction of the insets is when the tabs are on top. We will rotate it automatically when the tabs are on other directions.- Parameters:
tabAreaInsets
- the content border insets
-
getTabInsets
public java.awt.Insets getTabInsets()
-
setTabInsets
public void setTabInsets(java.awt.Insets tabInsets)
Sets the tab insets. It's the inserts around the JideTabbedPane's tab. The direction of the insets is when the tabs are on top. We will rotate it automatically when the tabs are on other directions.- Parameters:
tabInsets
- the content border insets
-
isDragOverDisabled
public boolean isDragOverDisabled()
Checks the dragOverDisabled property. By default it is false.- Returns:
- true or false.
- See Also:
setDragOverDisabled(boolean)
-
setDragOverDisabled
public void setDragOverDisabled(boolean dragOverDisabled)
Sets the dragOverDisabled property. Default is false. It means when you drag something over an unselected tab, the tab will be selected automatically. You may want to set it to true if you want to add your own drop listener to the tabs.- Parameters:
dragOverDisabled
- the flag indicating if drag over is disabled
-
scrollSelectedTabToVisible
public void scrollSelectedTabToVisible(boolean scrollLeft)
Scroll the selected tab visible in case the tab is outside of the viewport.- Parameters:
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.
-
addTabEditingListener
public void addTabEditingListener(TabEditingListener l)
Adds aTabEditingListener
to this tabbedpane.- Parameters:
l
- theTabEditingListener
to add- See Also:
fireTabEditing(int, int, java.lang.String, java.lang.String)
,removeTabEditingListener(TabEditingListener)
,getTabEditingListeners()
-
removeTabEditingListener
public void removeTabEditingListener(TabEditingListener l)
Removes aTabEditingListener
from this tabbedpane.- Parameters:
l
- theTabEditingListener
to remove- See Also:
fireTabEditing(int, int, java.lang.String, java.lang.String)
,addTabEditingListener(com.jidesoft.swing.TabEditingListener)
-
getTabEditingListeners
public TabEditingListener[] getTabEditingListeners()
Returns an array of all theTabEditingListener
s added to thisJTabbedPane
withaddTabEditingListener
.- Returns:
- all of the
TabEditingListener
s added or an empty array if no listeners have been added
-
fireTabEditing
protected void fireTabEditing(int id, int index, java.lang.String oldTitle, java.lang.String newTitle)
-
getIconForTab
public javax.swing.Icon getIconForTab(int tabIndex)
Gets the icon for the tab after looking at the UIDefault "JideTabbedPane.showIconOnTab" andisShowIconsOnTab()
. Note that getIconAt method will always return the tab even though the icon is not displayed because the two flags above.- Parameters:
tabIndex
- the tab index.- Returns:
- the icon for the tab at the specified index.
-
isScrollSelectedTabOnWheel
public boolean isScrollSelectedTabOnWheel()
Checks if the selected tab will be changed on mouse wheel event.- Returns:
- true or false.
-
setScrollSelectedTabOnWheel
public void setScrollSelectedTabOnWheel(boolean scrollSelectedTabOnWheel)
If true, the selected tab will be changed on mouse wheel. It is false by default.- Parameters:
scrollSelectedTabOnWheel
- the flag
-
isCloseTabOnMouseMiddleButton
public boolean isCloseTabOnMouseMiddleButton()
Get the flag if clicking middle mouse button can close the tab. It is false by default.- Returns:
- the flag.
-
setCloseTabOnMouseMiddleButton
public void setCloseTabOnMouseMiddleButton(boolean closeTabOnMouseMiddleButton)
Set the flag if clicking middle mouse button can close the tab. It is false by default.- Parameters:
closeTabOnMouseMiddleButton
- the flag
-
getTabAlignment
public int getTabAlignment()
Returns the alignment of the tabs for this tabbed pane.- Returns:
- the alignment of the tabs for this tabbed pane.
- See Also:
setTabAlignment(int)
-
setTabAlignment
public void setTabAlignment(int tabAlignment)
Sets the tab alignment for the tabs of a tabbed pane. Currently it only supports top and bottom tab placement. Possible values are:JideTabbedPane.LEADING
JideTabbedPane.CENTER
JideTabbedPane.LEADING
.- Parameters:
tabAlignment
- the alignment for the tabs relative to the content- Throws:
java.lang.IllegalArgumentException
- if tab alignment value isn't one of the above valid values
-
getResourceString
public java.lang.String getResourceString(java.lang.String key)
Gets the resource string used in JideTabbedPane. Subclass can override it to provide their own strings.- Parameters:
key
- the resource key- Returns:
- the localized string.
-
createTabListPopup
protected JidePopup createTabListPopup()
Creates tab list popup.- Returns:
- the tab list popup instance.
- Since:
- 3.2.2
-
isTabListPopupVisible
public boolean isTabListPopupVisible()
Checks if the tab list popup is visible.- Returns:
- true if the tab list popup is visible. Otherwise false.
- Since:
- 3.2.2
-
hideTabListPopup
public void hideTabListPopup()
Hides the tab list popup if it's visible.- Since:
- 3.2.2
-
showTabListPopup
public void showTabListPopup(javax.swing.JButton listButton)
Shows the tab list popup by clicking on the list button.- Parameters:
listButton
- the list button being clicked.- Since:
- 3.2.2
-
calculateTabListPopupPosition
protected java.awt.Point calculateTabListPopupPosition(javax.swing.JButton listButton)
Calculates the position where the tab list popup is to be displayed based on the list button being clicked.- Parameters:
listButton
- the list button being clicked.- Returns:
- the point.
- Since:
- 3.2.2
-
createTabList
protected javax.swing.JList createTabList(java.awt.Insets insets)
Creates the tab list.- Parameters:
insets
- the insets of its parent container which helps determine the visible row count of the list.- Returns:
- the created list instance.
- Since:
- 3.2.2
-
createNoFocusButton
public JideTabbedPane.NoFocusButton createNoFocusButton(int type)
Creates no focus buttons for JideTabbedPane.- Parameters:
type
- the button type, it could beBUTTON_LIST
,BUTTON_CLOSE
,BUTTON_EAST
,BUTTON_WEST
,BUTTON_NORTH
orBUTTON_SOUTH
- Returns:
- the button instance.
-
removeAll
public void removeAll()
- Overrides:
removeAll
in classjavax.swing.JTabbedPane
-
-