org.eclipse.emf.compare.ui.export
Class ExportMenu

java.lang.Object
  extended by org.eclipse.core.commands.common.EventManager
      extended by org.eclipse.jface.action.AbstractAction
          extended by org.eclipse.jface.action.Action
              extended by org.eclipse.emf.compare.ui.AbstractCompareAction
                  extended by org.eclipse.emf.compare.ui.export.ExportMenu
All Implemented Interfaces:
org.eclipse.jface.action.IAction, org.eclipse.jface.action.IMenuCreator

public class ExportMenu
extends AbstractCompareAction
implements org.eclipse.jface.action.IMenuCreator

This implementation of AbstractCompareAction is used to create the structure viewer's "export as" action.


Field Summary
protected  org.eclipse.swt.widgets.Control parentControl
          Control under which the menu must be created.
protected  ModelStructureMergeViewer parentViewer
          Viewer currently displaying this menu.
 
Fields inherited from interface org.eclipse.jface.action.IAction
AS_CHECK_BOX, AS_DROP_DOWN_MENU, AS_PUSH_BUTTON, AS_RADIO_BUTTON, AS_UNSPECIFIED, CHECKED, DESCRIPTION, ENABLED, HANDLED, IMAGE, RESULT, TEXT, TOOL_TIP_TEXT
 
Constructor Summary
ExportMenu(org.eclipse.swt.widgets.Control parent, ModelStructureMergeViewer owner)
          This default constructor will instantiate an action given the bundle resources prefixed by "action.save".
 
Method Summary
 void addActionToMenu(org.eclipse.jface.action.Action action)
          This will add the given action to this action's menu.
 void dispose()
          
 void enableSave(boolean enabled)
          This will switch the enable state of saveAction.
 java.util.Set<org.eclipse.emf.compare.ui.export.ExportActionDescriptor> getActions(java.lang.String fileExtension)
          This will return all actions from the cached actions that apply to the given fileExtension.
 java.lang.String getComparedModelsExtension()
          Returns the file extension of the compared models.
 org.eclipse.swt.widgets.Menu getMenu(org.eclipse.swt.widgets.Control parent)
          
 org.eclipse.swt.widgets.Menu getMenu(org.eclipse.swt.widgets.Menu parent)
          
 void run()
          If this action is triggered, it'll run the default save action.
 
Methods inherited from class org.eclipse.jface.action.Action
convertAccelerator, convertAccelerator, findKeyCode, findKeyString, findModifier, findModifierString, getAccelerator, getActionDefinitionId, getDescription, getDisabledImageDescriptor, getHelpListener, getHoverImageDescriptor, getId, getImageDescriptor, getMenuCreator, getStyle, getText, getToolTipText, isChecked, isEnabled, isHandled, notifyResult, removeAcceleratorText, removeMnemonics, runWithEvent, setAccelerator, setActionDefinitionId, setChecked, setDescription, setDisabledImageDescriptor, setEnabled, setHelpListener, setHoverImageDescriptor, setId, setImageDescriptor, setMenuCreator, setText, setToolTipText
 
Methods inherited from class org.eclipse.jface.action.AbstractAction
addPropertyChangeListener, firePropertyChange, firePropertyChange, removePropertyChangeListener
 
Methods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.jface.action.IAction
addPropertyChangeListener, removePropertyChangeListener
 

Field Detail

parentControl

protected final org.eclipse.swt.widgets.Control parentControl
Control under which the menu must be created.


parentViewer

protected final ModelStructureMergeViewer parentViewer
Viewer currently displaying this menu.

Constructor Detail

ExportMenu

public ExportMenu(org.eclipse.swt.widgets.Control parent,
                  ModelStructureMergeViewer owner)
This default constructor will instantiate an action given the bundle resources prefixed by "action.save".

Parameters:
parent - Control under which this Action's menu must be created.
owner - The viewer currently displaying this menu.
Method Detail

addActionToMenu

public void addActionToMenu(org.eclipse.jface.action.Action action)
This will add the given action to this action's menu.

Parameters:
action - Action to add to this action's menu.

dispose

public void dispose()

Specified by:
dispose in interface org.eclipse.jface.action.IMenuCreator
See Also:
IMenuCreator.dispose()

enableSave

public void enableSave(boolean enabled)
This will switch the enable state of saveAction.

Parameters:
enabled - True if the action must be enabled, False otherwise

getActions

public java.util.Set<org.eclipse.emf.compare.ui.export.ExportActionDescriptor> getActions(java.lang.String fileExtension)
This will return all actions from the cached actions that apply to the given fileExtension.

Parameters:
fileExtension - File extension which we seel actions for.
Returns:
All actions from the cached actions that apply to the given fileExtension.
See Also:
ALL_EXTENSIONS, getComparedModelsExtension()

getComparedModelsExtension

public java.lang.String getComparedModelsExtension()
Returns the file extension of the compared models. If the extensions aren't the same, returns .

Returns:
The file extension of the compared models.

getMenu

public org.eclipse.swt.widgets.Menu getMenu(org.eclipse.swt.widgets.Control parent)

Specified by:
getMenu in interface org.eclipse.jface.action.IMenuCreator
See Also:
IMenuCreator.getMenu(org.eclipse.swt.widgets.Control)

getMenu

public org.eclipse.swt.widgets.Menu getMenu(org.eclipse.swt.widgets.Menu parent)

Specified by:
getMenu in interface org.eclipse.jface.action.IMenuCreator
See Also:
IMenuCreator.getMenu(org.eclipse.swt.widgets.Menu)

run

public void run()
If this action is triggered, it'll run the default save action.

Specified by:
run in interface org.eclipse.jface.action.IAction
Specified by:
run in class AbstractCompareAction
See Also:
AbstractCompareAction.run()

Copyright 2006 IBM Corporation and others.
All Rights Reserved.