org.nuiton.widget.editor
Interface EditorInterface

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

public interface EditorInterface

Author:
poussin

Method Summary
 boolean accept(java.io.File file)
          if return true, this editor support this file type.
 void addDocumentListener(javax.swing.event.DocumentListener listener)
          Add listener
 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 removeDocumentListener(javax.swing.event.DocumentListener listener)
          Remove listener
 boolean saveAs(java.io.File file)
          Replace the current edited file by file passed in argument
 void setText(java.lang.String text)
          Set all text with text in argument
 

Method Detail

addDocumentListener

void addDocumentListener(javax.swing.event.DocumentListener listener)
Add listener

Parameters:
listener -

removeDocumentListener

void removeDocumentListener(javax.swing.event.DocumentListener listener)
Remove listener

Parameters:
listener -

accept

boolean accept(java.io.File file)
if return true, this editor support this file type. Default implantation return true

Parameters:
file -
Returns:
if return true, this editor support this file type.

isModified

boolean isModified()
indicate if current opened file has been modified

Returns:
true if currend 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


Copyright © 2004-2009 CodeLutin. All Rights Reserved.