Class JTabbedPane
java.lang.Object
vaadinx.awt.Component
vaadinx.awt.Container
vaadinx.swing.JComponent
vaadinx.swing.JTabbedPane
- All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, SwingConstants, FieldReconciler.Reconcilable
public class JTabbedPane
extends JComponent
implements Accessible, SwingConstants, FieldReconciler.Reconcilable
Emulator for
JTabbedPane. See D_jtabbedpane.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classThe JDK's model listener, re-firing each model change from the pane. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ChangeEventLazily created byfireStateChanged(), as in the JDK.protected ChangeListenerprotected SingleSelectionModelstatic final intprotected intstatic final intFields inherited from class JComponent
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, FILL_CHROME, FILL_DEFAULT, LEFT_ALIGNMENT, listenerList, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTHFields inherited from interface SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST -
Constructor Summary
ConstructorsConstructorDescriptionJTabbedPane(int tabPlacement) JTabbedPane(int tabPlacement, int tabLayoutPolicy) -
Method Summary
Modifier and TypeMethodDescriptionvoidA String constraint is the title and an Icon the icon; anything else is ignored.voidvoidvoidvoidvoidprotected ChangeListenerprotected voidShows the selected tab's component and hides the one shown before, then notifies the listeners, last to first.getBackgroundAt(int index) The tab's own colour, or this pane's background when it has none.getBoundsAt(int index) Alwaysnull: the server has no tab geometry (R_layouts_close_enough).getComponentAt(int index) getDisabledIconAt(int index) The icon set bysetDisabledIconAt(int, Icon).intgetDisplayedMnemonicIndexAt(int tabIndex) getForegroundAt(int index) getIconAt(int index) intgetMnemonicAt(int tabIndex) getModel()intgetTabComponentAt(int index) intintintintOne run while there are tabs: the browser scrolls the tab strip rather than wrapping it.getTitleAt(int index) getToolTipTextAt(int index) getUI()intindexAtLocation(int x, int y) Always-1: the server has no tab geometry (R_layouts_close_enough).intindexOfComponent(Component component) nullfinds the first tab without a content component.intindexOfTab(String title) nullfinds an empty title.intindexOfTab(Icon icon) intindexOfTabComponent(Component tabComponent) voidbooleanisEnabledAt(int index) protected Stringfinal voidD_field_write_reconcile repair hook — seeJSlider.reconcileFields().voidremove(int index) Removes the tab atindex, not the child — they differ, as in the JDK.voidvoidDeselects first, so it fires once, then removes the tabs last to first.voidvoidremoveTabAt(int index) voidsetBackgroundAt(int index, Color background) Stores the tab's colour and fires nothing, as the JDK's repaints and fires nothing;nullclears it.voidsetComponentAt(int index, Component component) Replaces the tab's content, keeping the selection.voidsetDisabledIconAt(int index, Icon disabledIcon) voidsetDisplayedMnemonicIndexAt(int tabIndex, int mnemonicIndex) Throws the JDK'sIllegalArgumentExceptionfor an index outside the title.voidsetEnabledAt(int index, boolean enabled) voidsetForegroundAt(int index, Color foreground) voidvoidsetMnemonicAt(int tabIndex, int mnemonic) Fires"displayedMnemonicIndexAt"when the underlined character moves, then"mnemonicAt", both with(null, null)— the JDK's literal argument pair.voidsetModel(SingleSelectionModel model) voidvoidsetSelectedIndex(int index) voidsetTabComponentAt(int index, Component component) Custom tab header, not a child inContainer.components.voidsetTabLayoutPolicy(int tabLayoutPolicy) voidsetTabPlacement(int tabPlacement) voidsetTitleAt(int index, String title) Fires("indexForTitle", -1, index), guarded — as the JDK guards it — onoldTitle != titleby reference, notequals.voidsetToolTipTextAt(int index, String toolTipText) voidsetUI(TabbedPaneUI ui) toString()voidupdateUI()Methods inherited from class JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, 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, 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, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, 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, updateMethods inherited from class Container
addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, addSlotChild, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, fireHierarchyEvent, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, peerContentElement, preferredSize, printComponents, processContainerEvent, processEvent, removeContainerListener, removeSlotChild, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeMethods inherited from class Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, applyBackgroundToPeer, applyVisibleToPeer, awtListeners, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, defaultFillCssClass, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, fireComponentEvent, 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, isThemeDefault, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, peerIs, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, 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, setMixingCutoutShape, setName, setSize, setSize, show, show, size, suppressMouseBridge, transferFocus, transferFocusBackward, transferFocusUpCycle, withPeer, withPeerOnLiveUI
-
Field Details
-
WRAP_TAB_LAYOUT
public static final int WRAP_TAB_LAYOUT- See Also:
-
SCROLL_TAB_LAYOUT
public static final int SCROLL_TAB_LAYOUT- See Also:
-
tabPlacement
protected int tabPlacement -
model
-
changeListener
-
changeEvent
Lazily created byfireStateChanged(), as in the JDK.
-
-
Constructor Details
-
JTabbedPane
public JTabbedPane() -
JTabbedPane
public JTabbedPane(int tabPlacement) -
JTabbedPane
public JTabbedPane(int tabPlacement, int tabLayoutPolicy)
-
-
Method Details
-
reconcileFields
public final void reconcileFields()D_field_write_reconcile repair hook — seeJSlider.reconcileFields().- Specified by:
reconcileFieldsin interfaceFieldReconciler.Reconcilable
-
createChangeListener
-
addChangeListener
-
removeChangeListener
-
getChangeListeners
-
fireStateChanged
protected void fireStateChanged()Shows the selected tab's component and hides the one shown before, then notifies the listeners, last to first. The JDK also moves the focus into the new component when the old one held it; that is not reproduced. -
getModel
-
setModel
-
getSelectedIndex
public int getSelectedIndex() -
setSelectedIndex
public void setSelectedIndex(int index) -
getSelectedComponent
-
setSelectedComponent
-
getTabPlacement
public int getTabPlacement() -
setTabPlacement
public void setTabPlacement(int tabPlacement) -
getTabLayoutPolicy
public int getTabLayoutPolicy() -
setTabLayoutPolicy
public void setTabLayoutPolicy(int tabLayoutPolicy) -
insertTab
-
addTab
-
addTab
-
addTab
-
add
-
add
-
add
-
add
-
add
-
removeTabAt
public void removeTabAt(int index) -
remove
-
remove
-
removeAll
-
getTabCount
public int getTabCount() -
getTabRunCount
public int getTabRunCount()One run while there are tabs: the browser scrolls the tab strip rather than wrapping it. -
getTitleAt
-
getIconAt
-
getDisabledIconAt
The icon set bysetDisabledIconAt(int, Icon). The JDK's L&F derives a greyed one when none was set; with no L&F, this answersnullinstead. -
getToolTipTextAt
-
getBackgroundAt
The tab's own colour, or this pane's background when it has none. -
getForegroundAt
- See Also:
-
isEnabledAt
public boolean isEnabledAt(int index) -
getComponentAt
-
getMnemonicAt
public int getMnemonicAt(int tabIndex) -
getDisplayedMnemonicIndexAt
public int getDisplayedMnemonicIndexAt(int tabIndex) -
getBoundsAt
Alwaysnull: the server has no tab geometry (R_layouts_close_enough). -
setTitleAt
Fires("indexForTitle", -1, index), guarded — as the JDK guards it — onoldTitle != titleby reference, notequals. So two equal-but-distinct Strings fire and two identical references do not; faithful to the JDK's body, odd as it reads (D_owed_events). -
setIconAt
-
setDisabledIconAt
-
setToolTipTextAt
-
setBackgroundAt
Stores the tab's colour and fires nothing, as the JDK's repaints and fires nothing;nullclears it. The surrogate declines the rendering: a Vaadin TabSheet has no per-tab background (R_decline_effect_only). -
setForegroundAt
- See Also:
-
setEnabledAt
public void setEnabledAt(int index, boolean enabled) -
setComponentAt
Replaces the tab's content, keeping the selection.nullleaves the tab without one, as the JDK allows; the peer shows an empty area. -
setDisplayedMnemonicIndexAt
public void setDisplayedMnemonicIndexAt(int tabIndex, int mnemonicIndex) Throws the JDK'sIllegalArgumentExceptionfor an index outside the title. The surrogate declines the effect: a Vaadin tab has no underlined character. -
setMnemonicAt
public void setMnemonicAt(int tabIndex, int mnemonic) Fires"displayedMnemonicIndexAt"when the underlined character moves, then"mnemonicAt", both with(null, null)— the JDK's literal argument pair.PropertyChangeSupportlets a both-null pair through, so the event always reaches listeners and carries no payload (D_owed_events). The surrogate declines the keyboard effect. -
setTabComponentAt
Custom tab header, not a child inContainer.components. Throws the JDK'sIllegalArgumentExceptionfor a component that is already a tab's content, and moves one that is already another tab's header. -
getTabComponentAt
-
indexOfTab
nullfinds an empty title. Throws NPE past a tab whose title was set tonull, as the JDK does. -
indexOfTab
-
indexOfComponent
nullfinds the first tab without a content component. -
indexOfTabComponent
-
indexAtLocation
public int indexAtLocation(int x, int y) Always-1: the server has no tab geometry (R_layouts_close_enough). -
toString
-
getUIClassID
- Overrides:
getUIClassIDin classJComponent
-
updateUI
public void updateUI()- Overrides:
updateUIin classJComponent
-
getUI
- Overrides:
getUIin classJComponent
-
setUI
-
getAccessibleContext
- Specified by:
getAccessibleContextin interfaceAccessible- Overrides:
getAccessibleContextin classComponent
-
paramString
- Overrides:
paramStringin classJComponent
-