@API(type=NOT_EXTENDABLE, src=PUBLIC) public interface WSEditorBase extends ModifiedStatusProvider, ScenarioInvoker
Modifier and Type | Method and Description |
---|---|
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. |
java.lang.String |
getEncodingForSerialization()
Get the Java character encoding of this editor's content.
In Eclipse, this method will return the encoding detected when opening the editor, and it will not be aware of encoding changes until the editor is re-opened. |
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.
|
isModified
runTransformationScenario, runTransformationScenarios, stopCurrentTransformationScenario
runValidationScenarios
java.lang.String getEncodingForSerialization()
null
if couldn't be detected.java.net.URL getEditorLocation()
URL
representing the editor location.null
.void save()
void saveAs(java.net.URL location)
location
- The new editor location.boolean close(boolean askForSave)
If the editor has unsaved content and askForSave
is
true
, the user will be given the opportunity to save it.
askForSave
- true
to save the editor contents if required,
and false
to discard any unsaved changes.true
if the editor was successfully closed, and
false
if the editor is still openvoid setModified(boolean modified)
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.
For Web Author, can be used to mark the document as clean and to make sure that the clean state is properly identified after a series of undo/redo operations. This method has some limitations:
false
.
modified
- true
if the document in the current editor contains unsaved modifications.boolean isNewDocument()
true
if the document in the current editor is new.java.io.Reader createContentReader()
null
.for the processing instruction names
java.io.InputStream createContentInputStream() throws java.io.IOException
null
.java.io.IOException
- If an I/O exception occurs.for the processing instruction names
void reloadContent(java.io.Reader reader)
reader
- The reader provided by the extension.void reloadContent(java.io.Reader reader, boolean discardUndoableEdits)
false
in which case you will be able to UNDO the editor
to the content prior to the reload.reader
- The reader provided by the extension.discardUndoableEdits
- true
to lose undo history.void setEditorTabText(java.lang.String tabText)
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).void setEditorTabTooltipText(java.lang.String tabTooltip)
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).DocumentTypeInformation getDocumentTypeInformation()
null
if no document type
configuration is matched or the editor does not have an XML content type.© Copyright Syncro Soft SRL 2002 - 2023. All rights reserved.