Oxygen XML Editor 16.1 Author API

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

All Superinterfaces:
TransformationScenarioInvoker
All Known Subinterfaces:
AuthorEditorAccess, WSEditor

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

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.InputStream createContentInputStream()
          Create a properly encoded input stream reader over the whole editor's content (exactly the XML content which gets saved on disk).
 java.io.Reader createContentReader()
          Create a reader over the whole editor's content (exactly the XML content which gets saved on disk).
 DocumentTypeInformation getDocumentTypeInformation()
          Get information about the current document type configuration used to edit the XML document.
 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.
 
Methods inherited from interface ro.sync.exml.workspace.api.editor.transformation.TransformationScenarioInvoker
runTransformationScenarios
 

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

createContentInputStream

java.io.InputStream createContentInputStream()
                                             throws java.io.IOException
Create a properly encoded input stream 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:
An input stream over the XML contents.In normal circumstances the input stream should not be null.
Throws:
java.io.IOException
Since:
15.2
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).

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).

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

getDocumentTypeInformation

DocumentTypeInformation getDocumentTypeInformation()
Get information about the current document type configuration used to edit the XML document.

Returns:
information about the current document type configuration used to edit the XML document or null if no document type configuration is matched or the editor does not have an XML content type.
Since:
16.1

*********************************
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.


Oxygen XML Editor 16.1 Author API

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