com.softwareag.cis.plugin.adapter.util
Class WorkplaceEventListener

java.lang.Object
  extended by com.softwareag.cis.plugin.adapter.util.WorkplaceEventListener
All Implemented Interfaces:
com.softwareag.cis.workplace.IMFWorkplaceEventListener, com.softwareag.cis.workplace.IMFWorkplaceEventListener2

public class WorkplaceEventListener
extends java.lang.Object
implements com.softwareag.cis.workplace.IMFWorkplaceEventListener2

Handle focus changes between editors


Nested Class Summary
 class WorkplaceEventListener.ClosePageCommand
           
 
Constructor Summary
WorkplaceEventListener(com.softwareag.cis.workplace.MFWorkplaceAdapter workplaceAdapter)
           
 
Method Summary
static void addAdapterForExplicitUpdate(com.softwareag.cis.server.Adapter adapter)
          Add adapter in adapters for update in session context
static boolean allowCloseAllActivities(com.softwareag.cis.workplace.IMFWorkplace wp, com.softwareag.cis.server.util.ICommand cmd)
          Execute given command if allowed to close all activities
static boolean executeIfCurrentActivityAllowedToLooseFocus(com.softwareag.cis.workplace.IMFWorkplace wp, com.softwareag.cis.server.util.ICommand cmd)
          Execute given command if current activity may be closed or we may switch to another activity
static com.softwareag.cis.workplace.IMFWorkplaceActivity getActivity(com.softwareag.cis.workplace.IMFWorkplace wp, int selectedActivity)
          The CIS framework provides for multiple activivities running in parallel This function obtains the visible activity at the given position.
static com.softwareag.cis.workplace.IMFWorkplaceActivity getCurrentActivity(com.softwareag.cis.workplace.IMFWorkplace wp)
          The CIS framework provides for multiple activivities running in parallel This function obtains the visible activity
 boolean reactOnAddPageToWorkplace(com.softwareag.cis.workplace.IMFWorkplace wp, com.softwareag.cis.workplace.IMFWorkplaceActivity actOld, com.softwareag.cis.workplace.IMFWorkplaceActivity actNew)
          This method is called if a workplace activity is to be started.
 boolean reactOnCloseAllWindowsRequest(com.softwareag.cis.workplace.IMFWorkplace wp, java.lang.String[] subSessionIds)
          CIS Workplace framework provides for a "close all windows" icon within the workplace header.
 boolean reactOnCloseWindowRequest(com.softwareag.cis.workplace.IMFWorkplace workplace, int selectedActivity)
          CIS Workplace framework provides for a "close window" icon within the activity button.
 void reactOnContextMenuRequest(com.softwareag.cis.workplace.IMFWorkplace workplace, com.softwareag.cis.workplace.MFWorkplaceTopic selectedTopic, com.softwareag.cis.workplace.MFWorkplaceTreeNodeGeneral clickedNode, com.softwareag.cis.workplace.MFWorkplaceTreeNodeGeneral[] selectedNodes)
          Method is called if the user clicks a tree item with the right mouse button.
 void reactOnContextMenuRequestFunctionTree(com.softwareag.cis.workplace.IMFWorkplace workplace, com.softwareag.cis.workplace.MFWorkplaceTopic selectedTopic)
          Method is called if the user clicks into the free available space of the function tree with the right mouse button.
 void reactOnContextMenuRequestMFTopic(com.softwareag.cis.workplace.IMFWorkplace workplace, com.softwareag.cis.workplace.MFWorkplaceTopic selectedTopic)
           
 void reactOnDrop(com.softwareag.cis.workplace.IMFWorkplace workplace, com.softwareag.cis.workplace.MFWorkplaceTopic selectedTopic, com.softwareag.cis.workplace.MFWorkplaceTreeNodeGeneral target, com.softwareag.cis.workplace.MFWorkplaceTreeNodeGeneral[] draggedItem)
          There are several different "drop events".
 void reactOnDropDustbin(com.softwareag.cis.workplace.IMFWorkplace workplace, java.lang.String dropInfo)
          This method is called if the user drags an icon (e.g. a favourite) or a function tree item to the dustbin and drops it there.
 void reactOnDropGeneric(com.softwareag.cis.workplace.IMFWorkplace workplace, com.softwareag.cis.workplace.MFWorkplaceTopic selectedTopic, com.softwareag.cis.workplace.MFWorkplaceTreeNodeGeneral target, java.lang.String dropInfo)
          This method is called if the user drags an icon over a function tree item and drops it there.
 boolean reactOnMaxNumberOfWorkplaceActivitiesReached(com.softwareag.cis.workplace.IMFWorkplace wp, java.lang.String pageFileName, java.lang.String pageTitle)
          Method is called if the maximum number of open activities has been reached and the user tries to open next activity.
 void reactOnPopupMenuClosedByUser(com.softwareag.cis.workplace.IMFWorkplace wp)
          React on popup menu being closed
 void reactOnRemovePageFromWorkplace(com.softwareag.cis.workplace.IMFWorkplace wp, com.softwareag.cis.workplace.IMFWorkplaceActivity actOld)
          This method is called after removing a workplace activity (i.e. after executing IMFWorkplace.removePageFromWorkplace).
 boolean reactOnSwitchSelectedActivity(com.softwareag.cis.workplace.IMFWorkplace wp, com.softwareag.cis.workplace.IMFWorkplaceActivity currentActivity, com.softwareag.cis.workplace.IMFWorkplaceActivity newActivity)
          Within the header of the CIS Workplace framework user can switch between workplace activities.
 boolean reactOnSwitchSelectedTopic(com.softwareag.cis.workplace.IMFWorkplace wp, com.softwareag.cis.workplace.MFWorkplaceTopic currentTopic, com.softwareag.cis.workplace.MFWorkplaceTopic newTopic)
          Book keeping for scenario when switching topic Method is called if the user clicks onto a button within the (left) workplace menu frame.
static void removeFromExplicitUpdate(com.softwareag.cis.server.Adapter adapter)
          Remove adapter in adapters for update in session context
static void updateWorkplace(com.softwareag.cis.workplace.MFWorkplaceAdapter workplaceAdapter)
          Refreshes some adapters and causes some frame targets to refresh their data content
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorkplaceEventListener

public WorkplaceEventListener(com.softwareag.cis.workplace.MFWorkplaceAdapter workplaceAdapter)
Method Detail

addAdapterForExplicitUpdate

public static void addAdapterForExplicitUpdate(com.softwareag.cis.server.Adapter adapter)
Add adapter in adapters for update in session context


removeFromExplicitUpdate

public static void removeFromExplicitUpdate(com.softwareag.cis.server.Adapter adapter)
Remove adapter in adapters for update in session context


reactOnContextMenuRequest

public void reactOnContextMenuRequest(com.softwareag.cis.workplace.IMFWorkplace workplace,
                                      com.softwareag.cis.workplace.MFWorkplaceTopic selectedTopic,
                                      com.softwareag.cis.workplace.MFWorkplaceTreeNodeGeneral clickedNode,
                                      com.softwareag.cis.workplace.MFWorkplaceTreeNodeGeneral[] selectedNodes)
Method is called if the user clicks a tree item with the right mouse button.

Specified by:
reactOnContextMenuRequest in interface com.softwareag.cis.workplace.IMFWorkplaceEventListener
Parameters:
workplace - reference to the workplace management
selectedTopic - the currently selected workplace topic
clickedNode - the tree item that received the right mouse click
selectedNodes - the current selection of the topic tree

reactOnContextMenuRequestFunctionTree

public void reactOnContextMenuRequestFunctionTree(com.softwareag.cis.workplace.IMFWorkplace workplace,
                                                  com.softwareag.cis.workplace.MFWorkplaceTopic selectedTopic)
Method is called if the user clicks into the free available space of the function tree with the right mouse button.

Specified by:
reactOnContextMenuRequestFunctionTree in interface com.softwareag.cis.workplace.IMFWorkplaceEventListener
Parameters:
workplace - reference to the workplace management
selectedTopic - the currently selected workplace topic

reactOnContextMenuRequestMFTopic

public void reactOnContextMenuRequestMFTopic(com.softwareag.cis.workplace.IMFWorkplace workplace,
                                             com.softwareag.cis.workplace.MFWorkplaceTopic selectedTopic)
Specified by:
reactOnContextMenuRequestMFTopic in interface com.softwareag.cis.workplace.IMFWorkplaceEventListener

reactOnDrop

public void reactOnDrop(com.softwareag.cis.workplace.IMFWorkplace workplace,
                        com.softwareag.cis.workplace.MFWorkplaceTopic selectedTopic,
                        com.softwareag.cis.workplace.MFWorkplaceTreeNodeGeneral target,
                        com.softwareag.cis.workplace.MFWorkplaceTreeNodeGeneral[] draggedItem)
There are several different "drop events". This method is called if drags an tree item and drops onto another tree item. I.e. the user clicks onto a tree item, keeps the mouse button pressed, moves over a second tree item and releases the mouse button there.

Specified by:
reactOnDrop in interface com.softwareag.cis.workplace.IMFWorkplaceEventListener
Parameters:
workplace - reference to the workplace management
selectedTopic - the currently selected workplace topic
target - the tree item that received the drop event
draggedItem - the item that was dragged to the target

reactOnDropDustbin

public void reactOnDropDustbin(com.softwareag.cis.workplace.IMFWorkplace workplace,
                               java.lang.String dropInfo)
This method is called if the user drags an icon (e.g. a favourite) or a function tree item to the dustbin and drops it there.

Specified by:
reactOnDropDustbin in interface com.softwareag.cis.workplace.IMFWorkplaceEventListener
Parameters:
workplace - reference to the workplace management
dropInfo - the "drop info" of the dragged item. The drop info of a tree item is set dynamically (property "dropInfo" at class NODEInfo). ICON controls provide for attribute DROPINFO.

reactOnDropGeneric

public void reactOnDropGeneric(com.softwareag.cis.workplace.IMFWorkplace workplace,
                               com.softwareag.cis.workplace.MFWorkplaceTopic selectedTopic,
                               com.softwareag.cis.workplace.MFWorkplaceTreeNodeGeneral target,
                               java.lang.String dropInfo)
This method is called if the user drags an icon over a function tree item and drops it there.

Specified by:
reactOnDropGeneric in interface com.softwareag.cis.workplace.IMFWorkplaceEventListener
Parameters:
workplace - reference to the workplace management
selectedTopic - the currently selected workplace topic
target - the tree item that received the drop event
dropInfo - the "drop info" of the dragged item. The drop info of a tree item is set dynamically (property "dropInfo" at class NODEInfo). ICON controls provide for attribute DROPINFO.

reactOnCloseAllWindowsRequest

public boolean reactOnCloseAllWindowsRequest(com.softwareag.cis.workplace.IMFWorkplace wp,
                                             java.lang.String[] subSessionIds)
CIS Workplace framework provides for a "close all windows" icon within the workplace header. By default the workplace starts a yes-no-popup asking the user if he really wants to close all windows. You may want to react in another way. Use MFWorkplaceInfo. This method is called if the clicks on the "close all windows" icon within the workplace header.

Specified by:
reactOnCloseAllWindowsRequest in interface com.softwareag.cis.workplace.IMFWorkplaceEventListener
Parameters:
wp - reference to the workplace management
subSessionIds - The subssesion ids of the currently started workplace activities.
Returns:
Return false if you have handled the request on your own and you do not want the workplace the open its yes-no-popup. Return false if you want the workplace to open the yes-no-popup.

reactOnCloseWindowRequest

public boolean reactOnCloseWindowRequest(com.softwareag.cis.workplace.IMFWorkplace workplace,
                                         int selectedActivity)
CIS Workplace framework provides for a "close window" icon within the activity button. This method is called if the clicks on the "close window" icon within the activity button.

Specified by:
reactOnCloseWindowRequest in interface com.softwareag.cis.workplace.IMFWorkplaceEventListener
Parameters:
workplace - reference to the workplace management
selectedActivity - The activity id which will be closed.

reactOnSwitchSelectedActivity

public boolean reactOnSwitchSelectedActivity(com.softwareag.cis.workplace.IMFWorkplace wp,
                                             com.softwareag.cis.workplace.IMFWorkplaceActivity currentActivity,
                                             com.softwareag.cis.workplace.IMFWorkplaceActivity newActivity)
Within the header of the CIS Workplace framework user can switch between workplace activities. This method is called on user click. You either allow the switch (return "true") or you raise a veto (return "false").

Specified by:
reactOnSwitchSelectedActivity in interface com.softwareag.cis.workplace.IMFWorkplaceEventListener
Parameters:
wp - reference to the workplace management
currentActivity -
newActivity -
Returns:
Return true if the switch to another activity is OK - return false to raise a veto (no switch)

reactOnSwitchSelectedTopic

public boolean reactOnSwitchSelectedTopic(com.softwareag.cis.workplace.IMFWorkplace wp,
                                          com.softwareag.cis.workplace.MFWorkplaceTopic currentTopic,
                                          com.softwareag.cis.workplace.MFWorkplaceTopic newTopic)
Book keeping for scenario when switching topic Method is called if the user clicks onto a button within the (left) workplace menu frame.

Specified by:
reactOnSwitchSelectedTopic in interface com.softwareag.cis.workplace.IMFWorkplaceEventListener
Parameters:
wp - is workplace reference to the workplace management
currentTopic - the currently selected workplace topic
newTopic - the clicked topic
Returns:
Return true if the switch to the clicked topic is OK - return false to raise a veto (no switch)

reactOnPopupMenuClosedByUser

public void reactOnPopupMenuClosedByUser(com.softwareag.cis.workplace.IMFWorkplace wp)
React on popup menu being closed

Specified by:
reactOnPopupMenuClosedByUser in interface com.softwareag.cis.workplace.IMFWorkplaceEventListener

getActivity

public static com.softwareag.cis.workplace.IMFWorkplaceActivity getActivity(com.softwareag.cis.workplace.IMFWorkplace wp,
                                                                            int selectedActivity)
The CIS framework provides for multiple activivities running in parallel This function obtains the visible activity at the given position.

Parameters:
wp - - workplace
selectedActivity - - position
Returns:
Returns the visible activity which is at the given position.

getCurrentActivity

public static com.softwareag.cis.workplace.IMFWorkplaceActivity getCurrentActivity(com.softwareag.cis.workplace.IMFWorkplace wp)
The CIS framework provides for multiple activivities running in parallel This function obtains the visible activity

Parameters:
wp -
Returns:
Returns the currently visible activity

executeIfCurrentActivityAllowedToLooseFocus

public static boolean executeIfCurrentActivityAllowedToLooseFocus(com.softwareag.cis.workplace.IMFWorkplace wp,
                                                                  com.softwareag.cis.server.util.ICommand cmd)
Execute given command if current activity may be closed or we may switch to another activity

Returns:
true if current activity may be closed or we may switch to another activity

allowCloseAllActivities

public static boolean allowCloseAllActivities(com.softwareag.cis.workplace.IMFWorkplace wp,
                                              com.softwareag.cis.server.util.ICommand cmd)
Execute given command if allowed to close all activities

Returns:
true iff allowed to close all activities

updateWorkplace

public static void updateWorkplace(com.softwareag.cis.workplace.MFWorkplaceAdapter workplaceAdapter)
Refreshes some adapters and causes some frame targets to refresh their data content


reactOnAddPageToWorkplace

public boolean reactOnAddPageToWorkplace(com.softwareag.cis.workplace.IMFWorkplace wp,
                                         com.softwareag.cis.workplace.IMFWorkplaceActivity actOld,
                                         com.softwareag.cis.workplace.IMFWorkplaceActivity actNew)
This method is called if a workplace activity is to be started. Use method "reactOnSwitchSelectedActivity" in order to get notification if an already started activity is brought back to front. You either allow to start the activity (return "true") or you raise and veto (return "false").

Specified by:
reactOnAddPageToWorkplace in interface com.softwareag.cis.workplace.IMFWorkplaceEventListener2
Parameters:
wp - reference to the workplace management
actOld - handle to currently selected workplace activities. May be null!
actNew - handle to activity to start.
Returns:
Return true if to start the activity - return false to raise a veto (start of new activity is skipped)

reactOnRemovePageFromWorkplace

public void reactOnRemovePageFromWorkplace(com.softwareag.cis.workplace.IMFWorkplace wp,
                                           com.softwareag.cis.workplace.IMFWorkplaceActivity actOld)
This method is called after removing a workplace activity (i.e. after executing IMFWorkplace.removePageFromWorkplace).

Specified by:
reactOnRemovePageFromWorkplace in interface com.softwareag.cis.workplace.IMFWorkplaceEventListener2
Parameters:
wp - Reference to the workplace management
actOld - Removed workplace activity.

reactOnMaxNumberOfWorkplaceActivitiesReached

public boolean reactOnMaxNumberOfWorkplaceActivitiesReached(com.softwareag.cis.workplace.IMFWorkplace wp,
                                                            java.lang.String pageFileName,
                                                            java.lang.String pageTitle)
Method is called if the maximum number of open activities has been reached and the user tries to open next activity. Method tries to close oldest activity (following the FIFO principle). If this activity has pending changes a prompt popup is coming up asking the user to save or revert changes.

Specified by:
reactOnMaxNumberOfWorkplaceActivitiesReached in interface com.softwareag.cis.workplace.IMFWorkplaceEventListener2
Parameters:
wp - handle to CIS workplace
pageFileName - URL of the new activity the user wants to start
pageTitle - Display string of the new activity the user wants to start