com.lightdev.app.shtm
Class FrmMain.SHTMLFileCloseAction

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by com.lightdev.app.shtm.FrmMain.SHTMLFileCloseAction
All Implemented Interfaces:
SHTMLAction, java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action
Enclosing class:
FrmMain

public class FrmMain.SHTMLFileCloseAction
extends javax.swing.AbstractAction
implements SHTMLAction

close a document.

the action takes into account whether or not a document needs to be saved.

By having the actual closing task in a separate public method of this action, the close functionality can be shared with action 'close all' or others that might need it.

See Also:
Serialized Form

Field Summary
 
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
FrmMain.SHTMLFileCloseAction()
          constructor
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent ae)
          close the currently active document, if there is one
 void closeDocument(int index, java.awt.event.ActionEvent ae, boolean ignoreChanges)
          close a document by its tab index.
 void getProperties()
          this method should be called from the constructor of each SHTMLAction and can be used to get action properties from a resource file
 void update()
          update the state of this action
 
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
 
Methods inherited from interface javax.swing.Action
addPropertyChangeListener, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 

Constructor Detail

FrmMain.SHTMLFileCloseAction

public FrmMain.SHTMLFileCloseAction()
constructor

Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent ae)
close the currently active document, if there is one

Specified by:
actionPerformed in interface java.awt.event.ActionListener

closeDocument

public void closeDocument(int index,
                          java.awt.event.ActionEvent ae,
                          boolean ignoreChanges)
close a document by its tab index.

The method takes care of saving the document if necessary prior to closing.

Parameters:
the - tab index number of the document in the tabbed pane.

update

public void update()
update the state of this action

Specified by:
update in interface SHTMLAction

getProperties

public void getProperties()
Description copied from interface: SHTMLAction
this method should be called from the constructor of each SHTMLAction and can be used to get action properties from a resource file

Specified by:
getProperties in interface SHTMLAction