TPTP 4.6.0 Platform Project
Internal API Specification

org.eclipse.hyades.ui.internal.editor.action
Class ActionHandlerListener

java.lang.Object
  extended by org.eclipse.hyades.ui.internal.editor.action.ActionHandlerListener
All Implemented Interfaces:
java.util.EventListener, org.eclipse.swt.events.MenuListener, org.eclipse.swt.internal.SWTEventListener, org.eclipse.ui.IPartListener
Direct Known Subclasses:
ProbekitEditor.MyActionHandlerListener

public class ActionHandlerListener
extends java.lang.Object
implements org.eclipse.ui.IPartListener, org.eclipse.swt.events.MenuListener


Field Summary
protected  EditAction copy
           
protected  EditAction cut
           
static ActionHandlerListener DEFAULT
           
protected  EditAction delete
           
protected  EditAction paste
           
protected  RevertAction revert
           
protected  EditAction selectAll
           
 
Constructor Summary
ActionHandlerListener()
          Constructor for ActionHandlerListener.
 
Method Summary
protected  void connectCutCopyPasteActions(org.eclipse.ui.IActionBars actionBars)
          Method connectCutCopyPasteActions.
protected  void connectCutCopyPasteActions(org.eclipse.ui.IWorkbenchPart part)
          Method connectCutCopyPasteActions.
 void connectPart(org.eclipse.ui.IWorkbenchPart part)
          Method connectPart.
protected  void createEditActions()
           
 void disableActions()
           
 void enableActions()
           
protected  boolean filter(org.eclipse.ui.IWorkbenchPart part)
           
protected  org.eclipse.ui.IActionBars getActionBars(org.eclipse.ui.IWorkbenchPart part)
           
 EditAction getCopyAction()
           
 EditAction getCutAction()
           
 EditAction getPasteAction()
           
protected  org.eclipse.ui.IWorkbenchPart getWorkbenchPart()
           
protected  boolean isRegisteredPart(org.eclipse.ui.IWorkbenchPart part)
          Method isRegisteredPart.
protected  boolean isValidFocusControl()
           
protected  void listenToWorkbenchWindow(org.eclipse.ui.IWorkbenchWindow workbenchWindow)
           
 void menuHidden(org.eclipse.swt.events.MenuEvent e)
          If the menu is hidden on a registered part, then renable all actions.
 void menuShown(org.eclipse.swt.events.MenuEvent e)
          Update the cut/copy/paste enablement (if a registered part is active) just before showing the edit menu.
 void partActivated(org.eclipse.ui.IWorkbenchPart part)
          Connect the cut/copy/paste actions if a registered part is activated.
 void partBroughtToTop(org.eclipse.ui.IWorkbenchPart part)
           
 void partClosed(org.eclipse.ui.IWorkbenchPart part)
           
 void partDeactivated(org.eclipse.ui.IWorkbenchPart part)
           
 void partOpened(org.eclipse.ui.IWorkbenchPart part)
           
protected  void registerPartId(org.eclipse.ui.IWorkbenchPart part)
           
protected  void updateActions()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT

public static final ActionHandlerListener DEFAULT

cut

protected EditAction cut

copy

protected EditAction copy

paste

protected EditAction paste

selectAll

protected EditAction selectAll

delete

protected EditAction delete

revert

protected RevertAction revert
Constructor Detail

ActionHandlerListener

public ActionHandlerListener()
Constructor for ActionHandlerListener.

Method Detail

createEditActions

protected void createEditActions()

listenToWorkbenchWindow

protected void listenToWorkbenchWindow(org.eclipse.ui.IWorkbenchWindow workbenchWindow)

getActionBars

protected org.eclipse.ui.IActionBars getActionBars(org.eclipse.ui.IWorkbenchPart part)

connectPart

public void connectPart(org.eclipse.ui.IWorkbenchPart part)
Method connectPart. Ensure we are already listening to the workbenchwindow, register the part's id and then connect the cut/copy/paste actions

Parameters:
part -

filter

protected boolean filter(org.eclipse.ui.IWorkbenchPart part)

isRegisteredPart

protected boolean isRegisteredPart(org.eclipse.ui.IWorkbenchPart part)
Method isRegisteredPart. Returns whether the part has already been registered as being a candidate for the generic cut/copy/paste actions.

Parameters:
part -
Returns:
boolean

registerPartId

protected void registerPartId(org.eclipse.ui.IWorkbenchPart part)

connectCutCopyPasteActions

protected void connectCutCopyPasteActions(org.eclipse.ui.IWorkbenchPart part)
Method connectCutCopyPasteActions. Connect the cut/copy/paste actions to the workbench part.

Parameters:
part -

connectCutCopyPasteActions

protected void connectCutCopyPasteActions(org.eclipse.ui.IActionBars actionBars)
Method connectCutCopyPasteActions. Only set the actionhandlers if there isn't one active for the appropriate action.

Parameters:
actionBars -

getWorkbenchPart

protected org.eclipse.ui.IWorkbenchPart getWorkbenchPart()

updateActions

protected void updateActions()

isValidFocusControl

protected boolean isValidFocusControl()

enableActions

public void enableActions()

partActivated

public void partActivated(org.eclipse.ui.IWorkbenchPart part)
Connect the cut/copy/paste actions if a registered part is activated.

Specified by:
partActivated in interface org.eclipse.ui.IPartListener
See Also:
IPartListener.partActivated(IWorkbenchPart)

partBroughtToTop

public void partBroughtToTop(org.eclipse.ui.IWorkbenchPart part)
Specified by:
partBroughtToTop in interface org.eclipse.ui.IPartListener
See Also:
IPartListener.partBroughtToTop(IWorkbenchPart)

partClosed

public void partClosed(org.eclipse.ui.IWorkbenchPart part)
Specified by:
partClosed in interface org.eclipse.ui.IPartListener
See Also:
IPartListener.partClosed(IWorkbenchPart)

partDeactivated

public void partDeactivated(org.eclipse.ui.IWorkbenchPart part)
Specified by:
partDeactivated in interface org.eclipse.ui.IPartListener
See Also:
IPartListener.partDeactivated(IWorkbenchPart)

partOpened

public void partOpened(org.eclipse.ui.IWorkbenchPart part)
Specified by:
partOpened in interface org.eclipse.ui.IPartListener
See Also:
IPartListener.partOpened(IWorkbenchPart)

menuHidden

public void menuHidden(org.eclipse.swt.events.MenuEvent e)
If the menu is hidden on a registered part, then renable all actions. This takes away the need for us to monitor the control traversal. If the individual action isn't applicable when it is invoked, the action becomes a no op.

Specified by:
menuHidden in interface org.eclipse.swt.events.MenuListener
See Also:
MenuListener.menuHidden(MenuEvent)

menuShown

public void menuShown(org.eclipse.swt.events.MenuEvent e)
Update the cut/copy/paste enablement (if a registered part is active) just before showing the edit menu.

Specified by:
menuShown in interface org.eclipse.swt.events.MenuListener
See Also:
MenuListener.menuShown(MenuEvent)

disableActions

public void disableActions()

getCutAction

public EditAction getCutAction()
Returns:
the cut action

getCopyAction

public EditAction getCopyAction()
Returns:
the copy action

getPasteAction

public EditAction getPasteAction()
Returns:
the paste action

TPTP 4.6.0 Platform Project
Internal API Specification