bibliothek.gui.dock.action.view
Class ConnectingViewItem<A>

java.lang.Object
  extended by bibliothek.gui.dock.action.view.ConnectingViewItem<A>
Type Parameters:
A - the kind of item this represents
All Implemented Interfaces:
ViewItem<A>
Direct Known Subclasses:
RoundButtonViewItem

public abstract class ConnectingViewItem<A>
extends java.lang.Object
implements ViewItem<A>

A connecting view item is a wrapper around another ViewItem. This item registers when a DockController is available and needed. It does this by observing a Dockable.

Author:
Benjamin Sigg

Constructor Summary
ConnectingViewItem(Dockable dockable, ViewItem<A> delegate)
          Creates a new item.
 
Method Summary
 void bind()
          Binds this item to its action
protected abstract  void changed(DockController oldController, DockController newController)
          Called when the DockController changed.
 void check()
          Checks the current DockController and may replace the controller when a new one is available.
 DockAction getAction()
          Gets the action that is represented by this target.
 A getItem()
          Gets this item as component.
 void unbind()
          Unbinds this item from its action
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectingViewItem

public ConnectingViewItem(Dockable dockable,
                          ViewItem<A> delegate)
Creates a new item.

Parameters:
dockable - the element to observe for a DockController.
delegate - the delegate that carries out most of the work
Method Detail

check

public void check()
Checks the current DockController and may replace the controller when a new one is available.


changed

protected abstract void changed(DockController oldController,
                                DockController newController)
Called when the DockController changed.

Parameters:
oldController - the old controller, can be null
newController - the new controller, can be null

bind

public void bind()
Description copied from interface: ViewItem
Binds this item to its action

Specified by:
bind in interface ViewItem<A>

getAction

public DockAction getAction()
Description copied from interface: ViewItem
Gets the action that is represented by this target.

Specified by:
getAction in interface ViewItem<A>
Returns:
the action, might be null

getItem

public A getItem()
Description copied from interface: ViewItem
Gets this item as component.

Specified by:
getItem in interface ViewItem<A>
Returns:
this item

unbind

public void unbind()
Description copied from interface: ViewItem
Unbinds this item from its action

Specified by:
unbind in interface ViewItem<A>