net.sourceforge.squirrel_sql.plugins.refactoring.actions
Class AbstractRefactoringAction

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by net.sourceforge.squirrel_sql.fw.gui.action.BaseAction
          extended by net.sourceforge.squirrel_sql.client.action.SquirrelAction
              extended by net.sourceforge.squirrel_sql.plugins.refactoring.actions.AbstractRefactoringAction
All Implemented Interfaces:
ActionListener, Serializable, Cloneable, EventListener, Action, IObjectTreeAction
Direct Known Subclasses:
AddAutoIncrementAction, AddColumnAction, AddForeignKeyAction, AddIndexAction, AddLookupTableAction, AddPrimaryKeyAction, AddSequenceAction, AddUniqueConstraintAction, AddViewAction, DropColumnAction, DropForeignKeyAction, DropIndexTableAction, DropPrimaryKeyAction, DropSelectedTablesAction, DropSequenceAction, DropUniqueConstraintAction, DropViewAction, MergeColumnAction, MergeTableAction, ModifyColumnAction, ModifySequenceAction, RenameTableAction, RenameViewAction

public abstract class AbstractRefactoringAction
extends SquirrelAction
implements IObjectTreeAction

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class net.sourceforge.squirrel_sql.fw.gui.action.BaseAction
BaseAction.IBaseActionPropertyNames
 
Field Summary
protected  ISession _session
          Current session.
protected  IObjectTreeAPI _tree
          Current object tree.
 
Fields inherited from class net.sourceforge.squirrel_sql.client.action.SquirrelAction
_app
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
AbstractRefactoringAction(IApplication app, Resources rsrc)
           
 
Method Summary
 void actionPerformed(ActionEvent evt)
           
protected abstract  ICommand getCommand(IDatabaseObjectInfo[] info)
          Returns the command to be executed when this action is invoked.
protected abstract  String getErrorMessage()
          Subclasses must override this to provide a custom error message when the user chooses to execcute an action on multiple selected objects, when the action can only be executed on a single object.
protected abstract  boolean isMultipleObjectAction()
          Returns a boolean value indicating whether or not this action can be executed against multiple objects.
 void setObjectTree(IObjectTreeAPI tree)
           
 
Methods inherited from class net.sourceforge.squirrel_sql.client.action.SquirrelAction
getApplication, getKeyStroke
 
Methods inherited from class net.sourceforge.squirrel_sql.fw.gui.action.BaseAction
getParentFrame
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, 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
 

Field Detail

_session

protected ISession _session
Current session.


_tree

protected IObjectTreeAPI _tree
Current object tree.

Constructor Detail

AbstractRefactoringAction

public AbstractRefactoringAction(IApplication app,
                                 Resources rsrc)
Method Detail

actionPerformed

public void actionPerformed(ActionEvent evt)
Specified by:
actionPerformed in interface ActionListener
See Also:
ActionListener.actionPerformed(java.awt.event.ActionEvent)

getCommand

protected abstract ICommand getCommand(IDatabaseObjectInfo[] info)
Returns the command to be executed when this action is invoked.

Parameters:
info - the selected object(s)
Returns:
the ICommand implementation to execute

isMultipleObjectAction

protected abstract boolean isMultipleObjectAction()
Returns a boolean value indicating whether or not this action can be executed against multiple objects.

Returns:
true if the user can execute this action against multiple slected objects; false otherwise.

getErrorMessage

protected abstract String getErrorMessage()
Subclasses must override this to provide a custom error message when the user chooses to execcute an action on multiple selected objects, when the action can only be executed on a single object.

Returns:
the error message to use for single-object actions

setObjectTree

public void setObjectTree(IObjectTreeAPI tree)
Specified by:
setObjectTree in interface IObjectTreeAction
See Also:
IObjectTreeAction.setObjectTree(net.sourceforge.squirrel_sql.client.session.IObjectTreeAPI)


Copyright © 2001-2011. All Rights Reserved.