org.nuiton.widget.editor
Interface EditorInterface

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

public interface EditorInterface

EditorInterface.

Version:
$Revision: 300 $ Last update: $Date: 2010-11-17 22:35:44 +0100 (mer., 17 nov. 2010) $ by : $Author: sletellier $
Author:
poussin Created: 6 août 2006 12:54:19, poussin

Method Summary
 boolean accept(Editor.EditorSyntaxConstant editorSyntaxConstant)
          If return true, this editor support the syntax type.
 boolean accept(File file)
          If return true, this editor support this file type.
 void addCaretListener(CaretListener listener)
          Add caret listener.
 void addDocumentListener(DocumentListener listener)
          Add document listener.
 void copy()
          Copy current current selection into system clipboard.
 void cut()
          Cut current editor selection into system clipboard.
 String getText()
          Return the current content text of the editor as String.
 boolean isModified()
          Indicate if current opened file has been modified.
 boolean open(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(CaretListener listener)
          Remove caret listener.
 void removeDocumentListener(DocumentListener listener)
          Remove document listener.
 boolean saveAs(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(String text)
          Set all text with text in argument.
 

Method Detail

addDocumentListener

void addDocumentListener(DocumentListener listener)
Add document listener.

Parameters:
listener - listener

removeDocumentListener

void removeDocumentListener(DocumentListener listener)
Remove document listener.

Parameters:
listener - listener

addCaretListener

void addCaretListener(CaretListener listener)
Add caret listener.

Parameters:
listener - listener

removeCaretListener

void removeCaretListener(CaretListener listener)
Remove caret listener.

Parameters:
listener - listener

accept

boolean accept(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(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(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

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(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


Copyright © 2004-2011 CodeLutin. All Rights Reserved.