com.tensegrity.gui.swt.repository
Class ActionSwtRepositoryItem.ClickActionProvider

java.lang.Object
  extended bycom.tensegrity.gui.swt.repository.ActionSwtRepositoryItem.ClickActionProvider
Enclosing class:
ActionSwtRepositoryItem

public static class ActionSwtRepositoryItem.ClickActionProvider
extends java.lang.Object

This class allows, by mean of inheritance, to customize the application behaviour when a left or right mouse click is performed upon repository items. By default right clicking over a repository item has the same effect as left clicking on it, but sub-classes simply need to override the rightClicked(ActionSwtRepositoryItem, MouseEvent) method in order, for instance, to display a context menu instead.


Constructor Summary
ActionSwtRepositoryItem.ClickActionProvider()
           Default constructor.
 
Method Summary
 boolean actionEnabled(ActionSwtRepositoryItem item)
          Returns true if the Command associated to item is enabled, false otherwise.
 void leftClicked(ActionSwtRepositoryItem item, org.eclipse.swt.events.MouseEvent e)
          Called when a mouse left click has been performed on the repository item associated to item.
 void rightClicked(ActionSwtRepositoryItem item, org.eclipse.swt.events.MouseEvent e)
          Called when a mouse right click has been performed on the repository item associated to item.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActionSwtRepositoryItem.ClickActionProvider

public ActionSwtRepositoryItem.ClickActionProvider()

Default constructor.

Method Detail

leftClicked

public void leftClicked(ActionSwtRepositoryItem item,
                        org.eclipse.swt.events.MouseEvent e)
Called when a mouse left click has been performed on the repository item associated to item. By default, forwards its call to ActionSwtRepositoryItem.performAction().

Parameters:
item - the ActionSwtRepositoryItem reacting on the passed MouseEvent
e - the left click MouseEvent which has to be processed.

rightClicked

public void rightClicked(ActionSwtRepositoryItem item,
                         org.eclipse.swt.events.MouseEvent e)
Called when a mouse right click has been performed on the repository item associated to item. By default, forwards its call to ActionSwtRepositoryItem.invokeLeftClickAction(MouseEvent).

Parameters:
item - the ActionSwtRepositoryItem reacting on the passed MouseEvent
e - the right click MouseEvent which has to be processed.

actionEnabled

public boolean actionEnabled(ActionSwtRepositoryItem item)
Returns true if the Command associated to item is enabled, false otherwise. Subclasses can override this to disable item according to the state of the application, document, etc.

Parameters:
item - the ActionSwtRepositoryItem associated with this ClickActionProvider
Returns:
true if the Command associated to item is enabled, false otherwise


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.