ilog.views.diagrammer.application
Class IlvDiagrammerAction.FileAction

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by ilog.views.util.swing.context.ComponentAction
          extended by ilog.views.diagrammer.application.IlvDiagrammerAction
              extended by ilog.views.diagrammer.application.IlvDiagrammerAction.FileAction
All Implemented Interfaces:
ActionListener, Serializable, Cloneable, EventListener, Action
Enclosing class:
IlvDiagrammerAction

public abstract static class IlvDiagrammerAction.FileAction
extends IlvDiagrammerAction

A base class for I/O actions

Since:
JViews 7.5
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class ilog.views.diagrammer.application.IlvDiagrammerAction
IlvDiagrammerAction.ErrorHandler, IlvDiagrammerAction.FileAction, IlvDiagrammerAction.Handler, IlvDiagrammerAction.StatusEvent, IlvDiagrammerAction.StatusListener, IlvDiagrammerAction.ToggleAction
 
Field Summary
 
Fields inherited from class ilog.views.diagrammer.application.IlvDiagrammerAction
_new, about, ABOUT_APPLICATION_NAME, alignBottom, alignHorizontalCenter, alignLeft, alignRight, alignTop, alignVerticalCenter, autoEditLabel, autoLabelLayout, autoLinkLayout, autoNodeLayout, callBuilder, clearPrintArea, close, copy, createLink, createNode, cut, delete, distributeHorizontally, distributeVertically, duplicate, editing, editLabel, exit, fitToContents, grid, gridSpacing, group, help, layoutAllNodes, layoutSelectedNodes, open, openStyleSheet, pageSetup, pan, paste, printPreview, printToBitmap, printWithDialog, printWithoutDialog, read, redo, refresh, resetZoom, resizing, save, saveAs, select, selectAll, setPrintArea, stickyModes, undo, ungroup, zoom, zoomIn, zoomOut
 
Fields inherited from class ilog.views.util.swing.context.ComponentAction
hideToolbarButtonBordersOnOceanTheme
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
IlvDiagrammerAction.FileAction(String prefix, ResourceBundle bundle, boolean save, String[] suffixes, String[] descriptionKeys)
          Creates a File action.
 
Method Summary
protected  boolean isEnabled(IlvDiagrammer diagrammer)
          This method is called to determine whether this action is currently enabled.
protected abstract  void openOrSave(ActionEvent e, IlvDiagrammer diagrammer, URL url)
           
 void perform(ActionEvent e, IlvDiagrammer diagrammer)
          This method is called when the action is performed.
 void setDescriptionKeys(String[] newDescriptions)
          Sets description keys for suffixes in file selector dialog.
 void setSuffixes(String[] newSuffixes)
          Sets favorite suffixes for file selector dialog.
 
Methods inherited from class ilog.views.diagrammer.application.IlvDiagrammerAction
addActionToUpdate, addStatusListener, call, chooseFile, getActionFileChooser, getDefaultResourceBundle, getDefaultSelectedFile, getErrorHandler, getFileChooserDirectory, getString, isEnabled, isSelected, isSelected, perform, removeActionToUpdate, removeStatusListener, setDefaultSelectedFile, setErrorHandler, setFileChooserDirectory, setHandler, update, update, updateActions
 
Methods inherited from class ilog.views.util.swing.context.ComponentAction
actionPerformed, addActionToUpdate, addPropertyChangeListener, addStatusListener, call, clone, createMenuItem, createToolBarButton, delayedUpdateActions, error, fireActionFinished, fireActionStarted, getActionErrorHandler, getPrefix, getResourceBundle, getSmallIconSize, init, isSelectable, isSelected, removeActions, removeActionToUpdate, removeStatusListener, setActionErrorHandler, setHandler, setSelected, setSmallIconSize, updateActions
 
Methods inherited from class javax.swing.AbstractAction
firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlvDiagrammerAction.FileAction

public IlvDiagrammerAction.FileAction(String prefix,
                                      ResourceBundle bundle,
                                      boolean save,
                                      String[] suffixes,
                                      String[] descriptionKeys)
Creates a File action.

Parameters:
prefix -
bundle -
save -
suffixes -
descriptionKeys -
Method Detail

setSuffixes

public void setSuffixes(String[] newSuffixes)
Sets favorite suffixes for file selector dialog.

Parameters:
newSuffixes - the new suffixes

setDescriptionKeys

public void setDescriptionKeys(String[] newDescriptions)
Sets description keys for suffixes in file selector dialog.

Parameters:
newDescriptions - the description keys

perform

public void perform(ActionEvent e,
                    IlvDiagrammer diagrammer)
             throws Exception
Description copied from class: IlvDiagrammerAction
This method is called when the action is performed. This is the method that must be overridden by subclasses of IlvDiagrammerAction to implement the action.

This method should not be called directly. If you need to call an action in your code, use the IlvDiagrammerAction.call(ilog.views.diagrammer.IlvDiagrammer) method instead.

Specified by:
perform in class IlvDiagrammerAction
Parameters:
e - The action event that caused this action to be performed.
diagrammer - The IlvDiagrammer instance on which the action is to be performed (may be null if there is no current diagram component).
Throws:
Exception - When an error occurs while performing the action.

openOrSave

protected abstract void openOrSave(ActionEvent e,
                                   IlvDiagrammer diagrammer,
                                   URL url)
                            throws Exception
Parameters:
e -
diagrammer -
url -
Throws:
Exception

isEnabled

protected boolean isEnabled(IlvDiagrammer diagrammer)
                     throws Exception
Description copied from class: IlvDiagrammerAction
This method is called to determine whether this action is currently enabled.

Specified by:
isEnabled in class IlvDiagrammerAction
Parameters:
diagrammer - The IlvDiagrammer instance on which the action is to be performed (may be null if there is no current diagram component).
Returns:
true if action is enabled
Throws:
Exception - When an error occurs while getting the state of the action.


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.