Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

cern::gp::windows::WorkspaceSwitchListenerSupport Class Reference

Inheritance diagram for cern::gp::windows::WorkspaceSwitchListenerSupport:

Inheritance graph
[legend]
List of all members.

Public Member Functions

void stopListening ()
void startListening ()
void propertyChange (PropertyChangeEvent pce)

Protected Member Functions

 WorkspaceSwitchListenerSupport ()
 WorkspaceSwitchListenerSupport (Workspace myWorkspace, boolean mineOnly)
void workspaceEntered (Workspace ws)
void workspaceExited (Workspace ws)
void myWorkspaceEntered ()
void myWorkspaceExited ()

Private Attributes

final Workspace myWorkspace
final boolean mineOnly
boolean listening
final Object listeningLock = new Object()

Detailed Description

A helper class to listen to workspace switches. It listens to the Workspace changes and notifies the appropriate xxEntered and xxExited methods . The user has to write a sub-class that overrides the methods s/he is interested in. For instance, if a program wants to be informed any time a workspace is exited, s/he will override the method workspaceExited(). Or, as another example, if a window wants to be informed whenever its own Workspace is entered, it will use the constructor WorkspaceSwitchListenerSupport(Workspace) and override the method myWorkspaceEntered().

Author:
Vito Baggiolini
Version:
Revision
1.2
Date
2006/09/25 08:52:36


Constructor & Destructor Documentation

cern::gp::windows::WorkspaceSwitchListenerSupport::WorkspaceSwitchListenerSupport  )  [inline, protected]
 

constructor to be used if you want to be informed about which workspace is being entered. This constructor will only invoke the methods workspaceEntered/Exited

cern::gp::windows::WorkspaceSwitchListenerSupport::WorkspaceSwitchListenerSupport Workspace  myWorkspace,
boolean  mineOnly
[inline, protected]
 

constructor to be used if you want to be informed about a specific workspace. if this constructor is used and mineOnly==false all four Entered/Exited methods will be called; if mineOnly == true, only myWorkspaceEntered/Exited will be called

Parameters:
myWorkspace the workspace for which entering and exiting is monitored
whether only my workspace shall be monitored, if true, the methodsworkspaceEntered/Exited will not be invoked.


Member Function Documentation

void cern::gp::windows::WorkspaceSwitchListenerSupport::myWorkspaceEntered  )  [inline, protected]
 

Reimplemented in cern::gp::windows::test::TestWorkspaceSwitchListenerSupport.

void cern::gp::windows::WorkspaceSwitchListenerSupport::myWorkspaceExited  )  [inline, protected]
 

Reimplemented in cern::gp::windows::test::TestWorkspaceSwitchListenerSupport.

void cern::gp::windows::WorkspaceSwitchListenerSupport::propertyChange PropertyChangeEvent  pce  )  [inline]
 

void cern::gp::windows::WorkspaceSwitchListenerSupport::startListening  )  [inline]
 

tell this object to start listening again. This method is called in the constructor. It is not necessary (but not harmful either) to call this menthod again even if we are already listening. Precautions are taken to avoid adding a second listener. This method is thread safe with regards to its counterpart

See also:
stopListening

void cern::gp::windows::WorkspaceSwitchListenerSupport::stopListening  )  [inline]
 

tell the workspace listener to stop listening. This method is thread safe with regards to its counterpart You don't have to call this in the end, as we use a weaklistener

See also:
startListening

void cern::gp::windows::WorkspaceSwitchListenerSupport::workspaceEntered Workspace  ws  )  [inline, protected]
 

Reimplemented in cern::gp::windows::test::TestWorkspaceSwitchListenerSupport.

void cern::gp::windows::WorkspaceSwitchListenerSupport::workspaceExited Workspace  ws  )  [inline, protected]
 

Reimplemented in cern::gp::windows::test::TestWorkspaceSwitchListenerSupport.


Member Data Documentation

boolean cern::gp::windows::WorkspaceSwitchListenerSupport::listening [private]
 

final Object cern::gp::windows::WorkspaceSwitchListenerSupport::listeningLock = new Object() [private]
 

final boolean cern::gp::windows::WorkspaceSwitchListenerSupport::mineOnly [private]
 

final Workspace cern::gp::windows::WorkspaceSwitchListenerSupport::myWorkspace [private]
 


The documentation for this class was generated from the following file:
Generated on Thu Apr 30 03:08:40 2009 for ACS Java API by doxygen 1.3.8