org.openpermis.editor.policy.gui.dock
Class DockControl.ViewMonitor<T extends bibliothek.gui.dock.common.intern.DefaultCDockable>

java.lang.Object
  extended by org.openpermis.editor.policy.gui.dock.DockControl.ViewMonitor<T>
Type Parameters:
T - the type of dockable of this monitor.
All Implemented Interfaces:
bibliothek.gui.dock.common.event.CDockableStateListener, bibliothek.gui.dock.common.event.CFocusListener
Enclosing class:
DockControl

private class DockControl.ViewMonitor<T extends bibliothek.gui.dock.common.intern.DefaultCDockable>
extends Object
implements bibliothek.gui.dock.common.event.CFocusListener, bibliothek.gui.dock.common.event.CDockableStateListener

Monitor for views and dockables.

Since the underlying dockable framework fires open/close and focus events out of sync this monitor asserts that the events get fired in proper order.

Since:
0.1.0

Field Summary
private  boolean closedEventFired
          Indicates if the clsed event has already been fired.
private  T dockable
          The dockable monitored.
private  boolean openedEventFired
          Indicates if the opened event has already been fired.
private  View view
          The view being monitored.
 
Constructor Summary
DockControl.ViewMonitor(T dockable, View view)
          Creates a focus listener to monitors activation and deactivation of a view.
 
Method Summary
protected  boolean canCloseView()
          Check if the view can be closed.
 void closeDockable()
          Closes the dockable.
 void destroyDockable()
          Destroys the dockable.
 void externalized(bibliothek.gui.dock.common.intern.CDockable target)
           
protected  Component findDefaultFocusComponent(Container container)
          Searches a suitable focus root starting at the given container.
 void fireViewClosed(boolean reopen)
          Fires a view closed event.
 void fireViewOpened()
          Fires a view opened event.
 void focusGained(bibliothek.gui.dock.common.intern.CDockable target)
           
 void focusLost(bibliothek.gui.dock.common.intern.CDockable target)
           
 T getDockable()
          Returns the dockable monitored.
 void maximized(bibliothek.gui.dock.common.intern.CDockable target)
           
 void minimized(bibliothek.gui.dock.common.intern.CDockable target)
           
 void normalized(bibliothek.gui.dock.common.intern.CDockable target)
           
 void openDockable()
          Resets the state of this monitor and makes the dockable visible.
 void requestFocus()
          Requests the focus for the dockable.
protected  void viewClosed()
          Called once a view has been closed.
protected  void viewDestroyed()
          Called once a view has been destroyed.
 void visibilityChanged(bibliothek.gui.dock.common.intern.CDockable target)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

view

private final View view
The view being monitored.

Since:
0.1.0

dockable

private final T extends bibliothek.gui.dock.common.intern.DefaultCDockable dockable
The dockable monitored.

Since:
0.1.0

openedEventFired

private volatile boolean openedEventFired
Indicates if the opened event has already been fired.

Since:
0.1.0

closedEventFired

private volatile boolean closedEventFired
Indicates if the clsed event has already been fired.

Since:
0.1.0
Constructor Detail

DockControl.ViewMonitor

public DockControl.ViewMonitor(T dockable,
                               View view)
Creates a focus listener to monitors activation and deactivation of a view.

Parameters:
dockable - the dockable monitored.
view - the view to monitor.
Since:
0.1.0
Method Detail

destroyDockable

public void destroyDockable()
Destroys the dockable.

This will not ask the view.

Since:
0.1.0

closeDockable

public void closeDockable()
Closes the dockable.

Since:
0.1.0

canCloseView

protected boolean canCloseView()
Check if the view can be closed.

Returns:
true if the view can be closed.
Since:
0.1.0

viewDestroyed

protected void viewDestroyed()
Called once a view has been destroyed.

Fires a view close event.

Since:
0.1.0

viewClosed

protected void viewClosed()
Called once a view has been closed.

Fires a view close event.

Since:
0.1.0

getDockable

public T getDockable()
Returns the dockable monitored.

Returns:
the dockable monitored.
Since:
0.1.0

openDockable

public void openDockable()
Resets the state of this monitor and makes the dockable visible.

Since:
0.1.0

findDefaultFocusComponent

protected Component findDefaultFocusComponent(Container container)
Searches a suitable focus root starting at the given container.

Parameters:
container - the container to search.
Returns:
the focus candidate or null.
Since:
0.1.0

requestFocus

public void requestFocus()
Requests the focus for the dockable.

Since:
0.1.0

fireViewOpened

public void fireViewOpened()
Fires a view opened event.

This event will only be fired once.

Since:
0.1.0

fireViewClosed

public void fireViewClosed(boolean reopen)
Fires a view closed event.

Parameters:
reopen - true to assert that a view opened event has been fired first.
Since:
0.1.0

focusGained

public void focusGained(bibliothek.gui.dock.common.intern.CDockable target)
Specified by:
focusGained in interface bibliothek.gui.dock.common.event.CFocusListener
Since:
0.1.0

focusLost

public void focusLost(bibliothek.gui.dock.common.intern.CDockable target)
Specified by:
focusLost in interface bibliothek.gui.dock.common.event.CFocusListener
Since:
0.1.0

visibilityChanged

public void visibilityChanged(bibliothek.gui.dock.common.intern.CDockable target)
Specified by:
visibilityChanged in interface bibliothek.gui.dock.common.event.CDockableStateListener
Since:
0.1.0

externalized

public void externalized(bibliothek.gui.dock.common.intern.CDockable target)
Specified by:
externalized in interface bibliothek.gui.dock.common.event.CDockableStateListener
Since:
0.1.0

maximized

public void maximized(bibliothek.gui.dock.common.intern.CDockable target)
Specified by:
maximized in interface bibliothek.gui.dock.common.event.CDockableStateListener
Since:
0.1.0

minimized

public void minimized(bibliothek.gui.dock.common.intern.CDockable target)
Specified by:
minimized in interface bibliothek.gui.dock.common.event.CDockableStateListener
Since:
0.1.0

normalized

public void normalized(bibliothek.gui.dock.common.intern.CDockable target)
Specified by:
normalized in interface bibliothek.gui.dock.common.event.CDockableStateListener
Since:
0.1.0


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