diva.gui
Class DefaultActions

java.lang.Object
  extended by diva.gui.DefaultActions

public class DefaultActions
extends Object

A collection of static methods that create useful default actions.

Version:
$Revision: 1.17 $
Author:
John Reekie (johnr@eecs.berkeley.edu)

Field Summary
static String CLOSE
           
static String COPY
           
static String CUT
           
static String EXIT
           
static String NEW
           
static String OPEN
           
static String PASTE
           
static String PRINT
           
static String QUIT
           
static String SAVE
           
static String SAVE_AS
           
 
Constructor Summary
DefaultActions()
           
 
Method Summary
static Action closeAction(Application app)
          Create an action named "Close" that closes the current document.
static 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.
static 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.
static 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.
static Action newAction(Application app)
          Create an action named "New" that creates a new document.
static Action openAction(Application app)
          Create an action named "Open" that opens a new document.
static 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.
static 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.
static Action quitAction(Application app)
          Deprecated. The standard windows term is "Exit," so use exitAction()
static Action saveAction(Application app)
          Create an action named "Save" that saves the current document.
static Action saveAsAction(Application app)
          Create an action named "Save As" that saves the current document to a different location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPY

public static final String COPY
See Also:
Constant Field Values

CLOSE

public static final String CLOSE
See Also:
Constant Field Values

CUT

public static final String CUT
See Also:
Constant Field Values

EXIT

public static final String EXIT
See Also:
Constant Field Values

NEW

public static final String NEW
See Also:
Constant Field Values

OPEN

public static final String OPEN
See Also:
Constant Field Values

PASTE

public static final String PASTE
See Also:
Constant Field Values

PRINT

public static final String PRINT
See Also:
Constant Field Values

QUIT

public static final String QUIT
See Also:
Constant Field Values

SAVE

public static final String SAVE
See Also:
Constant Field Values

SAVE_AS

public static final String SAVE_AS
See Also:
Constant Field Values
Constructor Detail

DefaultActions

public DefaultActions()
Method Detail

copyAction

public static 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 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 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 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 Action newAction(Application app)
Create an action named "New" that creates a new document.


openAction

public static Action openAction(Application app)
Create an action named "Open" that opens a new document.


printAction

public static 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 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

public static 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 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 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.



Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.