Interface EditorInterface
-
- All Known Implementing Classes:
DefaultEditor,Editor,JEditEditor,NullEditor,RSyntaxEditor,SDocEditor
public interface EditorInterfaceEditorInterface.- Version:
- $Revision$ Last update: $Date$ by : $Author$
- Author:
- poussin Created: 6 août 2006 12:54:19, poussin
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanaccept(File file)If return true, this editor support this file type.booleanaccept(Editor.EditorSyntaxConstant editorSyntaxConstant)If return true, this editor support the syntax type.voidaddCaretListener(CaretListener listener)Add caret listener.voidaddDocumentListener(DocumentListener listener)Add document listener.voidcopy()Copy current current selection into system clipboard.voidcut()Cut current editor selection into system clipboard.StringgetText()Return the current content text of the editor asString.booleanisModified()Indicate if current opened file has been modified.booleanopen(File file)Replace the current edited file by file passed in argument.voidpaste()Paste current clicboard content into editor at caret position.voidremoveCaretListener(CaretListener listener)Remove caret listener.voidremoveDocumentListener(DocumentListener listener)Remove document listener.booleansaveAs(File file)Replace the current edited file by file passed in argument.voidsetEnabled(boolean b)Enable/disable editor.voidsetSyntax(Editor.EditorSyntaxConstant editorSyntax)Force syntax to usevoidsetText(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 returntrue.- 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 returntrue.- 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:
trueif 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 asString.- 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
-
-