bibliothek.extension.gui.dock.theme.eclipse
Class EclipseStackDockComponent

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by bibliothek.extension.gui.dock.theme.eclipse.EclipseStackDockComponent
All Implemented Interfaces:
TabListener, StackDockComponent, ImageObserver, MenuContainer, Serializable, Accessible
Direct Known Subclasses:
EclipseDockableDisplayer

public class EclipseStackDockComponent
extends JPanel
implements StackDockComponent, TabListener

A StackDockComponent, based on a RexTabbedComponent, which looks like eclipse. Partly copied from DefaultStackDockComponent.

Author:
Janni Kovacs, Benjamin Sigg
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class javax.swing.JComponent
accessibleContext, 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
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
EclipseStackDockComponent(EclipseTheme theme, DockStation station)
           
 
Method Summary
 void addChangeListener(ChangeListener listener)
          Adds a ChangeListener to this component.
 void addTab(String title, Icon icon, Component comp, Dockable dockable)
          Adds a new child at an unspecified location.
 Rectangle getBoundsAt(int index)
          Gets the location and size of the graphical element that allows the user to select the index'th child.
 Component getComponent()
          Gets a Component on which the children of this StackDockComponent will be displayed.
 DockController getController()
          Gets the controller that is currently used.
 Dockable getDockable(int index)
           
 int getSelectedIndex()
          Gets the index of the currently selected component
 int getTabCount()
          Gets the number of children that are added to this StackDockComponent.
 EclipseTabbedComponent getTabs()
          Gets the component onto which this StackDockComponent puts its children.
 void insertTab(String title, Icon icon, Component comp, Dockable dockable, int index)
          Adds a new child at the location index.
 void remove(int index)
          Removes the child at location index.
 void removeAll()
          Removes all children from this component
 void removeChangeListener(ChangeListener listener)
          Removes a ChangeListener which was added earlier.
 void setController(DockController controller)
          Sets the controller for which this component manages its children.
 void setIconAt(int index, Icon newIcon)
          Sets the icon of the child at location index.
 void setSelectedIndex(int index)
          Selects the component at location index.
 void setTitleAt(int index, String newTitle)
          Sets the title of the child at location index.
 void tabChanged(Dockable t)
           
 void tabRemoved(Dockable t)
           
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, 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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, 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, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, 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, remove, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, 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, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, 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, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EclipseStackDockComponent

public EclipseStackDockComponent(EclipseTheme theme,
                                 DockStation station)
Method Detail

getTabs

public EclipseTabbedComponent getTabs()
Gets the component onto which this StackDockComponent puts its children.

Returns:
the tab-component, should not be modified by clients

removeAll

public void removeAll()
Description copied from interface: StackDockComponent
Removes all children from this component

Specified by:
removeAll in interface StackDockComponent
Overrides:
removeAll in class Container

remove

public void remove(int index)
Description copied from interface: StackDockComponent
Removes the child at location index.

Specified by:
remove in interface StackDockComponent
Overrides:
remove in class Container
Parameters:
index - the index of the child

tabRemoved

public void tabRemoved(Dockable t)
Specified by:
tabRemoved in interface TabListener

tabChanged

public void tabChanged(Dockable t)
Specified by:
tabChanged in interface TabListener

addChangeListener

public void addChangeListener(ChangeListener listener)
Description copied from interface: StackDockComponent
Adds a ChangeListener to this component. The listener will be called when the selected component changes.

Specified by:
addChangeListener in interface StackDockComponent
Parameters:
listener - the new listener

removeChangeListener

public void removeChangeListener(ChangeListener listener)
Description copied from interface: StackDockComponent
Removes a ChangeListener which was added earlier.

Specified by:
removeChangeListener in interface StackDockComponent
Parameters:
listener - the listener to remove

getSelectedIndex

public int getSelectedIndex()
Description copied from interface: StackDockComponent
Gets the index of the currently selected component

Specified by:
getSelectedIndex in interface StackDockComponent
Returns:
the index

setSelectedIndex

public void setSelectedIndex(int index)
Description copied from interface: StackDockComponent
Selects the component at location index.

Specified by:
setSelectedIndex in interface StackDockComponent
Parameters:
index - the index of the selected component

getBoundsAt

public Rectangle getBoundsAt(int index)
Description copied from interface: StackDockComponent
Gets the location and size of the graphical element that allows the user to select the index'th child.

Specified by:
getBoundsAt in interface StackDockComponent
Parameters:
index - the index of the child
Returns:
the bounds of the graphical selection-element

addTab

public void addTab(String title,
                   Icon icon,
                   Component comp,
                   Dockable dockable)
Description copied from interface: StackDockComponent
Adds a new child at an unspecified location.

Specified by:
addTab in interface StackDockComponent
Parameters:
title - the title of the child
icon - an icon to display for the child or null
comp - the new child to display
dockable - the Dockable for which the tab is used

insertTab

public void insertTab(String title,
                      Icon icon,
                      Component comp,
                      Dockable dockable,
                      int index)
Description copied from interface: StackDockComponent
Adds a new child at the location index.

Specified by:
insertTab in interface StackDockComponent
Parameters:
title - the title of the child
icon - an icon to display for the child or null
comp - the new child to display
dockable - the Dockable for which the tab is used
index - the index that the new child should have

getDockable

public Dockable getDockable(int index)

getTabCount

public int getTabCount()
Description copied from interface: StackDockComponent
Gets the number of children that are added to this StackDockComponent.

Specified by:
getTabCount in interface StackDockComponent
Returns:
the number of children

setTitleAt

public void setTitleAt(int index,
                       String newTitle)
Description copied from interface: StackDockComponent
Sets the title of the child at location index.

Specified by:
setTitleAt in interface StackDockComponent
Parameters:
index - the index of the child
newTitle - the new title

setIconAt

public void setIconAt(int index,
                      Icon newIcon)
Description copied from interface: StackDockComponent
Sets the icon of the child at location index.

Specified by:
setIconAt in interface StackDockComponent
Parameters:
index - the index of the child
newIcon - the new icon, null if no icon should be displayed

getComponent

public Component getComponent()
Description copied from interface: StackDockComponent
Gets a Component on which the children of this StackDockComponent will be displayed.

Specified by:
getComponent in interface StackDockComponent
Returns:
the Component

getController

public DockController getController()
Gets the controller that is currently used.

Returns:
the controller or null

setController

public void setController(DockController controller)
Description copied from interface: StackDockComponent
Sets the controller for which this component manages its children.

Specified by:
setController in interface StackDockComponent
Parameters:
controller - the controller or null