Oxygen XML Editor 13.2 Author API

ro.sync.exml.workspace.api.editor.page.author
Interface WSAuthorEditorPageBase

All Superinterfaces:
WSEditorPage, WSTextBasedEditorPage
All Known Subinterfaces:
AuthorEditorAccess, WSAuthorEditorPage

@API(type=NOT_EXTENDABLE,
     src=PUBLIC)
public interface WSAuthorEditorPageBase
extends WSTextBasedEditorPage

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

Since:
11.2

Method Summary
 void addAuthorAttributesDisplayFilter(AuthorAttributesDisplayFilter attributesDisplayFilter)
          Adds a filter for displaying attributes to the current author page.
 void addAuthorCaretListener(AuthorCaretListener caretListener)
          Adds a caret listener to the Author page.
 void addAuthorMouseListener(AuthorMouseListener mouseListener)
          Adds a mouse listener to the current author page.
 AuthorActionsProvider getActionsProvider()
          Provides access to actions already defined in the Author page like: Undo, Redo, Display Full Tags, Edit Attributes, etc.
 java.lang.Object getAuthorComponent()
          Get the internal component on which the Author page is rendered.
 int getBalancedSelectionEnd()
          Usually returns the same value as WSTextBasedEditorPage.getSelectionEnd().
 int getBalancedSelectionStart()
          Usually returns the same value as WSTextBasedEditorPage.getSelectionStart().
 AuthorSchemaAwareEditingHandler getDefaultAuthorSchemaAwareEditingHandler()
          Get the default schema aware editing handler.
 AuthorNode getFullySelectedNode()
          Get the node which is fully and perfectly surrounded by the current selection in the Author editor.
If the selection surrounds perfectly the node (the selection starts at the node start offset and ends immediately after the node end offset), the node will be returned, otherwise null will be returned.
For example if a node is selected using Outline or the Breadcrumb, the method will return the corresponding node.
 AuthorHighlighter getHighlighter()
          Get the highlighter which can be used to add/remove/manage the custom user highlights
 AuthorPersistentHighlighter getPersistentHighlighter()
          Get the persistent highlighter which can be used to add/remove/manage the custom persistent user highlights.
 Styles getStyles(AuthorNode node)
          Get the CSS styles which are used to render a particular Author node.
 void refresh()
          Reload the CSS files and perform a refresh on the whole document to recompute the layout and the styles for all the nodes based on the new CSS files content.
 void refresh(AuthorNode authorNode)
          Refresh the rendering layout and CSS styles for this node and all its contents.
 void removeAuthorAttributesDisplayFilter(AuthorAttributesDisplayFilter attributesDisplayFilter)
          Remove a filter for displaying attributes to the current author page.
 void removeAuthorCaretListener(AuthorCaretListener caretListener)
          Removes the specified caret listener from the Author page.
 void removeAuthorMouseListener(AuthorMouseListener mouseListener)
          Removes the specified mouse listener from the current author page.
 void setPopUpMenuCustomizer(AuthorPopupMenuCustomizer popUpCustomizer)
          Set the pop-up menu customizer which can be used to customize the pop-up menu (add/remove actions) before showing it in the Author page.
 AuthorViewToModelInfo viewToModel(int x, int y)
          Get the position in the document corresponding to the point in the author viewport component.
 
Methods inherited from interface ro.sync.exml.workspace.api.editor.page.WSTextBasedEditorPage
deleteSelection, getCaretOffset, getLocationOnScreenAsPoint, getSelectedText, getSelectionEnd, getSelectionStart, getWordAtCaret, hasSelection, modelToViewRectangle, select, selectWord, setCaretPosition, setEditable, viewToModelOffset
 

Method Detail

viewToModel

AuthorViewToModelInfo viewToModel(int x,
                                  int y)
Get the position in the document corresponding to the point in the author viewport component.

Parameters:
x - The "x" coordinate relative to the viewport origin.
y - The "y" coordinate relative to the viewport origin.
Returns:
The AuthorViewToModelInfo containing the offset and the node at offset corresponding to the given point. The method does not return null, instead an undefined view to model info object is returned if a valid one could not be determined.

setPopUpMenuCustomizer

void setPopUpMenuCustomizer(AuthorPopupMenuCustomizer popUpCustomizer)
Set the pop-up menu customizer which can be used to customize the pop-up menu (add/remove actions) before showing it in the Author page.

Parameters:
popUpCustomizer - the pop-up menu customizer.

addAuthorMouseListener

void addAuthorMouseListener(AuthorMouseListener mouseListener)
Adds a mouse listener to the current author page.

Parameters:
mouseListener - The AuthorMouseListener to be added.

removeAuthorMouseListener

void removeAuthorMouseListener(AuthorMouseListener mouseListener)
Removes the specified mouse listener from the current author page.

Parameters:
mouseListener - The AuthorMouseListener to be removed.

addAuthorCaretListener

void addAuthorCaretListener(AuthorCaretListener caretListener)
Adds a caret listener to the Author page.

Parameters:
caretListener - The AuthorCaretListener to be added.

removeAuthorCaretListener

void removeAuthorCaretListener(AuthorCaretListener caretListener)
Removes the specified caret listener from the Author page.

Parameters:
caretListener - The AuthorCaretListener to be removed.

refresh

void refresh(AuthorNode authorNode)
Refresh the rendering layout and CSS styles for this node and all its contents.

Parameters:
authorNode - The node for which the layout and styles will be recomputed.

refresh

void refresh()
Reload the CSS files and perform a refresh on the whole document to recompute the layout and the styles for all the nodes based on the new CSS files content.


getHighlighter

AuthorHighlighter getHighlighter()
Get the highlighter which can be used to add/remove/manage the custom user highlights

Returns:
The highlighter which can be used to add/remove/manage the custom user highlights.

getPersistentHighlighter

AuthorPersistentHighlighter getPersistentHighlighter()
Get the persistent highlighter which can be used to add/remove/manage the custom persistent user highlights.
Persistent highlights get serialized in the XML as processing instructions with the form:
<?oxy_custom_start prop1="val1"....?> xml content <?oxy_custom_end?>

Returns:
The persistent highlighter which can be used to add/remove/manage the custom user highlights.
Since:
12

getBalancedSelectionStart

int getBalancedSelectionStart()
Usually returns the same value as WSTextBasedEditorPage.getSelectionStart().
If the selection start is immediately to the right of a start tag and the corresponding end tag is contained in the selection, then the balanced selection start will be obtained by extending the selection start to contain the start tag.

Returns:
The balanced selection start offset, 0 based.
Since:
12

getBalancedSelectionEnd

int getBalancedSelectionEnd()
Usually returns the same value as WSTextBasedEditorPage.getSelectionEnd().
If the selection end is immediately to the left of a end tag and the corresponding start tag is contained in the selection, then the balanced selection end will be obtained by extending the selection end to contain the end tag.

Returns:
The balanced selection end offset, 0 based.
Since:
12

getDefaultAuthorSchemaAwareEditingHandler

AuthorSchemaAwareEditingHandler getDefaultAuthorSchemaAwareEditingHandler()
Get the default schema aware editing handler. This can be used from a custom AuthorSchemaAwareEditingHandler implementation from an ExtensionsBundle to delegate various operations to.

Returns:
the default schema aware editing handler.
Since:
12.1

getActionsProvider

AuthorActionsProvider getActionsProvider()
Provides access to actions already defined in the Author page like: Undo, Redo, Display Full Tags, Edit Attributes, etc.

Returns:
access to actions already defined in the Author page.
Since:
12.1

getAuthorComponent

java.lang.Object getAuthorComponent()
Get the internal component on which the Author page is rendered. Use of this method is discouraged but it may be useful in some cases like: This can be helpful when you want to set a busy cursor on the component for example or when you want to get access to the scroll bars. You can also request focus in the component by casting it to its native equivalent.

Returns:
for the stand alone version, a javax.swing.JPanel and for the eclipse implementation a org.eclipse.swt.widgets.Canvas.
Since:
12.2

getStyles

Styles getStyles(AuthorNode node)
Get the CSS styles which are used to render a particular Author node. This method MUST only be used to query styles. If you want to modify styles please use the StylesFilter.

Parameters:
node - The node for which we want to obtain the styles.
Returns:
the styles associated with the node.
Since:
12.2

addAuthorAttributesDisplayFilter

void addAuthorAttributesDisplayFilter(AuthorAttributesDisplayFilter attributesDisplayFilter)
Adds a filter for displaying attributes to the current author page.

Parameters:
attributesDisplayFilter - The AuthorAttributesDisplayFilter to be added.
Since:
13

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


removeAuthorAttributesDisplayFilter

void removeAuthorAttributesDisplayFilter(AuthorAttributesDisplayFilter attributesDisplayFilter)
Remove a filter for displaying attributes to the current author page.

Parameters:
attributesDisplayFilter - The AuthorAttributesDisplayFilter to be added.
Since:
13

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


getFullySelectedNode

AuthorNode getFullySelectedNode()
Get the node which is fully and perfectly surrounded by the current selection in the Author editor.
If the selection surrounds perfectly the node (the selection starts at the node start offset and ends immediately after the node end offset), the node will be returned, otherwise null will be returned.
For example if a node is selected using Outline or the Breadcrumb, the method will return the corresponding node.
In such cases the method AuthorDocumentController.getNodeAtOffset(int) called for the caret offset always returns the parent of the selected element as the caret is actually outside the selected element. Thus, in order to obtain the context node, this method should be used and if it returns null you can use the AuthorDocumentController.getNodeAtOffset(int) method.

Returns:
The selected node if the selection surrounds perfectly the node, null otherwise.
Since:
13.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 13.2 Author API

© Copyright SyncRO Soft SRL 2002 - 2012.