Oxygen XML Editor 11.2 Author API

ro.sync.exml.workspace.api.editor
Interface WSEditorBase

All Known Subinterfaces:
AuthorEditorAccess, WSEditor

public interface WSEditorBase

Provides access to methods related to the editor actions and information.

*********************************
EXPERIMENTAL - Subject to change
*********************************

Please note that this API is not marked as final and it can change in one of the next versions of the application. If you have suggestions, comments about it, please let us know.

Since:
11.2

Method Summary
 boolean close(boolean askForSave)
          Closes the current editor.
 Reader createContentReader()
          Create a reader over the whole editor's content (exactly the XML content which gets saved on disk).
 URL getEditorLocation()
          Get the URL representing the editor location.
 boolean isModified()
          This method can be used to determine if the document from the editor contains unsaved modifications.
 boolean isNewDocument()
          This method can be used to determine if the document from the editor was ever saved.
 void reloadContent(Reader reader)
          Update the whole content of the editor with the one taken from the reader.
 void save()
          Saves the editor content.
 void setModified(boolean modified)
          Set the modified status of the editor document.
 

Method Detail

getEditorLocation

URL getEditorLocation()
Get the URL representing the editor location.

Returns:
The editor location. It cannot be null.

save

void save()
Saves the editor content.


close

boolean close(boolean askForSave)
Closes the current editor.

If the editor has unsaved content and askForSave is true, the user will be given the opportunity to save it.

Parameters:
askForSave - true to save the editor contents if required, and false to discard any unsaved changes.
Returns:
true if the editor was successfully closed, and false if the editor is still open

isModified

boolean isModified()
This method can be used to determine if the document from the editor contains unsaved modifications.

Returns:
true if the document in the current editor contains unsaved modifications.

setModified

void setModified(boolean modified)
Set the modified status of the editor document. For SWT the result of this method is guaranteed only when working exclusively with the author page. If the text page contains modifications (and is marked as dirty) this method is unable to change its state to unmodified.

Parameters:
modified - true if the document in the current editor contains unsaved modifications.

isNewDocument

boolean isNewDocument()
This method can be used to determine if the document from the editor was ever saved.

Returns:
true if the document in the current editor is new.

createContentReader

Reader createContentReader()
Create a reader over the whole editor's content (exactly the XML content which gets saved on disk). The unsaved changes are included. If for the Author page change tracking highlights are present, they are also included as processing instructions.

Returns:
The content reader.In normal circumstances the reader should not be null.
See Also:
for the processing instruction names

reloadContent

void reloadContent(Reader reader)
Update the whole content of the editor with the one taken from the reader. This will lose undo history and any modifications the editor may have.

Parameters:
reader - The reader provided by the extension.

Oxygen XML Editor 11.2 Author API

© Copyright SyncRO Soft SRL 2002 - 2010.