Package diva.gui

Class DefaultActions


  • public class DefaultActions
    extends java.lang.Object
    A 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.String CLOSE  
      static java.lang.String COPY  
      static java.lang.String CUT  
      static java.lang.String EXIT  
      static java.lang.String NEW  
      static java.lang.String OPEN  
      static java.lang.String PASTE  
      static java.lang.String PRINT  
      static java.lang.String QUIT  
      static java.lang.String SAVE  
      static java.lang.String SAVE_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.Action closeAction​(Application app)
      Create an action named "Close" that closes the current document.
      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.
      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.
      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.
      static javax.swing.Action newAction​(Application app)
      Create an action named "New" that creates a new document.
      static javax.swing.Action openAction​(Application app)
      Create an action named "Open" that opens a new document.
      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.
      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.
      static javax.swing.Action quitAction​(Application app)
      Deprecated.
      The standard windows term is "Exit," so use exitAction()
      static javax.swing.Action saveAction​(Application app)
      Create an action named "Save" that saves the current document.
      static javax.swing.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
    • Constructor Detail

      • DefaultActions

        public DefaultActions()
    • 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.