Package swingtree
Class TabDelegate
A
Not only does this delegate provide access to the
JTabbedPane
delegate providing useful context information to various Action
listeners
used by UIForTabbedPane.onTabMouseClick(Action)
, UIForTabbedPane.onTabMousePress(Action)
and
UIForTabbedPane.onTabMouseRelease(Action)
, for example.
Not only does this delegate provide access to the
JTabbedPane
component itself, but also to the
MouseEvent
that triggered the event and the index of the clicked tab.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal int
Exposes the index of the currently selected tab.final JComponent
Use this to access the tab component of the delegated tab.final int
tabIndex()
Exposes the index of the currently delegated tab, in the form of an integer starting at 0.final boolean
Reports whether the clicked tab is the currently selected tab, which is determined by comparing the index of the clicked tab with the index of the currently selected tab.Methods inherited from class swingtree.ComponentMouseEventDelegate
clickCount, isAltDown, isCtrlDown, isLeftMouseButton, isMetaDown, isMiddleMouseButton, isRightMouseButton, isShiftDown, mousePosition, mousePositionOnScreen, mouseX, mouseXOnScreen, mouseY, mouseYOnScreen
Methods inherited from class swingtree.ComponentDelegate
forComponent, forSiblinghood, forSiblinghoodOfType, forSiblings, forSiblingsOfType, getComponent, getEvent, getSiblinghood, getSiblinghoodOfType, getSiblings, getSiblingsOfType
Methods inherited from class swingtree.AbstractDelegate
_component, _isUndefinedColor, _isUndefinedFont, _siblingsSource, animateFor, animateFor, animateFor, animateFor, animateStyleFor, animateStyleFor, find, find, find, findAll, findAllByGroup, findAllByGroup, findAllByGroup, findAllByGroup, get, getBackground, getBorder, getBounds, getCursor, getFont, getForeground, getHeight, getLocation, getMaxSize, getMinSize, getParent, getPrefSize, getScale, getSize, getTooltip, getWidth, getX, getY, isEnabled, isOpaque, isVisible, paint, paint, paint, paint, parentDelegate, scale, scale, scale, scale, setBackground, setBackgroundColor, setBackgroundColor, setBackgroundColor, setBackgroundColor, setBorder, setBounds, setBounds, setBounds, setCursor, setCursor, setEnabled, setFont, setForeground, setForegroundColor, setForegroundColor, setForegroundColor, setForegroundColor, setHeight, setMaxHeight, setMaxSize, setMaxSize, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinSize, setMinSize, setMinWidth, setOpaque, setPrefHeight, setPrefSize, setPrefSize, setPrefSize, setPrefWidth, setSize, setSize, setSize, setTooltip, setVisible, setWidth, shapeOf, style
-
Constructor Details
-
TabDelegate
-
-
Method Details
-
selectedTabIndex
public final int selectedTabIndex()Exposes the index of the currently selected tab.- Returns:
- The index of the clicked tab.
-
tabIndex
public final int tabIndex()Exposes the index of the currently delegated tab, in the form of an integer starting at 0. It represents the position of the tab in the array of all existing tabs within the underlyingJTabbedPane
.- Returns:
- The index of the clicked tab.
-
tabIsSelected
public final boolean tabIsSelected()Reports whether the clicked tab is the currently selected tab, which is determined by comparing the index of the clicked tab with the index of the currently selected tab.- Returns:
- True if the clicked tab is the currently selected tab.
-
tabComponent
Use this to access the tab component of the delegated tab.- Returns:
- The component of the clicked tab.
-