|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container java.awt.Window java.awt.Frame javax.swing.JFrame edu.northwestern.at.utils.swing.WindowsMenuManager edu.northwestern.at.utils.swing.XFrame edu.northwestern.at.utils.swing.notepad.Notepad
public class Notepad
Simple text editor.
Modified from Sun's Notepad sample, the usage license for which follows. The author of Sun's version is Timothy Prinzing. Modifications by Philip R. Burns.
Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
-Redistribution in binary form must reproduct the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of Sun Microsystems, Inc. or the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission.
This software is provided "AS IS," without a warranty of any kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES OR LIABILITIES SUFFERED BY LICENSEE AS A RESULT OF OR RELATING TO USE, MODIFICATION OR DISTRIBUTION OF THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
You acknowledge that Software is not designed, licensed or intended for use in the design, construction, operation or maintenance of any nuclear facility.
Nested Class Summary | |
---|---|
protected class |
Notepad.ActionChangedListener
|
(package private) class |
Notepad.ClipboardObserver
Clipboard observer. |
protected class |
Notepad.CopyAction
Copy to clipboard action. |
protected class |
Notepad.CutAction
Cut to clipboard action. |
protected class |
Notepad.ExitAction
Exit command. |
protected class |
Notepad.FileLoader
Thread to load a file into the text storage model |
protected class |
Notepad.FileSaver
Thread to save document to a text file. |
protected class |
Notepad.FindAction
Create find action. |
protected class |
Notepad.MyDocumentListener
Listens for changes to document being edited. |
protected class |
Notepad.NewAction
New action. |
protected class |
Notepad.OpenAction
Open file action. |
protected class |
Notepad.PageSetupAction
Create page setup action. |
protected class |
Notepad.PasteAction
Paste from clipboard action. |
protected class |
Notepad.PrintAction
Create print action. |
protected class |
Notepad.RedoAction
Handles Redo action. |
protected class |
Notepad.ReplaceAction
Create replace action. |
protected class |
Notepad.RunAction
Run action. |
protected class |
Notepad.SaveAction
Save file action. |
protected class |
Notepad.SaveAsAction
Save as action. |
protected class |
Notepad.SelectAllAction
Handles "select all" action. |
protected class |
Notepad.StatusBar
Create status bar for displaying row/column and progress. |
protected class |
Notepad.UndoAction
Handles Undo action. |
protected class |
Notepad.UndoHandler
|
Nested classes/interfaces inherited from class javax.swing.JFrame |
---|
javax.swing.JFrame.AccessibleJFrame |
Nested classes/interfaces inherited from class java.awt.Frame |
---|
java.awt.Frame.AccessibleAWTFrame |
Nested classes/interfaces inherited from class java.awt.Window |
---|
java.awt.Window.AccessibleAWTWindow |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
static java.lang.String |
acceleratorSuffix
Suffix applied to the key word in resource file lookups for getting accelerator key name. |
static java.lang.String |
actionSuffix
Suffix applied to the key used in resource file lookups for an action. |
protected java.util.Hashtable |
commands
Hash table of menu actions. |
protected javax.swing.JPanel |
contentPanel
Content pane for editor. |
protected Notepad.CopyAction |
copyAction
|
protected java.io.File |
currentFile
Current file being edited. |
protected Notepad.CutAction |
cutAction
|
protected javax.swing.Action[] |
defaultActions
Actions defined by the Notepad class. |
protected java.awt.datatransfer.ClipboardOwner |
defaultClipboardOwner
Clipboard. |
protected Notepad.MyDocumentListener |
documentListener
The document listener. |
protected boolean |
documentModified
True if the document text has been modified. |
protected boolean |
doingEditBatch
True if in the midst of creating a compound edit batch. |
protected javax.swing.JTextArea |
editor
The text component holding the text being edited. |
protected Notepad.ExitAction |
exitAction
|
protected Notepad.FindAction |
findAction
|
static java.awt.Font |
font
The font. |
static int |
fontCharWidth
Width of a single character in the font. |
static java.lang.String |
imageSuffix
Suffix applied to the key used in resource file lookups for an image. |
static java.lang.String |
labelSuffix
Suffix applied to the key used in resource file lookups for a label. |
protected java.util.Hashtable |
menuItems
Hash table containing menu items. |
protected java.util.Hashtable |
menus
Hash table containing menus. |
protected Notepad.NewAction |
newAction
|
protected java.lang.String |
newTitle
Default title for new file. |
protected Notepad.OpenAction |
openAction
|
protected Notepad.PageSetupAction |
pageSetupAction
|
protected Notepad.PasteAction |
pasteAction
|
protected Notepad.PrintAction |
printAction
|
protected boolean |
readOnly
True if editor is readonly (e.g., acting as a viewer only). |
protected Notepad.RedoAction |
redoAction
|
protected Notepad.ReplaceAction |
replaceAction
|
protected static java.util.ResourceBundle |
resources
The editor resource strings. |
protected Notepad.RunAction |
runAction
|
protected Notepad.SaveAction |
saveAction
|
protected Notepad.SaveAsAction |
saveAsAction
|
protected Notepad.SelectAllAction |
selectAllAction
|
static int |
tabSize
Tab size in columns. |
static java.lang.String |
tipSuffix
Suffix applied to the key used in resource file lookups for tooltip text. |
protected java.lang.String |
title
Current title for editor. |
protected java.util.Hashtable |
toolbarButtons
Hash table containing toolbar buttons. |
protected javax.swing.undo.UndoManager |
undo
UndoManager to which we add edits. |
protected javax.swing.undo.CompoundEdit |
undoableEditBatch
The compound undo edit batch manager. |
protected Notepad.UndoAction |
undoAction
|
protected javax.swing.event.UndoableEditListener |
undoHandler
Listener for the undoable edits to the current document. |
static java.lang.String |
visibleSuffix
Suffix applied to the key word in resource file lookups for setting item visible (=1) or invisible(=0). |
Fields inherited from class edu.northwestern.at.utils.swing.XFrame |
---|
aboutBox, prefsWindow |
Fields inherited from class javax.swing.JFrame |
---|
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled |
Fields inherited from class java.awt.Frame |
---|
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface javax.swing.WindowConstants |
---|
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
Notepad()
Create Notepad editor. |
|
Notepad(boolean readOnly)
Create Notepad editor. |
Method Summary | |
---|---|
boolean |
clipboardHasPasteableData()
Check if clipboard has pasteable data. |
void |
copy()
Copy to clipboard. |
protected java.beans.PropertyChangeListener |
createActionChangeListener(javax.swing.JMenuItem b)
|
protected void |
createCaretListener()
Create caret listener to track cursor movements. |
protected void |
createDocumentListener()
Create a document listener. |
protected javax.swing.JTextArea |
createEditor()
Create an XTextArea to hold the document text. |
protected javax.swing.JMenu |
createMenu(java.lang.String key)
Create an editor menu. |
protected javax.swing.JMenuBar |
createMenubar()
Create the menubar for the app. |
protected javax.swing.JMenuItem |
createMenuItem(java.lang.String cmd)
Create a menu item. |
protected Notepad.StatusBar |
createStatusBar()
Create a status bar. |
protected java.awt.Component |
createTool(java.lang.String key)
Create a toolbar item by name. |
protected javax.swing.JToolBar |
createToolbar()
Create the toolbar. |
protected javax.swing.JButton |
createToolbarButton(java.lang.String key)
Create a button for the toolbar. |
void |
cut()
Cut to clipboard. |
protected void |
doCopy(java.awt.event.ActionEvent e)
Handle Copy action. |
protected void |
doCut(java.awt.event.ActionEvent e)
Handle Cut action. |
protected void |
doExit(java.awt.event.ActionEvent e)
Handle exit request. |
protected void |
doFind(java.awt.event.ActionEvent e)
Do find. |
protected void |
doNew(java.awt.event.ActionEvent e)
Performs new action. |
protected void |
doOpen(java.awt.event.ActionEvent e)
Performs open file action. |
protected void |
doPageSetup(java.awt.event.ActionEvent e)
Printer page setup. |
protected void |
doPaste(java.awt.event.ActionEvent e)
Handle Paste action. |
protected void |
doPrint(java.awt.event.ActionEvent e)
Print the text. |
protected void |
doReplace(java.awt.event.ActionEvent e)
Do replace. |
protected void |
doRunAction(java.awt.event.ActionEvent e)
Run script, etc. |
protected void |
doSave(java.awt.event.ActionEvent e)
Performs save file action. |
protected void |
doSaveAs(java.awt.event.ActionEvent e)
Performs save as action. |
protected void |
doSelectAll(java.awt.event.ActionEvent e)
Performs "select all" action. |
protected void |
enableEditMenuItems(boolean textSelected)
Enables/disables edit menu items depending upon whether text is selected. |
protected void |
enableMenuItems(boolean docHasText)
Enables/disables menu items depending upon document contents. |
void |
endEditBatch()
End undoable edit batch. |
protected javax.swing.Action |
getAction(java.lang.String cmd)
Return action for a specified command. |
javax.swing.Action[] |
getActions()
Fetch the list of actions supported by this editor. |
protected javax.swing.JTextArea |
getEditor()
Return the editor contained in this panel. |
protected java.lang.String |
getEditorText()
Return the editor text as a string. |
protected java.awt.Frame |
getFrame()
Find the parent frame for displaying a file-chooser dialog. |
protected javax.swing.JMenuItem |
getMenu(java.lang.String menuName)
Return top-level menu. |
protected javax.swing.JMenuBar |
getMenubar()
Return the menu bar. |
protected javax.swing.JMenuItem |
getMenuItem(java.lang.String cmd)
Return menu item for a specified command. |
protected java.net.URL |
getResource(java.lang.String key)
Return resource URL by name. |
protected java.lang.String |
getResourceString(java.lang.String nm)
Return resource string by name. |
java.lang.String |
getTitle()
Get title. |
protected java.awt.Container |
getToolbar()
Return the toolbar. |
protected java.awt.Component |
getToolbarItem(java.lang.String key)
Get a toolbar item by name. |
protected void |
handleCaretEvent(javax.swing.event.CaretEvent event)
Handles caret change events. |
void |
initializeClipboard()
Initialize clipboard. |
boolean |
isCopyEnabled()
Is copy enabled? |
boolean |
isCutEnabled()
Is cut enabled? |
boolean |
isPasteEnabled()
Is paste enabled? |
boolean |
isSelectAllEnabled()
Checks if "select all" enabled. |
boolean |
isTextSelected()
Is anything selected which can be cut/copied? |
boolean |
isUnselectEnabled()
Is unselect enabled? |
void |
paste()
Paste from clipboard. |
protected void |
reallyExit(java.awt.event.ActionEvent e)
Exit editor. |
protected void |
reportUnexpectedError(java.lang.Exception e)
Report an unexpected error. |
protected void |
resetUndoManager()
Reset undo manager. |
void |
selectAll()
Selects all text. |
protected void |
setActionState(java.lang.String actionName,
boolean enabled)
Enable or disable an action. |
protected int |
showNotSavedDialog(java.lang.String title)
Confirm closing with unsaved changes. |
void |
startEditBatch()
Start undoable edit batch. |
void |
unselect()
Unselect selection. |
Methods inherited from class edu.northwestern.at.utils.swing.XFrame |
---|
about, common, doPageSetup, doPrint, doPrint, doPrint, doPrintPreview, doPrintPreview, doPrintPreview, pack, pack, prefs, quit, setAboutBox, setDefaultImage, setPrefsWindow |
Methods inherited from class edu.northwestern.at.utils.swing.WindowsMenuManager |
---|
dispose, getActiveWindow, getAllOpenWindows, getWindowsMenu, handleLastWindowClosed, setJMenuBar, setTitle, setVisible, setWindowsMenu |
Methods inherited from class javax.swing.JFrame |
---|
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update |
Methods inherited from class java.awt.Frame |
---|
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setUndecorated |
Methods inherited from class java.awt.Window |
---|
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, show, toBack, toFront |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.awt.MenuContainer |
---|
getFont, postEvent |
Field Detail |
---|
protected boolean readOnly
protected boolean documentModified
protected java.io.File currentFile
protected java.lang.String newTitle
protected java.lang.String title
protected Notepad.MyDocumentListener documentListener
protected javax.swing.undo.CompoundEdit undoableEditBatch
protected boolean doingEditBatch
protected javax.swing.JPanel contentPanel
protected javax.swing.JTextArea editor
protected java.util.Hashtable commands
protected java.util.Hashtable menuItems
protected java.util.Hashtable menus
protected java.util.Hashtable toolbarButtons
protected javax.swing.event.UndoableEditListener undoHandler
protected javax.swing.undo.UndoManager undo
protected java.awt.datatransfer.ClipboardOwner defaultClipboardOwner
public static final java.lang.String imageSuffix
public static final java.lang.String labelSuffix
public static final java.lang.String actionSuffix
public static final java.lang.String tipSuffix
public static final java.lang.String visibleSuffix
public static final java.lang.String acceleratorSuffix
public static final int tabSize
public static final java.awt.Font font
public static int fontCharWidth
protected static java.util.ResourceBundle resources
protected Notepad.NewAction newAction
protected Notepad.OpenAction openAction
protected Notepad.SaveAction saveAction
protected Notepad.SaveAsAction saveAsAction
protected Notepad.PageSetupAction pageSetupAction
protected Notepad.PrintAction printAction
protected Notepad.ExitAction exitAction
protected Notepad.CopyAction copyAction
protected Notepad.CutAction cutAction
protected Notepad.PasteAction pasteAction
protected Notepad.SelectAllAction selectAllAction
protected Notepad.UndoAction undoAction
protected Notepad.RedoAction redoAction
protected Notepad.FindAction findAction
protected Notepad.ReplaceAction replaceAction
protected Notepad.RunAction runAction
protected javax.swing.Action[] defaultActions
Constructor Detail |
---|
public Notepad(boolean readOnly)
readOnly
- True if editor is read-only, e.g.,
acting as a viewer. public Notepad()
Method Detail |
---|
public javax.swing.Action[] getActions()
It is implemented to return the list of actions supported by the embedded JTextComponent augmented with the actions defined locally.
public java.lang.String getTitle()
getTitle
in class java.awt.Frame
protected void createDocumentListener()
protected javax.swing.JTextArea createEditor()
protected javax.swing.JTextArea getEditor()
protected java.lang.String getEditorText()
protected java.awt.Frame getFrame()
protected javax.swing.JMenuItem createMenuItem(java.lang.String cmd)
cmd
- The name of the menu command.
This is the hook through which all menu items are created. It registers the result with the menuitem hashtable so that it can be fetched with getMenuItem().
protected javax.swing.JMenuItem getMenuItem(java.lang.String cmd)
cmd
- Name of the action.
protected javax.swing.JMenuItem getMenu(java.lang.String menuName)
menuName
- Name of the menu.
protected javax.swing.Action getAction(java.lang.String cmd)
cmd
- Name of the action.
protected java.lang.String getResourceString(java.lang.String nm)
nm
- Name of resource string.
protected java.net.URL getResource(java.lang.String key)
key
- Key for resource.
protected java.awt.Container getToolbar()
protected javax.swing.JMenuBar getMenubar()
protected Notepad.StatusBar createStatusBar()
protected void resetUndoManager()
protected javax.swing.JToolBar createToolbar()
By default this reads the resource file for the definition of the toolbar.
protected java.awt.Component createTool(java.lang.String key)
key
- The name of the toolbar item to create.
protected java.awt.Component getToolbarItem(java.lang.String key)
key
- The name of the toolbar item to retrieve.
protected javax.swing.JButton createToolbarButton(java.lang.String key)
key
- The name of the button to create.
By default this will load an image resource. The image filename is relative to the classpath (including the '.' directory if its a part of the classpath), and may either be in a JAR file or a separate file.
protected javax.swing.JMenuBar createMenubar()
By default this pulls the definition of the menu from the associated resource file.
protected javax.swing.JMenu createMenu(java.lang.String key)
By default this pulls the definition of the menu from the associated resource file.
protected java.beans.PropertyChangeListener createActionChangeListener(javax.swing.JMenuItem b)
protected void doCopy(java.awt.event.ActionEvent e)
protected void doCut(java.awt.event.ActionEvent e)
protected void doPaste(java.awt.event.ActionEvent e)
protected void doSelectAll(java.awt.event.ActionEvent e)
public void selectAll()
selectAll
in interface SelectAll
public boolean isSelectAllEnabled()
isSelectAllEnabled
in interface SelectAll
protected void doOpen(java.awt.event.ActionEvent e)
protected void doNew(java.awt.event.ActionEvent e)
protected void doSave(java.awt.event.ActionEvent e)
protected void doSaveAs(java.awt.event.ActionEvent e)
protected void doRunAction(java.awt.event.ActionEvent e)
Override this to implement script execution, etc. Default here is to do nothing.
protected void doExit(java.awt.event.ActionEvent e)
Override this to add extra end-of-editing checks.
protected int showNotSavedDialog(java.lang.String title)
protected void reallyExit(java.awt.event.ActionEvent e)
Override this to change end-of-editing behavior. Called at the end of doExit() .
protected void doFind(java.awt.event.ActionEvent e)
protected void doReplace(java.awt.event.ActionEvent e)
protected void doPageSetup(java.awt.event.ActionEvent e)
protected void doPrint(java.awt.event.ActionEvent e)
public void startEditBatch()
startEditBatch
in interface EditBatch
public void endEditBatch()
endEditBatch
in interface EditBatch
protected void setActionState(java.lang.String actionName, boolean enabled)
actionName
- Name of the action to enable or disable.enabled
- True to enable action, false otherwise.
Menu items and toolbar buttons associated with this action are also enabled or disabled.
protected void enableMenuItems(boolean docHasText)
docHasText
- True if document being edited has text. protected void enableEditMenuItems(boolean textSelected)
textSelected
- True if there is a selection in effect. protected void createCaretListener()
protected void handleCaretEvent(javax.swing.event.CaretEvent event)
event
- The caret event. protected void reportUnexpectedError(java.lang.Exception e)
e
- The exception.
Does nothing by default. Override in subclasses as needed.
public boolean clipboardHasPasteableData()
public void initializeClipboard()
public void cut()
cut
in interface CutCopyPaste
public void copy()
copy
in interface CutCopyPaste
public void paste()
paste
in interface CutCopyPaste
public boolean isCutEnabled()
isCutEnabled
in interface CutCopyPaste
public boolean isCopyEnabled()
isCopyEnabled
in interface CutCopyPaste
public boolean isPasteEnabled()
isPasteEnabled
in interface CutCopyPaste
public boolean isTextSelected()
isTextSelected
in interface CutCopyPaste
public void unselect()
unselect
in interface SelectAll
public boolean isUnselectEnabled()
isUnselectEnabled
in interface SelectAll
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |