Package rma.swing
Class AbstractTextEditorPanel
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
rma.swing.EnabledJPanel
rma.swing.AbstractTextEditorPanel
- All Implemented Interfaces:
ImageObserver
,MenuContainer
,Serializable
,Accessible
,Modifiable
component to support basic editing of ASCII files.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ReflectMultiListener
protected org.fife.ui.rtextarea.RTextScrollPane
protected org.fife.ui.rsyntaxtextarea.RSyntaxTextArea
Fields inherited from class javax.swing.JComponent
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
accessibleContext, 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
create the controls for this panelprotected abstract boolean
override method to say whether this panel should create the default menusprotected boolean
override method to say whether the panel can do a save as.void
void
copy the selected textprotected JMenuBar
create the menus for this component if we're allowed tovoid
cut the selected textvoid
protected UndoableEdit
getText()
get the textprotected JTextArea
get the Font that the text area is using.void
void
gotoLineNumber
(int lineNumber) boolean
boolean
void
paste the text in the clipboardprotected UndoableEdit
void
displayprotected void
register the listeners used by this class and it componentsvoid
abstract boolean
save this contents of the textAreavoid
select the textprotected void
setAllowEditing
(boolean canEdit) void
setEditable
(boolean tf) set the TextArea editablevoid
setModified
(boolean modified) void
set the text of the TextAreavoid
setTextFont
(Font f) set the Font for the text areavoid
undo the last Undoable Event.protected void
update the undo/redo menus to reflect the last undo eventMethods inherited from class rma.swing.EnabledJPanel
getToolTipText, setComponentEnabled, setEnabled
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
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, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, 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, 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, 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, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, 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, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
_txtArea
protected org.fife.ui.rsyntaxtextarea.RSyntaxTextArea _txtArea -
_scrollPane
protected org.fife.ui.rtextarea.RTextScrollPane _scrollPane -
_listener
-
-
Constructor Details
-
AbstractTextEditorPanel
public AbstractTextEditorPanel()create a new AbstractTextEditorPanel
-
-
Method Details
-
buildControls
protected void buildControls()create the controls for this panel -
createMenus
create the menus for this component if we're allowed to- See Also:
-
registerListeners
protected void registerListeners()register the listeners used by this class and it components -
canCreateMenus
protected abstract boolean canCreateMenus()override method to say whether this panel should create the default menus- Returns:
- true if this class should create the default menus
-
saveAction
public abstract boolean saveAction()save this contents of the textArea- Returns:
- true if the save was successful
-
canSaveAs
protected boolean canSaveAs()override method to say whether the panel can do a save as. If overridden to return true, then also overridesaveAsAction()
- Returns:
- false by default.
-
setEditable
public void setEditable(boolean tf) set the TextArea editable -
isEditable
public boolean isEditable() -
setText
set the text of the TextArea- Parameters:
txt
- the new text
-
getText
get the text- Returns:
- the text
-
setAllowEditing
protected void setAllowEditing(boolean canEdit) - Parameters:
canEdit
-
-
cutAction
public void cutAction()cut the selected text- See Also:
-
copyAction
public void copyAction()copy the selected text- See Also:
-
pasteAction
public void pasteAction()paste the text in the clipboard- See Also:
-
selectAllAction
public void selectAllAction()select the text- See Also:
-
getSelectedText
- Returns:
-
closeAction
public void closeAction() -
updateMenu
protected void updateMenu()update the undo/redo menus to reflect the last undo event -
popLastEdit
-
getLastEdit
-
printAction
public void printAction()display -
gotoLineNumber
public void gotoLineNumber() -
gotoLineNumber
public void gotoLineNumber(int lineNumber) -
undoAction
public void undoAction()undo the last Undoable Event. -
findAction
public void findAction() -
replaceAction
public void replaceAction() -
isModified
public boolean isModified()- Specified by:
isModified
in interfaceModifiable
-
setModified
public void setModified(boolean modified) - Specified by:
setModified
in interfaceModifiable
-
getTextArea
-
setTextFont
set the Font for the text area- Parameters:
f
- the new Font
-
getTextFont
get the Font that the text area is using.- Returns:
-