Class EnhancedTabbedPane

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, SwingConstants
Direct Known Subclasses:
EntityViewPane

public class EnhancedTabbedPane extends JTabbedPane
See Also:
  • Constructor Details

    • EnhancedTabbedPane

      public EnhancedTabbedPane()
    • EnhancedTabbedPane

      public EnhancedTabbedPane(boolean tabDetachingEnabled, boolean tabReorderingEnabled)
    • EnhancedTabbedPane

      public EnhancedTabbedPane(List<JButton> actionButtons, boolean tabDetachingEnabled, boolean tabReorderingEnabled)
      Creates a new EnhancedTabbedPane with closable, draggable tabs and action buttons.
      Parameters:
      actionButtons - Action Buttons
  • Method Details

    • setTabDetachingEnabled

      @Deprecated(since="0.51.0", forRemoval=true) public void setTabDetachingEnabled(boolean enabled)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets whether tabs can be detached from the pane
      Parameters:
      enabled - true to enable tab detaching, false to disable
    • setTabReorderingEnabled

      @Deprecated(since="0.51.0", forRemoval=true) public void setTabReorderingEnabled(boolean enabled)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets whether tabs can be reordered by dragging
      Parameters:
      enabled - true to enable tab reordering, false to disable
    • setActionButtonsAlignAfterTabs

      @Deprecated(since="0.51.0", forRemoval=true) public void setActionButtonsAlignAfterTabs(boolean alignAfterTabs)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets whether action buttons should be aligned after the tabs or on the right side of the window
      Parameters:
      alignAfterTabs - true to align after tabs, false to align on the right side
    • setMinimumTabsCount

      @Deprecated(since="0.51.0", forRemoval=true) public void setMinimumTabsCount(int minimumTabsCount)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets the minimum number of tabs that can't be detached
      Parameters:
      minimumTabsCount - The minimum number of tabs that can't be detached
    • setDockGroupId

      public void setDockGroupId(String dockGroupId)
      Sets the dock group ID for this tabbed pane. This ID is used to group tabbed panels that can share tabs between each other.
      Parameters:
      dockGroupId - The ID to set for this tabbed pane (used for cross-pane docking)
    • getDockGroupId

      @Deprecated(since="0.51.0", forRemoval=true) public String getDockGroupId()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the dock group ID for this tabbed pane
      Returns:
      The ID of the dock group for this tabbed pane, or null if not set
    • setDetachedWindowFactory

      public void setDetachedWindowFactory(EnhancedTabbedPane.DetachedWindowFactory factory)
      Sets a custom factory for creating detached tab windows
      Parameters:
      factory - The factory to call when creating a detached window
    • getDetachedWindowFactory

      @Deprecated(since="0.51.0", forRemoval=true) public EnhancedTabbedPane.DetachedWindowFactory getDetachedWindowFactory()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets the current detached window factory
      Returns:
      The current detached window factory or null if none is set
    • setTabDetachmentHandler

      @Deprecated(since="0.51.0", forRemoval=true) public void setTabDetachmentHandler(EnhancedTabbedPane.TabDetachmentHandler handler)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets a custom handler for tab detachment operations
      Parameters:
      handler - The handler to call when a tab is being detached
    • removeActionButtons

      @Deprecated(since="0.51.0", forRemoval=true) public void removeActionButtons()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Removes all action buttons from the tabbed pane
    • setActionButtons

      @Deprecated(since="0.51.0", forRemoval=true) public void setActionButtons(JButton... actionButtons)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Set buttons to the action buttons panel
    • addActionButton

      public void addActionButton(JButton button)
      Adds a button to the action buttons panel
    • removeActionButton

      @Deprecated(since="0.51.0", forRemoval=true) public void removeActionButton(JButton button)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Removes a button from the action buttons panel
    • getTabOrder

      public List<String> getTabOrder()
      Gets the current order of tabs by their titles.
      Returns:
      A list of tab titles in their current display order.
    • setTabOrder

      public void setTabOrder(List<String> desiredOrder)
      Sets the order of tabs based on a list of tab titles. Tabs in desiredOrder that are currently present will be reordered. Tabs present in the pane but not in desiredOrder will be appended to the end, maintaining their relative order among themselves. Tabs in desiredOrder but not currently present in the pane are ignored.
      Parameters:
      desiredOrder - A list of tab titles representing the desired order.
    • addTabStateListener

      public void addTabStateListener(EnhancedTabbedPane.TabStateListener listener)
      Adds a listener that will be notified of tab state changes
      Parameters:
      listener - The listener to add
    • removeTabStateListener

      @Deprecated(since="0.51.0", forRemoval=true) public boolean removeTabStateListener(EnhancedTabbedPane.TabStateListener listener)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Removes a previously added tab state listener
      Parameters:
      listener - The listener to remove
      Returns:
      true if the listener was found and removed
    • fireTabMoved

      protected void fireTabMoved(int oldIndex, int tabIndex, Component component)
    • fireTabDetaching

      protected boolean fireTabDetaching(int tabIndex, Component component)
    • fireTabDetached

      protected void fireTabDetached(Window window, DetachedTabInfo tabInfo)
    • fireTabReattaching

      protected boolean fireTabReattaching(DetachedTabInfo tabInfo)
    • fireTabReattached

      protected void fireTabReattached(int tabIndex, Component component)
    • fireTabRemoved

      protected void fireTabRemoved(int tabIndex, Component component)
    • addHoverEffect

      protected void addHoverEffect(JButton button)
      Adds hover effect to a button
      Parameters:
      button - The button to enhance with hover effect
    • hasDetachedTabs

      public boolean hasDetachedTabs()
      Checks if there are any detached tabs
      Returns:
      true if there are detached tabs, false otherwise
    • containsTab

      public boolean containsTab(Component component)
      Checks if a component is currently hosted by this pane, including detached tab windows.
      Parameters:
      component - The component to find
      Returns:
      true if the component is attached or detached from this pane
    • removeTab

      public boolean removeTab(Component component)
      Removes a component from this pane, closing its floating window if the tab is currently detached.
      Parameters:
      component - The component to remove
      Returns:
      true if the component was found and removed
    • setDetachedTabTitle

      @Deprecated(since="0.51.0", forRemoval=true) public boolean setDetachedTabTitle(JFrame frame, String title)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Updates the title of a detached tab window containing the given editor
      Parameters:
      frame - The editor to find in detached windows
      title - The new title to set
      Returns:
      true if a detached window was found and updated, false otherwise
    • setDetachedTabsPrefixTitle

      public void setDetachedTabsPrefixTitle(String prefix)
      Sets the title prefix for all the detached tab windows
      Parameters:
      prefix - The prefix to set
    • setDetachedTabPrefixTitle

      public void setDetachedTabPrefixTitle(DetachedTabInfo detachedTab, String prefix)
      Sets the title prefix for a detached tab window
      Parameters:
      detachedTab - The detached tab info
      prefix - The prefix to set
    • addCloseableTab

      public int addCloseableTab(String title, Icon icon, Component component)
    • addCloseableTab

      public int addCloseableTab(String title, Icon icon, Component component, int tabIndex)
      Adds a closeable tab to this tabbed pane
      Parameters:
      title - The title of the tab
      icon - the Icon for the tab.
      component - The component to display in the tab
      tabIndex - The index at which to add the tab
      Returns:
      The index of the newly added tab
    • getTitleAt

      public String getTitleAt(int index)
      Returns the tab title at index.
      Overrides:
      getTitleAt in class JTabbedPane
      Parameters:
      index - the index of the item being queried
      Returns:
      the title at index
      See Also:
    • setTitleAt

      public void setTitleAt(int index, String title)
      Sets the title at index to title which can be null. The title is not shown if a tab component for this tab was specified.
      Overrides:
      setTitleAt in class JTabbedPane
      Parameters:
      index - the tab index where the title should be set
      title - the title to be displayed in the tab
      See Also:
    • detachTab

      @Deprecated(since="0.51.0", forRemoval=true) public void detachTab(CloseableTab tab, Point location)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Detaches a tab from the pane and creates a floating window
      Parameters:
      tab - An CloseableTab instance representing the tab to detach
      location - The screen location where to position the new window
    • detachTab

      public void detachTab(int tabIndex, Point location)
      Detaches a tab from the pane into a floating window
      Parameters:
      tabIndex - The index of the tab to detach
      location - The screen location for the detached window
    • isTabSelected

      @Deprecated(since="0.51.0", forRemoval=true) public boolean isTabSelected(Component component)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Checks if the specified component is the currently selected tab
      Parameters:
      component - The component to check
    • reattachAllTabs

      public void reattachAllTabs()
      Programmatically reattaches all detached tabs
    • paintComponent

      protected void paintComponent(Graphics g)
      Overrides:
      paintComponent in class JComponent
    • updateUI

      public void updateUI()
      Overrides:
      updateUI in class JTabbedPane
    • insertTab

      public void insertTab(String title, Icon icon, Component component, String tip, int index)
      Override insertTab to ensure button positioning is updated
      Overrides:
      insertTab in class JTabbedPane
    • remove

      public void remove(int index)
      Override remove to ensure button positioning is updated
      Overrides:
      remove in class JTabbedPane
    • removeAll

      public void removeAll()
      Overrides:
      removeAll in class JTabbedPane
    • setTabComponentAt

      public void setTabComponentAt(int index, Component component)
      Overrides:
      setTabComponentAt in class JTabbedPane
    • setTabLayoutPolicy

      public void setTabLayoutPolicy(int tabLayoutPolicy)
      Overrides:
      setTabLayoutPolicy in class JTabbedPane
    • addNotify

      public void addNotify()
      Overrides:
      addNotify in class JComponent
    • removeNotify

      public void removeNotify()
      Overrides:
      removeNotify in class JComponent
    • dispose

      public void dispose()