Package rma.swing

Class AbstractTextEditorPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, Modifiable

public abstract class AbstractTextEditorPanel extends EnabledJPanel implements Modifiable
component to support basic editing of ASCII files.
See Also:
  • Field Details

    • _txtArea

      protected org.fife.ui.rsyntaxtextarea.RSyntaxTextArea _txtArea
    • _scrollPane

      protected org.fife.ui.rtextarea.RTextScrollPane _scrollPane
    • _listener

      protected ReflectMultiListener _listener
  • Constructor Details

    • AbstractTextEditorPanel

      public AbstractTextEditorPanel()
      create a new AbstractTextEditorPanel
  • Method Details

    • buildControls

      protected void buildControls()
      create the controls for this panel
    • createMenus

      protected JMenuBar 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 override saveAsAction()
      Returns:
      false by default.
    • setEditable

      public void setEditable(boolean tf)
      set the TextArea editable
    • isEditable

      public boolean isEditable()
    • setText

      public void setText(String txt)
      set the text of the TextArea
      Parameters:
      txt - the new text
    • getText

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

      public String getSelectedText()
      Returns:
    • closeAction

      public void closeAction()
    • updateMenu

      protected void updateMenu()
      update the undo/redo menus to reflect the last undo event
    • popLastEdit

      protected UndoableEdit popLastEdit()
    • getLastEdit

      protected UndoableEdit 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 interface Modifiable
    • setModified

      public void setModified(boolean modified)
      Specified by:
      setModified in interface Modifiable
    • getTextArea

      protected JTextArea getTextArea()
    • setTextFont

      public void setTextFont(Font f)
      set the Font for the text area
      Parameters:
      f - the new Font
    • getTextFont

      public Font getTextFont()
      get the Font that the text area is using.
      Returns: