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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
accept(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(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 asString
.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 usevoid
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 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:
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 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
-
-