bibliothek.gui.dock.action
Interface ButtonContentFilter

All Known Implementing Classes:
AbstractButtonContentFilter, CButtonContentFilter

public interface ButtonContentFilter

This filter decides for DockActions whether their text is shown on buttons.

Author:
Benjamin Sigg
See Also:
DockAction.BUTTON_CONTENT_FILTER

Field Summary
static ButtonContentFilter ALWAYS
          A filter whose showText(Dockable, DockAction) method always returns true.
static ButtonContentFilter NEVER
          A filter whose showText(Dockable, DockAction) method always returns false.
 
Method Summary
 void addListener(ButtonContentFilterListener listener)
          Adds the observer listener to this filter.
 void install(Dockable dockable, DockAction action)
          Informs this filter that action which is connected to dockable will be shown.
 void removeListener(ButtonContentFilterListener listener)
          Removes the observer listener from this filter.
 boolean showText(Dockable dockable, DockAction action)
          Tells whether the text of action, that is associated with dockable, is to be shown.
 void uninstall(Dockable dockable, DockAction action)
          Informs this filter that action will no longer be shown.
 

Field Detail

NEVER

static final ButtonContentFilter NEVER
A filter whose showText(Dockable, DockAction) method always returns false.


ALWAYS

static final ButtonContentFilter ALWAYS
A filter whose showText(Dockable, DockAction) method always returns true.

Method Detail

showText

boolean showText(Dockable dockable,
                 DockAction action)
Tells whether the text of action, that is associated with dockable, is to be shown.

Parameters:
dockable - the Dockable with which action is connected
action - the action whose text may be shown
Returns:
true if the text is to be shown, false otherwise

install

void install(Dockable dockable,
             DockAction action)
Informs this filter that action which is connected to dockable will be shown. This method may be called more then once, if the action is shown in more than one place.

Parameters:
dockable - the element whose action is going to show up
action - the action that is going to show up

uninstall

void uninstall(Dockable dockable,
               DockAction action)
Informs this filter that action will no longer be shown. This method may be called more than once if action is shown at more than one place.

Parameters:
dockable - the element whose action is going to be hidden
action - the action that is no longer showing up

addListener

void addListener(ButtonContentFilterListener listener)
Adds the observer listener to this filter. The listener must be called if the result of showText(Dockable, DockAction) changes.

Parameters:
listener - the new listener

removeListener

void removeListener(ButtonContentFilterListener listener)
Removes the observer listener from this filter.

Parameters:
listener - the observer that is no longer shown