Extended Functions in the Application Designer Workplace

The previous section covered the "normal usage mode" of the Application Designer workplace. But there are extended functions allowing you to more interactively operate with the Application Designer workplace.

These functions include:

  • Drag-and-drop interface: you can drag and drop icons within the hierarchy of the workplace. You can drop information that was dragged from any content page into the workplace.

  • Right mouse button interface on workplace nodes.

These functions allow the users to arrange their workplace settings (e.g. functions that are part of their workplace) in a simple way on their own.

This document covers the following topics:


Interface IMFWorkplaceEventListener

The base of the extended functions is the interface com.softwareag.cis.workplace.IMFWorkplaceEventListener. The interface contains methods that are called on certain events. The most important methods are:

  • reactOnContextMenuRequest
    This method is called when a user presses the right mouse button on a tree node of the workplace. Your implementation can build up a context menu - just as normal context menus are built up inside the tree management.

  • reactOnDrop
    This method is called when the user performes a drag-and-drop operation inside the workplace. Your implementation may copy the dragged nodes below the dropped node or may open a pop-up menu in which the user is asked about what to do with the dragged items.

  • reactOnDropGeneric
    This method is called when the user performes a drag-and-drop operation from any DROPICON control that is part of content pages.

The implementation of the interface is completely "yours". Use the workplace interface you got to know in the previous section to manipulate the workplace, e.g. to access the currently shown tree and to manipulate it.

An instance of the workplace event handler is passed by calling the method registerMFWorkplaceEventListener inside the MFWorkplaceInfo class:

MFWorkplaceInfo workplaceInfo = new MFWorkplaceInfo("/HTMLBasedGUI/empty.html",
                                             "../softwareag/styles/CIS_DEFAULT.css");        
workplaceInfo.setSynchTabNavigation(true);
workplaceInfo.registerMFWorkplaceEventListener(new XYZ(...));        

See the Java API documentation for detailed information.

Example

Among other features, the Application Designer demo workplace framework provides the following:

  • Right mouse button click on a workplace menu item (copy, cut, paste, etc.).

  • Drag-and-drop within the workplace menu (to move menu items).

Have a look at the event listener source coding. You can find it in your installation at:

<installdir>/cis/cisdemos/src/com/softwareag/cis/demoworkplace/CISDemoWorkplaceEventListener