

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() |
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().
| 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
| 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. |
References startListening().
| void cern::gp::windows::WorkspaceSwitchListenerSupport::myWorkspaceEntered | ( | ) | [inline, protected] |
Reimplemented in cern::gp::windows::test::TestWorkspaceSwitchListenerSupport.
Referenced by propertyChange().
| void cern::gp::windows::WorkspaceSwitchListenerSupport::myWorkspaceExited | ( | ) | [inline, protected] |
Reimplemented in cern::gp::windows::test::TestWorkspaceSwitchListenerSupport.
Referenced by propertyChange().
| void cern::gp::windows::WorkspaceSwitchListenerSupport::propertyChange | ( | PropertyChangeEvent | pce | ) | [inline] |
References mineOnly, myWorkspace, myWorkspaceEntered(), myWorkspaceExited(), workspaceEntered(), and workspaceExited().
| 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
References listening, and listeningLock.
Referenced by WorkspaceSwitchListenerSupport().
| 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
References listening, and listeningLock.
| void cern::gp::windows::WorkspaceSwitchListenerSupport::workspaceEntered | ( | Workspace | ws | ) | [inline, protected] |
Reimplemented in cern::gp::windows::test::TestWorkspaceSwitchListenerSupport.
Referenced by propertyChange().
| void cern::gp::windows::WorkspaceSwitchListenerSupport::workspaceExited | ( | Workspace | ws | ) | [inline, protected] |
Reimplemented in cern::gp::windows::test::TestWorkspaceSwitchListenerSupport.
Referenced by propertyChange().
boolean cern::gp::windows::WorkspaceSwitchListenerSupport::listening [private] |
Referenced by startListening(), and stopListening().
final Object cern::gp::windows::WorkspaceSwitchListenerSupport::listeningLock = new Object() [private] |
Referenced by startListening(), and stopListening().
final boolean cern::gp::windows::WorkspaceSwitchListenerSupport::mineOnly [private] |
Referenced by propertyChange().
final Workspace cern::gp::windows::WorkspaceSwitchListenerSupport::myWorkspace [private] |
Referenced by propertyChange().
1.6.2