Package com.intellij.ui.tabs.impl
Class JBTabsImpl
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
com.intellij.ui.tabs.impl.JBTabsImpl
- All Implemented Interfaces:
JBTabs,JBTabsPresentation,ImageObserver,MenuContainer,PropertyChangeListener,Serializable,EventListener,Accessible,PopupMenuListener
- Direct Known Subclasses:
JBEditorTabs
public class JBTabsImpl
extends JComponent
implements JBTabs, PropertyChangeListener, PopupMenuListener, JBTabsPresentation, Accessible
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classCustom implementation of Accessible interface.protected static classstatic classNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategyNested classes/interfaces inherited from interface com.intellij.ui.tabs.JBTabs
JBTabs.SelectionChangeHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final Colorprotected TabInfobooleanbooleanfinal Map<TabInfo, JBTabsImpl.Toolbar> protected booleanstatic final StringFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddListener(TabsListener listener) voidaddTabMouseListener(MouseListener listener) addTabSilently(TabInfo info, int index) booleanprotected JBTabsImpl.ShapeInfoprotected SingleRowLayoutprotected TabLabelcreateTabLabel(TabInfo info) protected JBTabsImpl.ToolbarcreateToolbarComponent(TabInfo tabInfo) voiddoLayout()protected voiddoPaintBackground(Graphics2D g2d, Rectangle clip) protected voiddoPaintInactive(Graphics2D g2d, boolean leftGhostExists, TabLabel label, Rectangle effectiveBounds, boolean rightGhostExists, int row, int column) findInfo(MouseEvent event) protected Colorprotected Colorintprotected GraphicsgetComponentGraphics(Graphics graphics) static ImagegetComponentImage(TabInfo info) intintprotected Colorprotected ColorintintgetIndexOf(TabInfo tabInfo) intprotected LayoutPassInfoprotected JBTabsPositionprotected TabLabelstatic intgetTabAt(int tabIndex) intgetTabLabel(TabInfo info) getTabs()intbooleanbooleanbooleanisDropTarget(TabInfo info) booleanbooleanbooleanbooleanstatic booleanisSelectionClick(MouseEvent e, boolean canBeQuick) booleanbooleanbooleanbooleanprotected booleanbooleanbooleanlayout(JComponent c, int x, int y, int width, int height) layout(JComponent c, Rectangle bounds) layoutComp(int componentX, int componentY, JComponent comp, int deltaWidth, int deltaHeight) voidlayoutComp(SingleRowPassInfo data, int deltaX, int deltaY, int deltaWidth, int deltaHeight) voidprotected voidpaintBorder(Graphics2D g2d, JBTabsImpl.ShapeInfo shape, Color borderColor) protected voidprotected voidprotected voidprotected voidpaintLastGhost(Graphics2D g2d) protected voidvoidvoidvoidvoidvoidvoidvoidvoidbooleanvoidresetLayout(boolean resetLabels) static voidprotected voidsetActiveTabFillIn(Color color) setAlwaysPaintSelectedTab(boolean paintSelected) protected voidsetDropInfoIndex(int dropInfoIndex) voidsetFirstTabOffset(int firstTabOffset) setFocusCycle(boolean root) voidsetFocused(boolean focused) setGhostsAlwaysVisible(boolean visible) voidsetHideTabs(boolean hideTabs) setInnerInsets(Insets innerInsets) voidsetPaintBlocked(boolean blocked, boolean takeSnapshot) setPaintBorder(int top, int left, int right, int bottom) setPaintFocus(boolean paintFocus) setProvideSwitchTargets(boolean provide) setRequestFocusOnLastFocusedComponent(boolean requestFocusOnLastFocusedComponent) setSideComponentOnTabs(boolean onTabs) setSideComponentVertical(boolean vertical) setSingleRow(boolean singleRow) voidsetSizeBySelected(boolean value) setStealthTabMode(boolean stealthTabMode) setTabDraggingEnabled(boolean enabled) setTabLabelActionsAutoHide(boolean autoHide) setTabSidePaintBorder(int size) setTabsPosition(JBTabsPosition position) setToDrawBorderIfTabsHidden(boolean toDrawBorderIfTabsHidden) protected voidsetUI(ComponentUI newUI) setUiDecorator(UiDecorator decorator) voidvoidsortTabs(Comparator<TabInfo> comparator) booleaninttabMSize()toString()voidupdateTabActions(boolean validateNow) voidupdateUI()booleanbooleanMethods 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, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUI, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, 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, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateMethods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeMethods 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, 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, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
DEFAULT_MAX_TAB_WIDTH
public static final int DEFAULT_MAX_TAB_WIDTH -
MAC_AQUA_BG_COLOR
-
myInfo2Label
-
myInfo2Toolbar
-
myHeaderFitSize
-
myHorizontalSide
public boolean myHorizontalSide -
myForcedRelayout
public boolean myForcedRelayout -
STRETCHED_BY_WIDTH
- See Also:
-
myDropInfo
-
myShowDropLocation
protected boolean myShowDropLocation
-
-
Constructor Details
-
JBTabsImpl
public JBTabsImpl()
-
-
Method Details
-
createSingleRowLayout
-
getActiveTabUnderlineHeight
public int getActiveTabUnderlineHeight() -
isEditorTabs
public boolean isEditorTabs() -
supportsCompression
public boolean supportsCompression() -
getComponentImage
-
resetTabsCache
protected void resetTabsCache() -
addNotify
public void addNotify()- Overrides:
addNotifyin classJComponent
-
removeNotify
public void removeNotify()- Overrides:
removeNotifyin classJComponent
-
processMouseEvent
- Overrides:
processMouseEventin classJComponent
-
layoutComp
public void layoutComp(SingleRowPassInfo data, int deltaX, int deltaY, int deltaWidth, int deltaHeight) -
isDropTarget
-
setDropInfoIndex
protected void setDropInfoIndex(int dropInfoIndex) -
getFirstTabOffset
public int getFirstTabOffset() -
setFirstTabOffset
public void setFirstTabOffset(int firstTabOffset) -
tabMSize
public int tabMSize() -
updateTabActions
public void updateTabActions(boolean validateNow) -
canShowMorePopup
public boolean canShowMorePopup() -
showMorePopup
-
requestFocus
public void requestFocus()- Specified by:
requestFocusin interfaceJBTabs- Overrides:
requestFocusin classJComponent
-
requestFocusInWindow
public boolean requestFocusInWindow()- Overrides:
requestFocusInWindowin classJComponent
-
addTab
-
addTabSilently
-
createTabLabel
-
addTab
-
getTabLabel
-
select
-
propertyChange
- Specified by:
propertyChangein interfacePropertyChangeListener
-
getSelectedInfo
- Specified by:
getSelectedInfoin interfaceJBTabs
-
isAlphabeticalMode
public boolean isAlphabeticalMode() -
createToolbarComponent
-
getTabAt
-
getTabs
-
getTargetInfo
- Specified by:
getTargetInfoin interfaceJBTabs
-
popupMenuWillBecomeVisible
- Specified by:
popupMenuWillBecomeVisiblein interfacePopupMenuListener
-
popupMenuWillBecomeInvisible
- Specified by:
popupMenuWillBecomeInvisiblein interfacePopupMenuListener
-
popupMenuCanceled
- Specified by:
popupMenuCanceledin interfacePopupMenuListener
-
setPaintBlocked
public void setPaintBlocked(boolean blocked, boolean takeSnapshot) - Specified by:
setPaintBlockedin interfaceJBTabsPresentation
-
setToDrawBorderIfTabsHidden
- Specified by:
setToDrawBorderIfTabsHiddenin interfaceJBTabsPresentation
-
getJBTabs
- Specified by:
getJBTabsin interfaceJBTabsPresentation
-
doLayout
public void doLayout() -
layoutComp
public Rectangle layoutComp(int componentX, int componentY, JComponent comp, int deltaWidth, int deltaHeight) -
setInnerInsets
- Specified by:
setInnerInsetsin interfaceJBTabsPresentation
-
getLayoutInsets
-
getToolbarInset
public int getToolbarInset() -
resetLayout
public void resetLayout(boolean resetLabels) -
getGhostTabLength
public int getGhostTabLength() -
getPosition
-
doPaintBackground
-
paintComponent
- Overrides:
paintComponentin classJComponent
-
getActiveTabColor
-
paintSelectionAndBorder
-
getFocusedTopFillColor
-
getFocusedBottomFillColor
-
computeSelectedLabelShape
-
getSelectedLabel
-
paintFirstGhost
-
paintLastGhost
-
getVisibleInfos
-
getLastLayoutPass
-
getBackground
- Overrides:
getBackgroundin classComponent
-
doPaintInactive
protected void doPaintInactive(Graphics2D g2d, boolean leftGhostExists, TabLabel label, Rectangle effectiveBounds, boolean rightGhostExists, int row, int column) -
getSelectionTabVShift
public static int getSelectionTabVShift() -
paintBorder
-
isStealthModeEffective
protected boolean isStealthModeEffective() -
getComponentGraphics
- Overrides:
getComponentGraphicsin classJComponent
-
paint
- Overrides:
paintin classJComponent
-
paintChildren
- Overrides:
paintChildrenin classJComponent
-
getMinimumSize
- Overrides:
getMinimumSizein classJComponent
-
getPreferredSize
- Overrides:
getPreferredSizein classJComponent
-
getTabCount
public int getTabCount()- Specified by:
getTabCountin interfaceJBTabs
-
getPresentation
- Specified by:
getPresentationin interfaceJBTabs
-
removeTab
-
removeTab
@NotNull public ActionCallback removeTab(TabInfo info, @Nullable TabInfo forcedSelectionTransfer, boolean transferFocus) -
findInfo
-
findInfo
-
findInfo
-
removeAllTabs
public void removeAllTabs()- Specified by:
removeAllTabsin interfaceJBTabs
-
addImpl
-
getTabsBorder
-
addTabMouseListener
- Specified by:
addTabMouseListenerin interfaceJBTabs
-
getComponent
- Specified by:
getComponentin interfaceJBTabs
-
addListener
- Specified by:
addListenerin interfaceJBTabs
-
setSelectionChangeHandler
- Specified by:
setSelectionChangeHandlerin interfaceJBTabs
-
setFocused
public void setFocused(boolean focused) -
getIndexOf
- Specified by:
getIndexOfin interfaceJBTabs
-
isHideTabs
public boolean isHideTabs()- Specified by:
isHideTabsin interfaceJBTabsPresentation
-
setHideTabs
public void setHideTabs(boolean hideTabs) - Specified by:
setHideTabsin interfaceJBTabsPresentation
-
setPaintBorder
- Specified by:
setPaintBorderin interfaceJBTabsPresentation
-
setTabSidePaintBorder
- Specified by:
setTabSidePaintBorderin interfaceJBTabsPresentation
-
setActiveTabFillIn
- Specified by:
setActiveTabFillInin interfaceJBTabsPresentation
-
setTabLabelActionsAutoHide
- Specified by:
setTabLabelActionsAutoHidein interfaceJBTabsPresentation
-
getActiveTabFillIn
-
setFocusCycle
- Specified by:
setFocusCyclein interfaceJBTabsPresentation
-
setPaintFocus
- Specified by:
setPaintFocusin interfaceJBTabsPresentation
-
setAlwaysPaintSelectedTab
- Specified by:
setAlwaysPaintSelectedTabin interfaceJBTabsPresentation
-
setStealthTabMode
- Specified by:
setStealthTabModein interfaceJBTabsPresentation
-
isStealthTabMode
public boolean isStealthTabMode() -
setSideComponentVertical
- Specified by:
setSideComponentVerticalin interfaceJBTabsPresentation
-
setSideComponentOnTabs
- Specified by:
setSideComponentOnTabsin interfaceJBTabsPresentation
-
setSingleRow
- Specified by:
setSingleRowin interfaceJBTabsPresentation
-
setGhostsAlwaysVisible
- Specified by:
setGhostsAlwaysVisiblein interfaceJBTabsPresentation
-
isSizeBySelected
public boolean isSizeBySelected() -
setSizeBySelected
public void setSizeBySelected(boolean value) -
useSmallLabels
public boolean useSmallLabels() -
useBoldLabels
public boolean useBoldLabels() -
hasUnderline
public boolean hasUnderline() -
isGhostsAlwaysVisible
public boolean isGhostsAlwaysVisible() -
isSingleRow
public boolean isSingleRow()- Specified by:
isSingleRowin interfaceJBTabsPresentation
-
isSideComponentVertical
public boolean isSideComponentVertical() -
isSideComponentOnTabs
public boolean isSideComponentOnTabs() -
getEffectiveLayout
-
setUiDecorator
- Specified by:
setUiDecoratorin interfaceJBTabsPresentation
-
setUI
- Overrides:
setUIin classJComponent
-
updateUI
public void updateUI()- Overrides:
updateUIin classJComponent
-
sortTabs
-
setRequestFocusOnLastFocusedComponent
public JBTabsPresentation setRequestFocusOnLastFocusedComponent(boolean requestFocusOnLastFocusedComponent) - Specified by:
setRequestFocusOnLastFocusedComponentin interfaceJBTabsPresentation
-
isSelectionClick
-
layout
-
layout
-
resetLayout
-
setTabsPosition
- Specified by:
setTabsPositionin interfaceJBTabsPresentation
-
getTabsPosition
- Specified by:
getTabsPositionin interfaceJBTabsPresentation
-
setTabDraggingEnabled
- Specified by:
setTabDraggingEnabledin interfaceJBTabsPresentation
-
isTabDraggingEnabled
public boolean isTabDraggingEnabled() -
setProvideSwitchTargets
- Specified by:
setProvideSwitchTargetsin interfaceJBTabsPresentation
-
getDropInfoIndex
public int getDropInfoIndex() -
isEmptyVisible
public boolean isEmptyVisible() -
getInterTabSpaceLength
public int getInterTabSpaceLength() -
toString
-
getAccessibleContext
- Specified by:
getAccessibleContextin interfaceAccessible- Overrides:
getAccessibleContextin classComponent
-