ca.sqlpower.architect.swingui.action
Class ProgressAction

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by ca.sqlpower.architect.swingui.action.AbstractArchitectAction
          extended by ca.sqlpower.architect.swingui.action.ProgressAction
All Implemented Interfaces:
java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action
Direct Known Subclasses:
ExportPlaypenToPDFAction, ExportSchemaAction

public abstract class ProgressAction
extends AbstractArchitectAction

This class creates an action with a built in progress dialog.

By default this class sets up a dialog with an indeterminate progress bar. The dialog automatically closes when the job finishes.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class ca.sqlpower.architect.swingui.action.AbstractArchitectAction
frame, playpen, session
 
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
ProgressAction(ArchitectSwingSession session, java.lang.String actionName, java.lang.String actionDescription)
           
ProgressAction(ArchitectSwingSession session, java.lang.String actionName, java.lang.String actionDescription, javax.swing.Icon icon)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Setup the dialog, monitors and worker.
abstract  void cleanUp(ca.sqlpower.util.MonitorableImpl monitor)
          Perform any cleanup code here
abstract  void doStuff(ca.sqlpower.util.MonitorableImpl monitor, java.util.Map<java.lang.String,java.lang.Object> properties)
          doStuff replaces the actionPerformed() call
abstract  java.lang.String getButtonText()
          Return the text that shows up on the dialog button
abstract  java.lang.String getDialogMessage()
          Gets the message that will be displayed on the progressbar
abstract  boolean setup(ca.sqlpower.util.MonitorableImpl monitor, java.util.Map<java.lang.String,java.lang.Object> properties)
          Setup the monitor and doStuff parameters before the progress dialog is shown.
 
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
 

Constructor Detail

ProgressAction

public ProgressAction(ArchitectSwingSession session,
                      java.lang.String actionName,
                      java.lang.String actionDescription,
                      javax.swing.Icon icon)

ProgressAction

public ProgressAction(ArchitectSwingSession session,
                      java.lang.String actionName,
                      java.lang.String actionDescription)
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Setup the dialog, monitors and worker. Classes that extend this class should use doStuff() and cleanUp()


getButtonText

public abstract java.lang.String getButtonText()
Return the text that shows up on the dialog button


setup

public abstract boolean setup(ca.sqlpower.util.MonitorableImpl monitor,
                              java.util.Map<java.lang.String,java.lang.Object> properties)
Setup the monitor and doStuff parameters before the progress dialog is shown.

Returns:
return true to continue with the action, return false to stop the action This could be used to respond to user choice to cancel the action

doStuff

public abstract void doStuff(ca.sqlpower.util.MonitorableImpl monitor,
                             java.util.Map<java.lang.String,java.lang.Object> properties)
doStuff replaces the actionPerformed() call


cleanUp

public abstract void cleanUp(ca.sqlpower.util.MonitorableImpl monitor)
Perform any cleanup code here


getDialogMessage

public abstract java.lang.String getDialogMessage()
Gets the message that will be displayed on the progressbar

Returns:
the message displayed on the dialog above the progressbar


Copyright © 2003-2007 SQL Power Group Inc. www.sqlpower.ca