org.argouml.ui
Class ActionExportXMI

java.lang.Object
  |
  +--javax.swing.AbstractAction
        |
        +--org.argouml.uml.ui.UMLAction
              |
              +--org.argouml.ui.ActionExportXMI
All Implemented Interfaces:
javax.swing.Action, java.awt.event.ActionListener, ArgoModule, java.lang.Cloneable, java.util.EventListener, Pluggable, PluggableMenu, java.io.Serializable

public final class ActionExportXMI
extends UMLAction
implements PluggableMenu

Exports the xmi of a project to a file choosen by the user.

See Also:
Serialized Form

Field Summary
private static Logger cat
          logger
private static ActionExportXMI instance
           
 
Fields inherited from class org.argouml.uml.ui.UMLAction
HAS_ICON, NO_ICON
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface org.argouml.application.api.PluggableMenu
KEY_ARRANGE, KEY_CREATE_DIAGRAMS, KEY_FILE_IMPORT, KEY_GENERATE, KEY_HELP, KEY_TOOLS, KEY_VIEW
 
Fields inherited from interface org.argouml.application.api.Pluggable
PLUGIN_PREFIX, PLUGIN_TITLE, PLUGIN_VENDOR
 
Fields inherited from interface org.argouml.application.api.ArgoModule
MODULEFILENAME, MODULEFILENAME_ALTERNATE
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
private ActionExportXMI()
          Constructor.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Perform the work the action is supposed to do.
 java.lang.Object[] buildContext(javax.swing.JMenuItem parentMenuItem, java.lang.String menuType)
          Helper to create a context recognized by Pluggable.inContext(Object[]).
static ActionExportXMI getInstance()
          Singleton instance method
 javax.swing.JMenuItem getMenuItem(java.lang.Object[] context)
          Return the JMenuItem controlled by the plugin under the specific context.
 java.lang.String getModuleAuthor()
          The module author.
 java.lang.String getModuleDescription()
          Textual description of the module.
 java.lang.String getModuleKey()
          The module identifying key
 java.lang.String getModuleName()
          Display name of the module.
 java.util.Vector getModulePopUpActions(java.util.Vector popUpActions, java.lang.Object context)
          Calls all modules to let them add to a popup menu.
 java.lang.String getModuleVersion()
          The module version.
 boolean inContext(java.lang.Object[] context)
          A function which allows a plug-in to decide if it is available under a specific context.
 boolean initializeModule()
          Method called when Argo is loading a module.
 boolean isModuleEnabled()
          Allows determination if a module is enabled or disabled
 void setModuleEnabled(boolean tf)
          Called to enable or disable a module programmatically.
 boolean shouldBeEnabled()
          Return true if this action should be available to the user.
 boolean shutdownModule()
          Method called when Argo is unloading a module.
 
Methods inherited from class org.argouml.uml.ui.UMLAction
getMnemonic, getShortcut, getValue, isEnabled, markNeedsSave, putValue, stripJunk, updateEnabled, updateEnabled
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cat

private static Logger cat
logger


instance

private static ActionExportXMI instance
Constructor Detail

ActionExportXMI

private ActionExportXMI()
Constructor.

Method Detail

getInstance

public static ActionExportXMI getInstance()
Singleton instance method

Returns:
the singleton instance

getMenuItem

public javax.swing.JMenuItem getMenuItem(java.lang.Object[] context)
Description copied from interface: PluggableMenu
Return the JMenuItem controlled by the plugin under the specific context. One menu plugin may control multiple menu items.

Specified by:
getMenuItem in interface PluggableMenu
Parameters:
context - array of objects as created by PluggableMenu.buildContext(JMenuItem, String).
Returns:
A JMenuItem object controlled by the plug-in.
See Also:
PluggableMenu.getMenuItem(java.lang.Object[])

buildContext

public java.lang.Object[] buildContext(javax.swing.JMenuItem parentMenuItem,
                                       java.lang.String menuType)
Description copied from interface: PluggableMenu
Helper to create a context recognized by Pluggable.inContext(Object[]).

Specified by:
buildContext in interface PluggableMenu
Parameters:
parentMenuItem - menu item
menuType - menu name
Returns:
the proper context array.
See Also:
PluggableMenu.buildContext(javax.swing.JMenuItem, String)

inContext

public boolean inContext(java.lang.Object[] context)
Description copied from interface: Pluggable
A function which allows a plug-in to decide if it is available under a specific context. One example of a plugin with multiple criteria is the PluggableMenu. PluggableMenu requires the first context to be a JMenuItem which wants the PluggableMenu attached to as the context, so that it can determine that it would attach to a menu. The second context is an internal (non-localized) description of the menu such as "File" or "View" so that the plugin can further decide.

Specified by:
inContext in interface Pluggable
Parameters:
context - An identification of the context. The interpretation of criteria is specific to the plug-in type, but must be consistent across that type. The plug-in must want to be exposed to all contexts.
Returns:
True if the plug-in wants to make itself available for this context, otherwise false.
See Also:
Pluggable.inContext(java.lang.Object[])

initializeModule

public boolean initializeModule()
Description copied from interface: ArgoModule
Method called when Argo is loading a module.

Specified by:
initializeModule in interface ArgoModule
Returns:
true if the module initialized properly.
See Also:
ArgoModule.initializeModule()

shutdownModule

public boolean shutdownModule()
Description copied from interface: ArgoModule
Method called when Argo is unloading a module.

Specified by:
shutdownModule in interface ArgoModule
Returns:
true if the module terminated properly.
See Also:
ArgoModule.shutdownModule()

setModuleEnabled

public void setModuleEnabled(boolean tf)
Description copied from interface: ArgoModule
Called to enable or disable a module programmatically.

Specified by:
setModuleEnabled in interface ArgoModule
Parameters:
tf - true to enable module, false to disable
See Also:
ArgoModule.setModuleEnabled(boolean)

isModuleEnabled

public boolean isModuleEnabled()
Description copied from interface: ArgoModule
Allows determination if a module is enabled or disabled

Specified by:
isModuleEnabled in interface ArgoModule
Returns:
true if the module is enabled, otherwise false
See Also:
ArgoModule.isModuleEnabled()

getModuleName

public java.lang.String getModuleName()
Description copied from interface: ArgoModule
Display name of the module.

Specified by:
getModuleName in interface ArgoModule
Returns:
the module name
See Also:
ArgoModule.getModuleName()

getModuleDescription

public java.lang.String getModuleDescription()
Description copied from interface: ArgoModule
Textual description of the module.

Specified by:
getModuleDescription in interface ArgoModule
Returns:
the module description
See Also:
ArgoModule.getModuleDescription()

getModuleVersion

public java.lang.String getModuleVersion()
Description copied from interface: ArgoModule
The module version. There is no specified format.

Specified by:
getModuleVersion in interface ArgoModule
Returns:
a string containing the module version
See Also:
ArgoModule.getModuleVersion()

getModuleAuthor

public java.lang.String getModuleAuthor()
Description copied from interface: ArgoModule
The module author.

Specified by:
getModuleAuthor in interface ArgoModule
Returns:
a string containing the module author
See Also:
ArgoModule.getModuleAuthor()

getModulePopUpActions

public java.util.Vector getModulePopUpActions(java.util.Vector popUpActions,
                                              java.lang.Object context)
Description copied from interface: ArgoModule
Calls all modules to let them add to a popup menu.

Specified by:
getModulePopUpActions in interface ArgoModule
Parameters:
popUpActions - Vector of actions
context - which the actions are valid for
See Also:
ArgoModule.getModulePopUpActions( Vector, Object)

getModuleKey

public java.lang.String getModuleKey()
Description copied from interface: ArgoModule
The module identifying key

Specified by:
getModuleKey in interface ArgoModule
Returns:
the string key the module uses to identify itself
See Also:
ArgoModule.getModuleKey()

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Description copied from class: UMLAction
Perform the work the action is supposed to do.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Overrides:
actionPerformed in class UMLAction
See Also:
ActionListener.actionPerformed(java.awt.event.ActionEvent)

shouldBeEnabled

public boolean shouldBeEnabled()
Description copied from class: UMLAction
Return true if this action should be available to the user. This method should examine the ProjectBrowser that owns it. Sublass implementations of this method should always call super.shouldBeEnabled first.

Overrides:
shouldBeEnabled in class UMLAction
Returns:
true if the action should be available.
See Also:
UMLAction.shouldBeEnabled()


ArgoUML © 1996-2004 (20040306)ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook