sample.client
Class SampleClientPlugin

java.lang.Object
  extended by sample.client.SampleClientPlugin
All Implemented Interfaces:
PluginHook, GridClientPluginProvider

public class SampleClientPlugin
extends Object
implements GridClientPluginProvider, PluginHook

Grid client plugin for the sample service. This plugin extends the Grid client to allow it to use the Grid sample service. It registers the objects relating to the service and also extends the client's Swing interface to add menu actions for these resources.

See Also:
for details of the client's plugin system

Constructor Summary
SampleClientPlugin()
           
 
Method Summary
 void addProperties(ResourcePropertiesPanel panel)
          Create a Panel to display a resource
 boolean doDoubleClick(ConversationBrowser browser, StorableInStateRepository resource)
          Do a double click on a resource.
 boolean doDragDrop(ConversationBrowser browser, Object source, Object target)
          Object 'source' has been dragged on to 'target'.
 Icon getTreeIcon(ConversationBrowser browser, StorableInStateRepository resource)
          Get an icon representing this resource
 void initPlugin()
          Initialise the plugin.
 void showPopupMenu(ConversationBrowser browser, JPopupMenu menu, Object[] items)
          Add extra menu items.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SampleClientPlugin

public SampleClientPlugin()
Method Detail

initPlugin

public void initPlugin()
Description copied from interface: GridClientPluginProvider
Initialise the plugin. At start-up, the Grid client calls this method on each plugin to initialise it.

The plugin should register itself with other components as appropriate.

Specified by:
initPlugin in interface GridClientPluginProvider
See Also:
RemoteServiceImpl.registerPortType(javax.xml.namespace.QName, Class), ImplementationFactory.registerImplementation(Class, Class), ConversationBrowser.addPlugin(uk.ac.soton.ecs.iam.grid.client.swing.PluginHook)

showPopupMenu

public void showPopupMenu(ConversationBrowser browser,
                          JPopupMenu menu,
                          Object[] items)
Description copied from interface: PluginHook
Add extra menu items. This is called when the user opens the popup menu. All selected items have the same class.

Specified by:
showPopupMenu in interface PluginHook
Parameters:
browser - the browser opening the menu
menu - the menu being created
items - the objects currently selected

addProperties

public void addProperties(ResourcePropertiesPanel panel)
Description copied from interface: PluginHook
Create a Panel to display a resource

Specified by:
addProperties in interface PluginHook

doDoubleClick

public boolean doDoubleClick(ConversationBrowser browser,
                             StorableInStateRepository resource)
Do a double click on a resource.

Specified by:
doDoubleClick in interface PluginHook
Returns:
true if the click was handled

getTreeIcon

public Icon getTreeIcon(ConversationBrowser browser,
                        StorableInStateRepository resource)
Description copied from interface: PluginHook
Get an icon representing this resource

Specified by:
getTreeIcon in interface PluginHook
Returns:
the icon

doDragDrop

public boolean doDragDrop(ConversationBrowser browser,
                          Object source,
                          Object target)
Description copied from interface: PluginHook
Object 'source' has been dragged on to 'target'. Source and target are often, but not always, of type StorableInStateRepository.

Specified by:
doDragDrop in interface PluginHook
source - the item being dropped, this may be another object in the repository, a URI, a local File, etc.
target - the item which source was dropped on
Returns:
true if the drag has been handled, or false to try other handlers


Copyright © 2001-2007 University of Southampton IT Innovation Centre. All Rights Reserved.