org.openpermis.editor.policy.gui.dock
Class DockControl

java.lang.Object
  extended by org.openpermis.editor.policy.gui.dock.DockControl

public class DockControl
extends Object

Control that manages all dockables and the swing components of the main frame.

Since:
0.1.0

Constructor Summary
DockControl(JFrame frame)
          Creates a new dock control for the specified owner frame.
 
Method Summary
 void addDockControlListener(DockControlListener listener)
          Adds a listener for dock control events.
 boolean closeView(View view, boolean force)
          Removes the dockable responsible for the view specified.
 JComponent getContentArea()
          Returns the content area of this dock control.
 Set<Editor> getEditorViews()
          Returns a set of all editor views currently attached to this dock control.
 Set<Tool> getToolViews()
          Returns a set of all tool views currently attached to this dock control.
 Set<View> getViews()
          Returns all view currently attached to this dock control.
 boolean isViewOpen(View view)
          Checks if a view is open.
 void openView(View view)
          Creates a dockable of appropriate type for the specified view and displays it.
 void removeDockControlListener(DockControlListener listener)
          Removes a listener from this dock control.
 void updateViewTitle(View view)
          Updates the title of the dockable this view is attached to.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DockControl

public DockControl(JFrame frame)
Creates a new dock control for the specified owner frame.

Parameters:
frame - the frame used as owner for externally opened views.
Since:
0.1.0
Method Detail

addDockControlListener

public void addDockControlListener(DockControlListener listener)
Adds a listener for dock control events.

The same listener object may be added more than once, and will be called as many times as it is added.

If the listener is null, no action is taken.

Parameters:
listener - the listener to add, may be null.
Since:
0.1.0

removeDockControlListener

public void removeDockControlListener(DockControlListener listener)
Removes a listener from this dock control.

If the same listener was added more than once, it will be notified one less time after being removed.

If the listener is null, or was never added, no action is taken.

Parameters:
listener - the listener to be removed, may be null.

getContentArea

public JComponent getContentArea()
Returns the content area of this dock control.

The content area contains all tool and editor dockables and serves as the main content of the editor window.

Returns:
the content area requested.
Since:
0.1.0

updateViewTitle

public void updateViewTitle(View view)
Updates the title of the dockable this view is attached to.

Parameters:
view - the view for which to update the title.
Since:
0.1.0

openView

public void openView(View view)
Creates a dockable of appropriate type for the specified view and displays it.

If the view is already open it is activated.

Supports Tool and Editor views.

Parameters:
view - the view to display.
Throws:
IllegalArgumentException - if the view type is not supported.
Since:
0.1.0

getViews

public Set<View> getViews()
Returns all view currently attached to this dock control.

Returns:
the set of views requested, never null.
Since:
0.1.0

isViewOpen

public boolean isViewOpen(View view)
Checks if a view is open.

Parameters:
view - the view to check.
Returns:
true if the view is open.
Since:
0.1.0

getToolViews

public Set<Tool> getToolViews()
Returns a set of all tool views currently attached to this dock control.

Returns:
the set requested, never null.
Since:
0.1.0

getEditorViews

public Set<Editor> getEditorViews()
Returns a set of all editor views currently attached to this dock control.

Returns:
the set requested, never null.
Since:
0.1.0

closeView

public boolean closeView(View view,
                         boolean force)
Removes the dockable responsible for the view specified.

Parameters:
view - the view to remove.
force - true to force closing the view.
Returns:
true if the dockable was removed.
Since:
0.1.0


PERMIS Role Based Access Control 0.4.0 (Build 15)
2009/05/20 08:15:11
Copyright (c) 2002-2007 Ergon Informatik AG