public class SelectionPreserver extends Object
saveSelection() before the
dialog is shown and restoreSelection() after the dialog is closed.| Constructor and Description |
|---|
SelectionPreserver(RichTextArea rta)
Creates a new selection preserver for the specified rich text area.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearSelection()
Removes the markers from the document and clears the list of saved range place holders.
|
boolean |
hasSelection() |
void |
restoreSelection()
Restores the saved selection on the underlying rich text area and resets the state of the selection preserver.
|
void |
restoreSelection(boolean reset)
If there is a saved selection restores it, otherwise restores the default selection on the underlying rich text
area.
|
void |
saveSelection()
Saves the current selection for later changes.
|
public SelectionPreserver(RichTextArea rta)
rta - The rich text area whose selection will be preserved.public void clearSelection()
public void saveSelection()
restoreSelection()public boolean hasSelection()
true if there is a saved selection, false otherwisepublic void restoreSelection()
saveSelection()public void restoreSelection(boolean reset)
saveSelection() before.reset - true if you want to reset the state of the selection preserver, false otherwise.saveSelection()Copyright © 2004–2016 XWiki. All rights reserved.