Class SyntaxEditor

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.fife.rsta.ui.CollapsibleSectionPanel
fr.ifremer.isisfish.ui.widget.text.SyntaxEditorUI
fr.ifremer.isisfish.ui.widget.text.SyntaxEditor
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, EventListener, Accessible, CaretListener, DocumentListener, org.fife.rsta.ui.search.SearchListener

public class SyntaxEditor extends SyntaxEditorUI implements DocumentListener
Add custom behavior to RSyntaxEditor UI. Like :
  • copy/paste
  • file change detection
See Also:
  • Field Details

    • askIfNotSaved

      protected boolean askIfNotSaved
      Will ask user to perform save on close.
    • file

      protected File file
      Currently edited file.
    • modified

      protected transient boolean modified
      Flag is file has been modified.
    • lastSaveTimestamp

      protected transient long lastSaveTimestamp
      Timestamp when saved has been performed from editor.
    • saveAction

      protected Action saveAction
      Save action instance.
    • watchService

      protected WatchService watchService
      Single watch service instance.
    • watchThread

      protected Thread watchThread
      Watch service thread.
    • askReloadPanel

      protected JPanel askReloadPanel
      Ask reload file panel (not null if displayed).
  • Constructor Details

    • SyntaxEditor

      public SyntaxEditor()
  • Method Details

    • setAutocomplete

      protected void setAutocomplete()
      Autocomplete support is not perfect yet and don't support partial classes (equation).
    • finalize

      protected void finalize() throws Throwable
      Overrides:
      finalize in class Object
      Throws:
      Throwable
    • isAskIfNotSaved

      public boolean isAskIfNotSaved()
    • setAskIfNotSaved

      public void setAskIfNotSaved(boolean askIfNotSaved)
    • setModified

      protected void setModified(boolean modified)
    • isModified

      public boolean isModified()
    • addDocumentListener

      public void addDocumentListener(DocumentListener listener)
    • removeDocumentListener

      public void removeDocumentListener(DocumentListener listener)
    • open

      public boolean open(File file)
    • askAndSaveOrCancel

      protected boolean askAndSaveOrCancel()
    • close

      public boolean close()
    • setFile

      protected void setFile(File file)
    • save

      public void save()
    • getText

      public String getText()
    • copy

      public void copy()
    • paste

      public void paste()
    • cut

      public void cut()
    • insertUpdate

      public void insertUpdate(DocumentEvent e)
      Specified by:
      insertUpdate in interface DocumentListener
    • removeUpdate

      public void removeUpdate(DocumentEvent e)
      Specified by:
      removeUpdate in interface DocumentListener
    • changedUpdate

      public void changedUpdate(DocumentEvent e)
      Specified by:
      changedUpdate in interface DocumentListener
    • getSaveAction

      public Action getSaveAction()
    • clearReloadPanel

      protected void clearReloadPanel()
    • detectExternalChanges

      protected void detectExternalChanges(File file)
    • notifyFileChanged

      protected void notifyFileChanged(File file)