edu.northwestern.at.utils.swing
Class XTextPane

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.text.JTextComponent
                  extended by javax.swing.JEditorPane
                      extended by javax.swing.JTextPane
                          extended by edu.northwestern.at.utils.swing.XTextPane
All Implemented Interfaces:
ClipboardHasPasteableData, CutCopyPaste, PrintableContents, SaveToFile, SelectAll, java.awt.datatransfer.ClipboardOwner, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.Scrollable
Direct Known Subclasses:
XTextPaneTableCellRenderer

public class XTextPane
extends javax.swing.JTextPane
implements java.awt.datatransfer.ClipboardOwner, PrintableContents, ClipboardHasPasteableData, CutCopyPaste, SelectAll, SaveToFile

A JTextPane with extra support for StyledString's and other features.

See Also:
Serialized Form

Nested Class Summary
static class XTextPane.LinkInfo
          Link information.
 
Nested classes/interfaces inherited from class javax.swing.JEditorPane
javax.swing.JEditorPane.AccessibleJEditorPane, javax.swing.JEditorPane.AccessibleJEditorPaneHTML, javax.swing.JEditorPane.JEditorPaneAccessibleHypertextSupport
 
Nested classes/interfaces inherited from class javax.swing.text.JTextComponent
javax.swing.text.JTextComponent.AccessibleJTextComponent, javax.swing.text.JTextComponent.DropLocation, javax.swing.text.JTextComponent.KeyBinding
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
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
 
Fields inherited from class javax.swing.JEditorPane
HONOR_DISPLAY_PROPERTIES, W3C_LENGTH_UNITS
 
Fields inherited from class javax.swing.text.JTextComponent
DEFAULT_KEYMAP, FOCUS_ACCELERATOR_KEY
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
XTextPane()
          Constructs a new XTextPane with no initial text.
XTextPane(java.lang.String s)
          Constructs a new XTextPane with plain string as initial text.
XTextPane(StyledString styledStr)
          Constructs a new XTextPane with alignment allowed.
XTextPane(StyledString styledStr, boolean alignment)
          Constructs a new XTextPane.
 
Method Summary
 void appendBoldText(java.lang.String str)
          Appends bold text.
 void appendItalicText(java.lang.String str)
          Appends italic text.
 void appendLink(java.lang.String str, Link link)
          Appends a link.
 void appendPlainText(java.lang.String str)
          Appends plain text.
 void appendStyledText(StyledString styledStr)
          Appends styled text.
 void appendUnderlineText(java.lang.String str)
          Appends underlined text.
 boolean clipboardHasPasteableData()
          Check if clipboard has pasteable data.
 void copy()
          Copys the selected text to the clipboard.
 void cut()
          Cuts the selected text to the clipboard.
 javax.swing.Action getCopyAction()
          Gets the copy action.
 java.awt.Cursor getCurrentCursor()
          Get the current cursor.
 javax.swing.Action getCutAction()
          Gets the cut action.
 javax.swing.Action getDeleteAction()
          Gets the delete action.
 javax.swing.text.Document getDoc()
          Gets the document.
 int getDocLength()
          Gets the document length.
 XTextPane.LinkInfo[] getLinks()
          Gets the links.
 javax.swing.Action getPasteAction()
          Gets the paste action.
 PrintableComponent getPrintableComponent(java.lang.String title, java.awt.print.PageFormat pageFormat)
          Return printable component.
 StyledString getStyledSelection()
          Gets the styled currently selected text.
 StyledString getStyledText()
          Gets the styled text.
 StyleInfo getStyleInfo(int subStart, int subEnd)
          Gets the style information for a substring.
 javax.swing.undo.UndoManager getUndoManager()
          Get undo manager.
 void insertBoldText(int pos, java.lang.String str)
          Inserts bold text.
 void insertItalicText(int pos, java.lang.String str)
          Inserts italicized text.
 void insertLink(int pos, java.lang.String str, Link link)
          Inserts a link.
 void insertPlainText(int pos, java.lang.String str)
          Inserts plain text.
 void insertStyledText(int pos, StyledString styledStr)
          Inserts styled text.
 void insertStyledText(int pos, StyledString styledStr, javax.swing.text.AttributeSet insertionAttributes, javax.swing.text.AttributeSet paragraphAttributes)
          Inserts styled text.
 void insertUnderlinedText(int pos, java.lang.String str)
          Inserts underlined text.
 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 lostOwnership(java.awt.datatransfer.Clipboard clipboard, java.awt.datatransfer.Transferable contents)
          Notifies this object that it is no longer the owner of the contents of the clipboard.
 void paste()
          Pastes the contents of the clipboard.
 void printContents(java.lang.String title, java.awt.print.PrinterJob printerJob, java.awt.print.PageFormat pageFormat)
          Prints the styled text.
 void replaceSelection(StyledString styledStr)
          Replaces the currently selected text with styled text.
 void saveToFile(java.lang.String fileName)
          Save to a named file.
 void saveToFile(java.awt.Window parentWindow)
          Save to a file using a file dialog.
 void saveToImageFile(java.io.File imageFile, java.lang.String imageType)
          Save editor contents to image file.
 void saveToJPEGFile(java.io.File jpegFile)
          Save editor contents to JPEG file.
 void saveToPNGFile(java.io.File pngFile)
          Save editor contents to PNG file.
 void scrollTo(int offset, javax.swing.JScrollPane scrollPane)
          Scrolls to an offset in the document.
 void scrollToBeginning()
          Scrolls to the beginning of the document.
 void scrollToEnd()
          Scrolls to the end of the document.
 void scrollToEndForSure()
          Scrolls to the end of the document for sure.
 void selectAll()
          Selects all text.
 void setAlignment(boolean alignment)
          Set honoring of alignment.
 void setBorder(int pixels)
          Sets the border.
 void setFont(java.lang.String family, int size)
          Sets the font.
 void setLinks(XTextPane.LinkInfo[] links)
          Sets the links.
 void setStyledText(StyledString styledStr)
          Sets the styled text.
 void setStyleInfo(StyleInfo styleInfo, int pos)
          Sets the style information.
 void setUndoManager(javax.swing.undo.UndoManager undoManager)
          Set undo manager used by parent.
 void unselect()
          Unselect selection.
 
Methods inherited from class javax.swing.JTextPane
addStyle, createDefaultEditorKit, getCharacterAttributes, getInputAttributes, getLogicalStyle, getParagraphAttributes, getStyle, getStyledDocument, getStyledEditorKit, getUIClassID, insertComponent, insertIcon, paramString, removeStyle, replaceSelection, setCharacterAttributes, setDocument, setEditorKit, setLogicalStyle, setParagraphAttributes, setStyledDocument
 
Methods inherited from class javax.swing.JEditorPane
addHyperlinkListener, createEditorKitForContentType, fireHyperlinkUpdate, getAccessibleContext, getContentType, getEditorKit, getEditorKitClassNameForContentType, getEditorKitForContentType, getHyperlinkListeners, getPage, getPreferredSize, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getStream, getText, read, registerEditorKitForContentType, registerEditorKitForContentType, removeHyperlinkListener, scrollToReference, setContentType, setEditorKitForContentType, setPage, setPage, setText
 
Methods inherited from class javax.swing.text.JTextComponent
addCaretListener, addInputMethodListener, addKeymap, fireCaretUpdate, getActions, getCaret, getCaretColor, getCaretListeners, getCaretPosition, getDisabledTextColor, getDocument, getDragEnabled, getDropLocation, getDropMode, getFocusAccelerator, getHighlighter, getInputMethodRequests, getKeymap, getKeymap, getMargin, getNavigationFilter, getPreferredScrollableViewportSize, getPrintable, getScrollableBlockIncrement, getScrollableUnitIncrement, getSelectedText, getSelectedTextColor, getSelectionColor, getSelectionEnd, getSelectionStart, getText, getToolTipText, getUI, isEditable, loadKeymap, modelToView, moveCaretPosition, print, print, print, processInputMethodEvent, read, removeCaretListener, removeKeymap, removeNotify, select, setCaret, setCaretColor, setCaretPosition, setComponentOrientation, setDisabledTextColor, setDragEnabled, setDropMode, setEditable, setFocusAccelerator, setHighlighter, setKeymap, setMargin, setNavigationFilter, setSelectedTextColor, setSelectionColor, setSelectionEnd, setSelectionStart, setUI, updateUI, viewToModel, write
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XTextPane

public XTextPane(StyledString styledStr,
                 boolean alignment)
Constructs a new XTextPane.

Parameters:
styledStr - Initial styled text contents, or null if none.
alignment - True if the left, center, and right alignment options are allowed.

XTextPane

public XTextPane(java.lang.String s)
Constructs a new XTextPane with plain string as initial text.


XTextPane

public XTextPane()
Constructs a new XTextPane with no initial text.


XTextPane

public XTextPane(StyledString styledStr)
Constructs a new XTextPane with alignment allowed.

Parameters:
styledStr - Initial styled text contents, or null if none.
Method Detail

getDoc

public javax.swing.text.Document getDoc()
Gets the document.

Returns:
The document.

getDocLength

public int getDocLength()
Gets the document length.

Returns:
The document length.

setBorder

public void setBorder(int pixels)
Sets the border.

Parameters:
pixels - Number of pixels in border on all four sides.

setFont

public void setFont(java.lang.String family,
                    int size)
Sets the font.

Parameters:
family - Font family name.
size - Font size.

getStyledText

public StyledString getStyledText()
Gets the styled text.

Returns:
The styled string.

getStyledSelection

public StyledString getStyledSelection()
Gets the styled currently selected text.

Returns:
The styled string for the currently selected text.

setStyledText

public void setStyledText(StyledString styledStr)
Sets the styled text.

Parameters:
styledStr - Styled string.

appendStyledText

public void appendStyledText(StyledString styledStr)
Appends styled text.

Parameters:
styledStr - Styled string.

appendPlainText

public void appendPlainText(java.lang.String str)
Appends plain text.

Parameters:
str - String.

appendBoldText

public void appendBoldText(java.lang.String str)
Appends bold text.

Parameters:
str - String.

appendItalicText

public void appendItalicText(java.lang.String str)
Appends italic text.

Parameters:
str - String.

appendUnderlineText

public void appendUnderlineText(java.lang.String str)
Appends underlined text.

Parameters:
str - String.

appendLink

public void appendLink(java.lang.String str,
                       Link link)
Appends a link.

Links are blue and underlined. A single-click on a link goes to the linked object.

Parameters:
str - String.
link - Link.

insertStyledText

public void insertStyledText(int pos,
                             StyledString styledStr,
                             javax.swing.text.AttributeSet insertionAttributes,
                             javax.swing.text.AttributeSet paragraphAttributes)
Inserts styled text.

Parameters:
pos - Position in document to insert text.
styledStr - Styled string.
insertionAttributes - Default attributes for the insertion.
paragraphAttributes - Default paragraph attributes.

insertStyledText

public void insertStyledText(int pos,
                             StyledString styledStr)
Inserts styled text.

Parameters:
pos - Position in document to insert text.
styledStr - Styled string.

insertPlainText

public void insertPlainText(int pos,
                            java.lang.String str)
Inserts plain text.

Parameters:
pos - Position in document to insert text.
str - String.

insertBoldText

public void insertBoldText(int pos,
                           java.lang.String str)
Inserts bold text.

Parameters:
pos - Position in document to insert text.
str - String.

insertItalicText

public void insertItalicText(int pos,
                             java.lang.String str)
Inserts italicized text.

Parameters:
pos - Position in document to insert text.
str - String.

insertUnderlinedText

public void insertUnderlinedText(int pos,
                                 java.lang.String str)
Inserts underlined text.

Parameters:
pos - Position in document to insert text.
str - String.

insertLink

public void insertLink(int pos,
                       java.lang.String str,
                       Link link)
Inserts a link.

Links are blue and underlined. A single-click on a link goes to the linked object.

Parameters:
pos - Position in document to insert text.
str - String text to insert in document.
link - Link, or null to just make the inserted text blue and underlined.

replaceSelection

public void replaceSelection(StyledString styledStr)
Replaces the currently selected text with styled text.

Parameters:
styledStr - Replacement styled string.

lostOwnership

public void lostOwnership(java.awt.datatransfer.Clipboard clipboard,
                          java.awt.datatransfer.Transferable contents)
Notifies this object that it is no longer the owner of the contents of the clipboard.

This method does nothing. We ignored transfers of ownership of the clipboard.

Specified by:
lostOwnership in interface java.awt.datatransfer.ClipboardOwner
Parameters:
clipboard - The clipboard that is no longer owned.
contents - The contents which this owner had placed on the clipboard.

isCutEnabled

public boolean isCutEnabled()
Is cut enabled?

Specified by:
isCutEnabled in interface CutCopyPaste
Returns:
true since cut is enabled.

isCopyEnabled

public boolean isCopyEnabled()
Is copy enabled?

Specified by:
isCopyEnabled in interface CutCopyPaste
Returns:
true since copy is enabled.

isPasteEnabled

public boolean isPasteEnabled()
Is paste enabled?

Specified by:
isPasteEnabled in interface CutCopyPaste
Returns:
true since paste is enabled.

getCutAction

public javax.swing.Action getCutAction()
Gets the cut action.

Returns:
The cut action.

cut

public void cut()
Cuts the selected text to the clipboard.

Specified by:
cut in interface CutCopyPaste
Overrides:
cut in class javax.swing.text.JTextComponent

getCopyAction

public javax.swing.Action getCopyAction()
Gets the copy action.

Returns:
The copy action.

copy

public void copy()
Copys the selected text to the clipboard.

Specified by:
copy in interface CutCopyPaste
Overrides:
copy in class javax.swing.text.JTextComponent

getPasteAction

public javax.swing.Action getPasteAction()
Gets the paste action.

Returns:
The paste action.

getDeleteAction

public javax.swing.Action getDeleteAction()
Gets the delete action.

Returns:
The delete action.

paste

public void paste()
Pastes the contents of the clipboard.

Specified by:
paste in interface CutCopyPaste
Overrides:
paste in class javax.swing.text.JTextComponent

clipboardHasPasteableData

public boolean clipboardHasPasteableData()
Check if clipboard has pasteable data.

Specified by:
clipboardHasPasteableData in interface ClipboardHasPasteableData
Returns:
true if clipboard has pasteable text recognized by XTextPane.

getStyleInfo

public StyleInfo getStyleInfo(int subStart,
                              int subEnd)
Gets the style information for a substring.

Parameters:
subStart - Starting offset of substring.
subEnd - Ending offset of substring.
Returns:
The style information for the substring.

getLinks

public XTextPane.LinkInfo[] getLinks()
Gets the links.

Returns:
Array of Links.

setLinks

public void setLinks(XTextPane.LinkInfo[] links)
Sets the links.

Parameters:
links - Array of Links.

setStyleInfo

public void setStyleInfo(StyleInfo styleInfo,
                         int pos)
Sets the style information.

Parameters:
styleInfo - The style information.
pos - The position in the document of the string for which style information is to be set.

printContents

public void printContents(java.lang.String title,
                          java.awt.print.PrinterJob printerJob,
                          java.awt.print.PageFormat pageFormat)
Prints the styled text.

Parameters:
title - Title for output.
printerJob - The printer job.
pageFormat - The printer page format.

getPrintableComponent

public PrintableComponent getPrintableComponent(java.lang.String title,
                                                java.awt.print.PageFormat pageFormat)
Return printable component.

Specified by:
getPrintableComponent in interface PrintableContents
Parameters:
title - Title for printing.
pageFormat - Page format for printing.
Returns:
Printable component for XTextPane.

scrollToBeginning

public void scrollToBeginning()
Scrolls to the beginning of the document.


scrollToEnd

public void scrollToEnd()
Scrolls to the end of the document.


scrollToEndForSure

public void scrollToEndForSure()
Scrolls to the end of the document for sure.

The Swing text package is very ornery when it comes to programmatic scrolling. This "for sure" method starts a thread that wakes up every tenth of a second for two seconds and makes sure that the text pane is scrolled to the end.


scrollTo

public void scrollTo(int offset,
                     javax.swing.JScrollPane scrollPane)
Scrolls to an offset in the document.

The offset is positioned at the top of the viewport.

This is an incredible hack and doe

Parameters:
offset - The offset in the document.
scrollPane - The scroll pane.

getCurrentCursor

public java.awt.Cursor getCurrentCursor()
Get the current cursor.

Returns:
The current cursor.

setAlignment

public void setAlignment(boolean alignment)
Set honoring of alignment.

Parameters:
alignment - True to allow left/center/right alignment.

setUndoManager

public void setUndoManager(javax.swing.undo.UndoManager undoManager)
Set undo manager used by parent.

Parameters:
undoManager - The undo manager.

getUndoManager

public javax.swing.undo.UndoManager getUndoManager()
Get undo manager.

Returns:
undoManager The undo manager, or null if none.

isTextSelected

public boolean isTextSelected()
Is anything selected which can be cut/copied?

Specified by:
isTextSelected in interface CutCopyPaste

selectAll

public void selectAll()
Selects all text.

Specified by:
selectAll in interface SelectAll
Overrides:
selectAll in class javax.swing.text.JTextComponent

isSelectAllEnabled

public boolean isSelectAllEnabled()
Checks if "select all" enabled.

Specified by:
isSelectAllEnabled in interface SelectAll
Returns:
returns true if select all enabled.

unselect

public void unselect()
Unselect selection.

Specified by:
unselect in interface SelectAll

isUnselectEnabled

public boolean isUnselectEnabled()
Is unselect enabled?

Specified by:
isUnselectEnabled in interface SelectAll

saveToFile

public void saveToFile(java.lang.String fileName)
Save to a named file.

Specified by:
saveToFile in interface SaveToFile
Parameters:
fileName - Name of file to which to save results.

saveToFile

public void saveToFile(java.awt.Window parentWindow)
Save to a file using a file dialog.

Specified by:
saveToFile in interface SaveToFile
Parameters:
parentWindow - Parent window for file dialog.

Runs a file dialog to get the name of the file to which to save results.


saveToImageFile

public void saveToImageFile(java.io.File imageFile,
                            java.lang.String imageType)
                     throws java.io.IOException
Save editor contents to image file.

Parameters:
imageFile - File to received editor contents as jpeg image.
imageType - String providing image file type (jpg, png, etc.)
Throws:
java.io.IOException - if I/O exception occurs.

saveToJPEGFile

public void saveToJPEGFile(java.io.File jpegFile)
                    throws java.io.IOException
Save editor contents to JPEG file.

Parameters:
jpegFile - File to received editor contents as jpeg image.
Throws:
java.io.IOException - if I/O exception occurs.

saveToPNGFile

public void saveToPNGFile(java.io.File pngFile)
                   throws java.io.IOException
Save editor contents to PNG file.

Parameters:
pngFile - File to received editor contents as png image.
Throws:
java.io.IOException - if I/O exception occurs.