Oxygen XML Editor 14.2 Author API

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

All Known Subinterfaces:
AuthorEditorAccess, WSEditor

@API(type=NOT_EXTENDABLE,
     src=PUBLIC)
public interface WSEditorBase

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

Since:
11.2

Method Summary
 boolean close(boolean askForSave)
          Closes the current editor.
 java.io.Reader createContentReader()
          Create a reader over the whole editor's content (exactly the XML content which gets saved on disk).
 java.net.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(java.io.Reader reader)
          Update the whole content of the editor with the one taken from the reader.
 void reloadContent(java.io.Reader reader, boolean discardUndoableEdits)
          Update the whole content of the editor with the one taken from the reader.
 void save()
          Saves the editor content.
 void saveAs(java.net.URL location)
          Saves the editor content to a new location.
 void setEditorTabText(java.lang.String tabText)
          Set the text which appears on the editor's tab, by default it is the loaded file name.
 void setEditorTabTooltipText(java.lang.String tabTooltip)
          Set the tooltip text for the editor's tab, by default it is the loaded file path.
 void setModified(boolean modified)
          Set the modified status of the editor document.
 

Method Detail

getEditorLocation

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

Returns:
The editor location. It cannot be null.

save

void save()
Saves the editor content.


saveAs

void saveAs(java.net.URL location)
Saves the editor content to a new location. This method is not implemented in the Oxygen Eclipse plugin.

Parameters:
location - The new editor location.
Since:
13

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

java.io.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(java.io.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.

reloadContent

void reloadContent(java.io.Reader reader,
                   boolean discardUndoableEdits)
Update the whole content of the editor with the one taken from the reader. This will lose any modifications the editor may have unless discardUndoableEdits is false in which case you will be able to UNDO the editor to the content prior to the reload.

Parameters:
reader - The reader provided by the extension.
discardUndoableEdits - true to lose undo history.
Since:
13.2

setEditorTabText

void setEditorTabText(java.lang.String tabText)
Set the text which appears on the editor's tab, by default it is the loaded file name. Set it with the value NULL to reset the tab title to the default value (the loaded file name). This feature is not available in the Oxygen Eclipse Plugin.

Parameters:
tabText - the text which appears on the editor's tab, by default it is the loaded file name. NULL to reset the tab title to the default value (the loaded file name).
Since:
12.1

setEditorTabTooltipText

void setEditorTabTooltipText(java.lang.String tabTooltip)
Set the tooltip text for the editor's tab, by default it is the loaded file path. Set it with the value NULL to reset the tab title to the default value (the loaded file path). This feature is not available in the Oxygen Eclipse Plugin.

Parameters:
tabTooltip - the tooltip for the editor's tab, by default it is the loaded file path. NULL to reset the tab tooltip to the default value (the loaded file path).
Since:
12.1

Oxygen XML Editor 14.2 Author API

© Copyright SyncRO Soft SRL 2002 - 2013. All rights reserved.