Interface EditorInterface

All Known Implementing Classes:
DefaultEditor, Editor, JEditEditor, NullEditor, RSyntaxEditor, SDocEditor

public interface EditorInterface
EditorInterface.
Version:
$Revision$ Last update: $Date$ by : $Author$
Author:
poussin Created: 6 août 2006 12:54:19, poussin
  • Method Summary

    Modifier and Type Method Description
    boolean accept​(java.io.File file)
    If return true, this editor support this file type.
    boolean accept​(Editor.EditorSyntaxConstant editorSyntaxConstant)
    If return true, this editor support the syntax type.
    void addCaretListener​(javax.swing.event.CaretListener listener)
    Add caret listener.
    void addDocumentListener​(javax.swing.event.DocumentListener listener)
    Add document listener.
    void copy()
    Copy current current selection into system clipboard.
    void cut()
    Cut current editor selection into system clipboard.
    java.lang.String getText()
    Return the current content text of the editor as String.
    boolean isModified()
    Indicate if current opened file has been modified.
    boolean open​(java.io.File file)
    Replace the current edited file by file passed in argument.
    void paste()
    Paste current clicboard content into editor at caret position.
    void removeCaretListener​(javax.swing.event.CaretListener listener)
    Remove caret listener.
    void removeDocumentListener​(javax.swing.event.DocumentListener listener)
    Remove document listener.
    boolean saveAs​(java.io.File file)
    Replace the current edited file by file passed in argument.
    void setEnabled​(boolean b)
    Enable/disable editor.
    void setSyntax​(Editor.EditorSyntaxConstant editorSyntax)
    Force syntax to use
    void setText​(java.lang.String text)
    Set all text with text in argument.
  • Method Details

    • addDocumentListener

      void addDocumentListener​(javax.swing.event.DocumentListener listener)
      Add document listener.
      Parameters:
      listener - listener
    • removeDocumentListener

      void removeDocumentListener​(javax.swing.event.DocumentListener listener)
      Remove document listener.
      Parameters:
      listener - listener
    • addCaretListener

      void addCaretListener​(javax.swing.event.CaretListener listener)
      Add caret listener.
      Parameters:
      listener - listener
    • removeCaretListener

      void removeCaretListener​(javax.swing.event.CaretListener listener)
      Remove caret listener.
      Parameters:
      listener - listener
    • accept

      boolean accept​(java.io.File file)
      If return true, this editor support this file type. Default implementation return true.
      Parameters:
      file - file to test
      Returns:
      if return true, this editor support this file type.
    • accept

      boolean accept​(Editor.EditorSyntaxConstant editorSyntaxConstant)
      If return true, this editor support the syntax type. Default implementation return true.
      Parameters:
      editorSyntaxConstant - syntaxe type to test
      Returns:
      if return true, this editor support this syntax type.
    • isModified

      boolean isModified()
      Indicate if current opened file has been modified.
      Returns:
      true if current file is modified
    • open

      boolean open​(java.io.File file)
      Replace the current edited file by file passed in argument.
      Parameters:
      file - the file to open
      Returns:
      true if file has been opened
    • saveAs

      boolean saveAs​(java.io.File file)
      Replace the current edited file by file passed in argument.
      Parameters:
      file - the file to open
      Returns:
      true if file has been saved and reopen with new name
    • getText

      java.lang.String getText()
      Return the current content text of the editor as String.
      Returns:
      return the current content text of the editor as String
    • setText

      void setText​(java.lang.String text)
      Set all text with text in argument.
      Parameters:
      text - test to set
    • cut

      void cut()
      Cut current editor selection into system clipboard.
    • copy

      void copy()
      Copy current current selection into system clipboard.
    • paste

      void paste()
      Paste current clicboard content into editor at caret position.
    • setEnabled

      void setEnabled​(boolean b)
      Enable/disable editor.
      Parameters:
      b - enable
    • setSyntax

      void setSyntax​(Editor.EditorSyntaxConstant editorSyntax)
      Force syntax to use
      Parameters:
      editorSyntax - to use