bibliothek.extension.gui.dock.theme.eclipse.stack
Class EclipseTabInfo

java.lang.Object
  extended by bibliothek.gui.dock.station.stack.tab.AbstractTabPaneComponent
      extended by bibliothek.extension.gui.dock.theme.eclipse.stack.EclipseTabInfo
All Implemented Interfaces:
CombinedInfoComponent, LayoutBlock, LonelyTabPaneComponent, TabPaneComponent

public class EclipseTabInfo
extends AbstractTabPaneComponent
implements CombinedInfoComponent, LayoutBlock

This component shows a subset of DockActions of the currently selected Dockable of its parent TabPane. The global EclipseThemeConnector is used to determine which actions to show, only non-tab actions are shown.

Author:
Benjamin Sigg

Constructor Summary
EclipseTabInfo(EclipseTabPane pane)
          Creates a new component.
 
Method Summary
 Component getComponent()
          Gets the Component which is wrapped into this AbstractTabPaneComponent.
 Size[] getSizes()
          Creates a map of all sizes for which this block knows how to make an optimal layout.
 int getZOrder()
          Gets the value of the z order.
 boolean isPaneVisible()
          Tells whether this component is visible or not.
 void setBounds(int x, int y, int width, int height)
          Sets the boundaries of this block.
 void setLayout(Size size)
          Sets the layout of this block, the exact meaning of size depends on this block.
 void setOrientation(TabPlacement orientation)
          Tells this component how to paint itself.
 void setPaneVisible(boolean visible)
          Changes the visibility state of this component.
 void setSelection(Dockable dockable)
          Sets the element whose actions should be shown on this info.
 void setZOrder(int order)
          Sets the z order of this component.
 LayoutBlock toLayoutBlock()
          Gets a LayoutBlock related to this component.
protected  void updateContent()
          Using the current DockController and Dockable, this method updates the DockActionSource which selects the actions of this info.
 
Methods inherited from class bibliothek.gui.dock.station.stack.tab.AbstractTabPaneComponent
getBounds, getMaximumSize, getMinimumSize, getOrientation, getOverlap, getPreferredSize, getTabParent, setBounds
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface bibliothek.gui.dock.station.stack.tab.TabPaneComponent
getBounds, getMaximumSize, getMinimumSize, getOverlap, getPreferredSize, getTabParent, setBounds
 

Constructor Detail

EclipseTabInfo

public EclipseTabInfo(EclipseTabPane pane)
Creates a new component.

Parameters:
pane - the owner of this info
Method Detail

setSelection

public void setSelection(Dockable dockable)
Sets the element whose actions should be shown on this info.

Parameters:
dockable - the item, can be null

updateContent

protected void updateContent()
Using the current DockController and Dockable, this method updates the DockActionSource which selects the actions of this info.


getComponent

public Component getComponent()
Description copied from class: AbstractTabPaneComponent
Gets the Component which is wrapped into this AbstractTabPaneComponent. This method is not called from the constructor.

Specified by:
getComponent in interface CombinedInfoComponent
Specified by:
getComponent in class AbstractTabPaneComponent
Returns:
the wrapped Component, not null

isPaneVisible

public boolean isPaneVisible()
Description copied from interface: TabPaneComponent
Tells whether this component is visible or not.

Specified by:
isPaneVisible in interface TabPaneComponent
Returns:
true if visible, false otherwise

setPaneVisible

public void setPaneVisible(boolean visible)
Description copied from interface: TabPaneComponent
Changes the visibility state of this component. Invisible components should be removed from any parent.

Specified by:
setPaneVisible in interface TabPaneComponent
Parameters:
visible - the new state

getZOrder

public int getZOrder()
Description copied from interface: TabPaneComponent
Gets the value of the z order.

Specified by:
getZOrder in interface TabPaneComponent
Returns:
the z order
See Also:
TabPaneComponent.setZOrder(int)

setZOrder

public void setZOrder(int order)
Description copied from interface: TabPaneComponent
Sets the z order of this component. The z order tells which component to paint first, as lower the order as earlier a component is to be painted. If two components overlap, then the one with the higher z order appears in front of the one with the lower z order. If two components have the same z order, then it is unspecified which component is painted first.
A z-order is at least 0 and must not exceed the number of TabPaneComponents on the parent TabPane. The implementation may increase or decrease z-orders to prevent collisions between components with the same order.

Specified by:
setZOrder in interface TabPaneComponent
Parameters:
order - the order, can be any integer.

toLayoutBlock

public LayoutBlock toLayoutBlock()
Description copied from interface: LonelyTabPaneComponent
Gets a LayoutBlock related to this component. This method may create a new block or return always the same block.

Specified by:
toLayoutBlock in interface LonelyTabPaneComponent
Returns:
the LayoutBlock related to this component

setOrientation

public void setOrientation(TabPlacement orientation)
Description copied from interface: TabPaneComponent
Tells this component how to paint itself.

Specified by:
setOrientation in interface LayoutBlock
Specified by:
setOrientation in interface TabPaneComponent
Overrides:
setOrientation in class AbstractTabPaneComponent
Parameters:
orientation - the orientation, not null

getSizes

public Size[] getSizes()
Description copied from interface: LayoutBlock
Creates a map of all sizes for which this block knows how to make an optimal layout. If for example this block consists of 12 buttons, then different sizes might lead to a row of 12 blocks, to 2 rows of 6 blocks, to 3 rows of 4 blocks, etc...

Specified by:
getSizes in interface LayoutBlock
Returns:
the map of sizes, may be empty or null

setLayout

public void setLayout(Size size)
Description copied from interface: LayoutBlock
Sets the layout of this block, the exact meaning of size depends on this block. In general keys returned by the last call of LayoutBlock.getSizes() must be accepted, for any other key the behavior is unspecified.

Specified by:
setLayout in interface LayoutBlock
Parameters:
size - the new layout

setBounds

public void setBounds(int x,
                      int y,
                      int width,
                      int height)
Description copied from interface: LayoutBlock
Sets the boundaries of this block. The component(s) represented by this block must somehow fit into the rectangle.

Specified by:
setBounds in interface LayoutBlock
Parameters:
x - the x coordinate
y - the y coordinate
width - the width in pixel
height - the height in pixel