com.cosylab.vdct.plugins
Class PopupPluginRecordHandlerExample

java.lang.Object
  extended by com.cosylab.vdct.plugins.PopupPluginRecordHandlerExample
All Implemented Interfaces:
Plugin, ContextPopupPlugin

public class PopupPluginRecordHandlerExample
extends java.lang.Object
implements ContextPopupPlugin

Example of simple context sensitive popup menu handling record objects. Add the following line to the ${user.home}/.vdctplugins.xml file:

                <plugin class="com.cosylab.vdct.plugins.PopupPluginRecordHandlerExample" autostart="true" />
 
Creation date: (8.12.2001 13:29:26)

Author:
Matej Sekoranja

Field Summary
protected  com.cosylab.vdct.plugins.PopupPluginRecordHandlerExample.PopupMenuHandler popupMenuHandler
           
 
Constructor Summary
PopupPluginRecordHandlerExample()
           
 
Method Summary
 void destroy()
          Insert the method's description here.
 java.lang.String getAuthor()
          Insert the method's description here.
 java.lang.String getDescription()
          Insert the method's description here.
 java.util.Vector getItems(java.util.Vector selectedObjects)
          This metod is called each time request of popup menu is gived to VisualDCT.
 java.lang.String getName()
          Insert the method's description here.
 java.lang.String getVersion()
          Insert the method's description here.
 void init(java.util.Properties properties, PluginContext context)
          Insert the method's description here.
 void start()
          Insert the method's description here.
 void stop()
          Insert the method's description here.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

popupMenuHandler

protected com.cosylab.vdct.plugins.PopupPluginRecordHandlerExample.PopupMenuHandler popupMenuHandler
Constructor Detail

PopupPluginRecordHandlerExample

public PopupPluginRecordHandlerExample()
Method Detail

destroy

public void destroy()
Insert the method's description here. Creation date: (8.12.2001 13:29:26)

Specified by:
destroy in interface Plugin
Parameters:
-

getAuthor

public java.lang.String getAuthor()
Insert the method's description here. Creation date: (8.12.2001 13:29:26)

Specified by:
getAuthor in interface Plugin
Returns:
java.lang.String

getDescription

public java.lang.String getDescription()
Insert the method's description here. Creation date: (8.12.2001 13:29:26)

Specified by:
getDescription in interface Plugin
Returns:
java.lang.String

getName

public java.lang.String getName()
Insert the method's description here. Creation date: (8.12.2001 13:29:26)

Specified by:
getName in interface Plugin
Parameters:
-
Returns:

getVersion

public java.lang.String getVersion()
Insert the method's description here. Creation date: (8.12.2001 13:29:26)

Specified by:
getVersion in interface Plugin
Returns:
java.lang.String

init

public void init(java.util.Properties properties,
                 PluginContext context)
Insert the method's description here. Creation date: (8.12.2001 13:29:26)

Specified by:
init in interface Plugin
Parameters:
-

start

public void start()
Insert the method's description here. Creation date: (8.12.2001 13:29:26)

Specified by:
start in interface Plugin
Parameters:
-

stop

public void stop()
Insert the method's description here. Creation date: (8.12.2001 13:29:26)

Specified by:
stop in interface Plugin
Parameters:
-

getItems

public java.util.Vector getItems(java.util.Vector selectedObjects)
Description copied from interface: ContextPopupPlugin
This metod is called each time request of popup menu is gived to VisualDCT. PluginPopupManager then queries all popup plugins, asking them to return list of menus or menu items to be added to the default list of popup items. Plugin can also return null value, if there is no action available to the given list of selected objects. Creation date: (8.12.2001 12:45:31)

Specified by:
getItems in interface ContextPopupPlugin
Parameters:
selectedObjects - List of selected elements. All elements inhereit from com.cosylab.vdct.graphics.objects.Selectable interface. Typical there are objects:
  • com.cosylab.vdct.graphics.objects.Group - group
  • com.cosylab.vdct.graphics.objects.Record - record
  • com.cosylab.vdct.graphics.objects.Template - template instance
  • com.cosylab.vdct.graphics.objects.Connector - connector
  • ...
If list is null, then popup over empty workspace is issued.
Returns:
java.util.Vector list of javax.swing.JMenuItems and/or javax.swing.JMenu and/or javax.swing.JSeparator objects to be added to the default list of popup items. Can also be null.
See Also:
ContextPopupPlugin.getItems(Vector)