@API(type=NOT_EXTENDABLE, src=PUBLIC) public interface WSAuthorEditorPageBase extends WSTextBasedEditorPage, AuthorTooltipCustomizerProvider
Modifier and Type | Method and Description |
---|---|
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.
|
void |
addDNDListener(java.lang.Object dndListener)
Add a drag and drop listener in the Author editing mode.
|
void |
addPopUpMenuCustomizer(AuthorPopupMenuCustomizer popUpCustomizer)
Add 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.
|
java.net.URL |
buildURLForReferencedContent(int caretOffset,
boolean shortAnchor)
If the caret offset is somewhere inside an entity reference, an xi:include reference or a DITA content reference, this
method will return an URL which when used with Oxygen's API (ro.sync.exml.workspace.api.Workspace.open(URL)) will open the target resource
and then place the caret in the opened editor precisely at the location where it was in the original XML document which referenced the content.
|
void |
deleteSelection()
Delete the current selected text, if any.
|
void |
editAttribute(AuthorElement targetElement,
java.lang.String attributeName)
Searches through the in-place editors added on the given element for the first one
that edits the given attribute.
|
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.
|
AuthorFoldManager |
getAuthorFoldManager()
Get the fold manager which can be used to expand or collapse a fold.
|
AuthorSelectionModel |
getAuthorSelectionModel()
Get the Author selection model containing access to all Author selection
intervals and methods for adding simple and multiple selections.
|
int[] |
getBalancedSelection(int selectionStart,
int selectionEnd)
Usually returns the selection.
|
int |
getBalancedSelectionEnd()
Usually returns the same value as
getSelectionEnd() . |
int |
getBalancedSelectionStart()
Usually returns the same value as
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. |
AuthorNode |
getFullySelectedNode(int selectionStart,
int selectionEnd)
Get the node which is fully and perfectly surrounded by the given 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.
|
java.util.Map<PseudoElementDescriptor,Styles> |
getPseudoElementStyles(AuthorParentNode node)
Get the CSS styles used to render the pseudo-elements of an Author node.
|
java.lang.String |
getSelectedText()
Get the current selected text.
|
int |
getSelectionEnd()
Get end offset of the current selection.
|
int |
getSelectionStart()
Get start offset of the current selection.
|
Styles |
getStyles(AuthorNode node)
Get the CSS styles which are used to render a particular Author node.
|
int |
getTagsDisplayMode()
Get the display mode of the tags in the Author editor.
|
void |
goToNextEditablePosition(int startOffset,
int endOffset)
Identifies and goes to the next edit position.
|
boolean |
hasSelection()
Check if the editor page has a selection
Use AuthorSelectionModel to get more information and access to the Author
editor page selection. |
boolean |
isOffsetInInvisibleBounds(int offset)
Check whether the offset is in a region in the document which is not
rendered.
|
int |
moveOutOfInvisibleBounds(int offset,
boolean forward)
Check whether the offset is in a region in the document which is not
rendered.
|
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 |
removeDNDListener(java.lang.Object dndListener)
Remove a drag and drop listener.
|
void |
removePopUpMenuCustomizer(AuthorPopupMenuCustomizer popUpCustomizer)
Add 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.
|
void |
scrollToRectangle(Rectangle rectangle)
Scroll the Author viewport to a specific rectangle.
|
void |
select(int startOffset,
int endOffset)
Select the interval between start and end offset.
|
void |
setPopUpMenuCustomizer(AuthorPopupMenuCustomizer popUpCustomizer)
Deprecated.
This method removes all pop-up menu customizers already registered, please use the "addPopUpMenuCustomizer" method instead.
|
void |
setTagsDisplayMode(int displayMode)
Set the display mode of the tags in the Author editor.
|
AuthorViewToModelInfo |
viewToModel(int x,
int y)
Get the position in the document corresponding to the point in the author viewport component.
|
createAnchor, getCaretOffset, getLocationOnScreenAsPoint, getLocationRelativeToEditorFromScreen, getOffsetForAnchor, getStartEndOffsets, getWordAtCaret, modelToViewRectangle, scrollCaretToVisible, selectWord, setCaretPosition, viewToModelOffset
getParentEditor, hasFocus, isEditable, requestFocus, setEditable, setReadOnly, setReadOnly
addTooltipCustomizer, removeTooltipCustomizer
AuthorViewToModelInfo viewToModel(int x, int y)
x
- The "x" coordinate relative to the viewport origin.y
- The "y" coordinate relative to the viewport origin.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.@Deprecated void setPopUpMenuCustomizer(AuthorPopupMenuCustomizer popUpCustomizer)
popUpCustomizer
- the pop-up menu customizer.void addPopUpMenuCustomizer(AuthorPopupMenuCustomizer popUpCustomizer)
popUpCustomizer
- the pop-up menu customizer.
If the customizer is already added, it will not be added again.void removePopUpMenuCustomizer(AuthorPopupMenuCustomizer popUpCustomizer)
popUpCustomizer
- the pop-up menu customizer.void addAuthorMouseListener(AuthorMouseListener mouseListener)
mouseListener
- The AuthorMouseListener
to be added.void removeAuthorMouseListener(AuthorMouseListener mouseListener)
mouseListener
- The AuthorMouseListener
to be removed.void addAuthorCaretListener(AuthorCaretListener caretListener)
caretListener
- The AuthorCaretListener
to be added.void removeAuthorCaretListener(AuthorCaretListener caretListener)
caretListener
- The AuthorCaretListener
to be removed.void refresh(AuthorNode authorNode)
Note: This should be called on the AWT thread because it will generate a layout event.
authorNode
- The node for which the layout and styles will be recomputed.void refresh()
AuthorHighlighter getHighlighter()
AuthorPersistentHighlighter getPersistentHighlighter()
<?oxy_custom_start prop1="val1"....?> xml content <?oxy_custom_end?>
int getBalancedSelectionStart()
getSelectionStart()
.
int getBalancedSelectionEnd()
getSelectionEnd()
.
int[] getBalancedSelection(int selectionStart, int selectionEnd)
selectionStart
- The inclusive selection start.selectionEnd
- The exclusive selection end.AuthorSchemaAwareEditingHandler getDefaultAuthorSchemaAwareEditingHandler()
AuthorActionsProvider getActionsProvider()
java.lang.Object getAuthorComponent()
Styles getStyles(AuthorNode node)
StylesFilter
.node
- The node for which we want to obtain the styles.java.util.Map<PseudoElementDescriptor,Styles> getPseudoElementStyles(AuthorParentNode node)
StylesFilter
.node
- The node for which we want to obtain the pseudo-element styles.null
.void addAuthorAttributesDisplayFilter(AuthorAttributesDisplayFilter attributesDisplayFilter)
attributesDisplayFilter
- The AuthorAttributesDisplayFilter
to be added.void removeAuthorAttributesDisplayFilter(AuthorAttributesDisplayFilter attributesDisplayFilter)
attributesDisplayFilter
- The AuthorAttributesDisplayFilter
to be added.AuthorNode getFullySelectedNode()
null
will be returned.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.null
otherwise.AuthorNode getFullySelectedNode(int selectionStart, int selectionEnd)
null
will be returned.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.selectionStart
- Inclusive start offset.selectionEnd
- Exclusive end offset.null
otherwise.AuthorSelectionModel getAuthorSelectionModel()
int getSelectionStart()
AuthorSelectionModel
to get more information and access to the Author
editor page selection.
getSelectionStart
in interface WSTextBasedEditorPage
int getSelectionEnd()
AuthorSelectionModel
to get more information and access to the Author
editor page selection.
getSelectionEnd
in interface WSTextBasedEditorPage
java.lang.String getSelectedText()
AuthorSelectionModel
to get more information and access to the Author
editor page selection.
getSelectedText
in interface WSTextBasedEditorPage
void deleteSelection()
AuthorSelectionModel
to get more information and access to the Author
editor page selection.deleteSelection
in interface WSTextBasedEditorPage
boolean hasSelection()
AuthorSelectionModel
to get more information and access to the Author
editor page selection.hasSelection
in interface WSTextBasedEditorPage
true
if there is a selection, false
otherwise.void select(int startOffset, int endOffset)
AuthorSelectionModel
to get more information and access to the Author
editor page selection.select
in interface WSTextBasedEditorPage
startOffset
- Inclusive start offsetendOffset
- Exclusive end offsetboolean isOffsetInInvisibleBounds(int offset) throws javax.swing.text.BadLocationException
offset
- The offset to check.true
if the offset is in an invisible region.javax.swing.text.BadLocationException
- If the offset is outside the document.int moveOutOfInvisibleBounds(int offset, boolean forward) throws javax.swing.text.BadLocationException
offset
- The offset to check.forward
- true
if we should move to a position in a
forward direction.javax.swing.text.BadLocationException
- If the offset is outside the document.void goToNextEditablePosition(int startOffset, int endOffset) throws javax.swing.text.BadLocationException
startOffset
- The offset from where to start looking.endOffset
- The offset where to stop looking for.javax.swing.text.BadLocationException
- The given offset is invalid.void editAttribute(AuthorElement targetElement, java.lang.String attributeName)
targetElement
- The parent element of the attribute.attributeName
- The QName of the searched attribute.void scrollToRectangle(Rectangle rectangle)
WSTextBasedEditorPage.modelToViewRectangle(int)
method.rectangle
- The rectangle to scroll to.AuthorFoldManager getAuthorFoldManager()
void addDNDListener(java.lang.Object dndListener)
dndListener
- The drag and drop listener.
Needs to be an instance of "ro.sync.exml.editor.xmleditor.pageauthor.AuthorDnDListener" for the standalone implementation and
com.oxygenxml.editor.editors.author.AuthorDnDListener for the Eclipse implementation.void removeDNDListener(java.lang.Object dndListener)
dndListener
- The drag and drop listener to remove.void setTagsDisplayMode(int displayMode)
displayMode
- The tags display mode, one of DisplayModeConstants
constants.int getTagsDisplayMode()
DisplayModeConstants
constants).java.net.URL buildURLForReferencedContent(int caretOffset, boolean shortAnchor)
caretOffset
- The offset at which the caret is currently located.shortAnchor
- Flag telling whether to build a short version of the referenced content URL or not. This format is used in Web Author.null
if the caret position is not inside a reference.© Copyright Syncro Soft SRL 2002 - 2023. All rights reserved.