Package diva.gui
Class DefaultActions
- java.lang.Object
-
- diva.gui.DefaultActions
-
public class DefaultActions extends java.lang.ObjectA collection of static methods that create useful default actions.- Version:
- $Id$
- Author:
- John Reekie
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCLOSEstatic java.lang.StringCOPYstatic java.lang.StringCUTstatic java.lang.StringEXITstatic java.lang.StringNEWstatic java.lang.StringOPENstatic java.lang.StringPASTEstatic java.lang.StringPRINTstatic java.lang.StringQUITstatic java.lang.StringSAVEstatic java.lang.StringSAVE_AS
-
Constructor Summary
Constructors Constructor Description DefaultActions()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static javax.swing.ActioncloseAction(Application app)Create an action named "Close" that closes the current document.static javax.swing.ActioncopyAction(Application app)Create an action named "Copy" that copies the current selection from the current document and places it into the application's clipboard.static javax.swing.ActioncutAction(Application app)Create an action named "Cut" that cuts the current selection from the current document and places it into the application's clipboard.static javax.swing.ActionexitAction(Application app)Create an action named "Exit" that tries to close all the open documents, and if all of them are closed successfully, then exits Java.static javax.swing.ActionnewAction(Application app)Create an action named "New" that creates a new document.static javax.swing.ActionopenAction(Application app)Create an action named "Open" that opens a new document.static javax.swing.ActionpasteAction(Application app)Create an action named "Paste" that pastes the current selection from the current document and places it into the application's clipboard.static javax.swing.ActionprintAction(Application app)Create an action named "Print" that prints the current document to the printer, if it implements the Printable or Pageable interface.static javax.swing.ActionquitAction(Application app)Deprecated.The standard windows term is "Exit," so use exitAction()static javax.swing.ActionsaveAction(Application app)Create an action named "Save" that saves the current document.static javax.swing.ActionsaveAsAction(Application app)Create an action named "Save As" that saves the current document to a different location.
-
-
-
Field Detail
-
COPY
public static final java.lang.String COPY
- See Also:
- Constant Field Values
-
CLOSE
public static final java.lang.String CLOSE
- See Also:
- Constant Field Values
-
CUT
public static final java.lang.String CUT
- See Also:
- Constant Field Values
-
EXIT
public static final java.lang.String EXIT
- See Also:
- Constant Field Values
-
NEW
public static final java.lang.String NEW
- See Also:
- Constant Field Values
-
OPEN
public static final java.lang.String OPEN
- See Also:
- Constant Field Values
-
PASTE
public static final java.lang.String PASTE
- See Also:
- Constant Field Values
-
PRINT
public static final java.lang.String PRINT
- See Also:
- Constant Field Values
-
QUIT
public static final java.lang.String QUIT
- See Also:
- Constant Field Values
-
SAVE
public static final java.lang.String SAVE
- See Also:
- Constant Field Values
-
SAVE_AS
public static final java.lang.String SAVE_AS
- See Also:
- Constant Field Values
-
-
Method Detail
-
copyAction
public static javax.swing.Action copyAction(Application app)
Create an action named "Copy" that copies the current selection from the current document and places it into the application's clipboard. If there is no current document, or the application does not have a clipboard, do nothing.
-
closeAction
public static javax.swing.Action closeAction(Application app)
Create an action named "Close" that closes the current document. If there is no current document, do nothing.
-
cutAction
public static javax.swing.Action cutAction(Application app)
Create an action named "Cut" that cuts the current selection from the current document and places it into the application's clipboard. If there is no current document, or the application does not have a clipboard, do nothing.
-
exitAction
public static javax.swing.Action exitAction(Application app)
Create an action named "Exit" that tries to close all the open documents, and if all of them are closed successfully, then exits Java. As soon as one document is not successfully closed, the action is cancelled.
-
newAction
public static javax.swing.Action newAction(Application app)
Create an action named "New" that creates a new document.
-
openAction
public static javax.swing.Action openAction(Application app)
Create an action named "Open" that opens a new document.
-
printAction
public static javax.swing.Action printAction(Application app)
Create an action named "Print" that prints the current document to the printer, if it implements the Printable or Pageable interface. If there is no current document, or the Document is not printable/pageable do nothing.
-
pasteAction
public static javax.swing.Action pasteAction(Application app)
Create an action named "Paste" that pastes the current selection from the current document and places it into the application's clipboard. If there is no current document, or the application does not have a clipboard, do nothing.
-
quitAction
@Deprecated public static javax.swing.Action quitAction(Application app)
Deprecated.The standard windows term is "Exit," so use exitAction()Create an action named "Quit" that exits Java.
-
saveAction
public static javax.swing.Action saveAction(Application app)
Create an action named "Save" that saves the current document. If there is no current document, do nothing.
-
saveAsAction
public static javax.swing.Action saveAsAction(Application app)
Create an action named "Save As" that saves the current document to a different location. If there is no current document, do nothing.
-
-