public abstract class Editor extends Object implements IEditor, IFileLocker, IAbstractFileListener
GROUP_NAME| Constructor and Description |
|---|
Editor(IWorkbench workbench,
IEditorProvider provider)
Constructs a new editor object and initializes it.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
assertOpened()
Checks whether the file was opened in the editor or not.
|
boolean |
canClose(boolean force)
Returns whether the window is ready to close or not.
|
protected boolean |
canModify()
Returns true if the editor can modify the file.
|
protected void |
fileLocked() |
void |
fileLocked(IFileLocker locker) |
void |
fileReleased(IFileLocker locker,
boolean modified) |
protected void |
fileUnlocked() |
IAbstractFile |
getAbstractFile()
Returns the abstract file that was loaded into the editor.
|
IFileInterpreter |
getFileInterpreter()
Returns the assigned file interpreter.
|
IEditorProvider |
getProvider() |
protected Color |
getSavedBackground() |
String |
getTitle()
Gets the title of the window.
|
protected IWorkbench |
getWorkbench() |
protected boolean |
isExternalModified() |
boolean |
isModified()
Returns true when the editor has changed the file and not written the
changes yet.
|
boolean |
isOpen()
Return a flag indicating whether the edior is opened or not.
|
void |
open(IFileInterpreter file) |
void |
save()
This method saves the current opened file.
|
protected void |
setModified(boolean modified)
Set the modified flag that is returned by the isModified method.
|
void |
windowActivated() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinitializegetMenuBar, getToolBar, getToolTipTextgetComponent, getIconpublic Editor(IWorkbench workbench, IEditorProvider provider)
protected void setModified(boolean modified)
modified - a flag indicating if the file was changed since the last saveprotected boolean canModify()
protected void assertOpened()
throws EditorNotOpenedException
EditorNotOpenedException - - if the file was not opened in the editor yetprotected IWorkbench getWorkbench()
public void open(IFileInterpreter file) throws EditorNotAcceptedException
EditorNotAcceptedExceptionpublic boolean isOpen()
IEditorpublic boolean canClose(boolean force)
IChildWindowcanClose in interface IChildWindowpublic IAbstractFile getAbstractFile() throws EditorNotOpenedException
IEditorgetAbstractFile in interface IEditorEditorNotOpenedException - - if the editor was not openedpublic IFileInterpreter getFileInterpreter() throws EditorNotOpenedException
IEditorgetFileInterpreter in interface IEditorEditorNotOpenedException - - if the editor was not openedpublic boolean isModified()
throws EditorNotOpenedException
IEditorisModified in interface IEditorEditorNotOpenedException - - if no file was opened in the editorpublic void save()
throws EditorNotOpenedException
IEditorsave in interface IEditorEditorNotOpenedException - - if the editor was not openedpublic IEditorProvider getProvider()
getProvider in interface IEditorpublic String getTitle()
IWindowprotected void fileLocked()
protected void fileUnlocked()
protected Color getSavedBackground()
protected boolean isExternalModified()
public void fileLocked(IFileLocker locker)
fileLocked in interface IAbstractFileListenerpublic void fileReleased(IFileLocker locker, boolean modified)
fileReleased in interface IAbstractFileListenerpublic void windowActivated()
windowActivated in interface IChildWindow