|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xwiki.gwt.dom.client.internal.AbstractSelection
public abstract class AbstractSelection
Abstract Selection implementation.
NOTE: In the current implementation we often make the assumption that the selection contains at most one range. All the other ranges, if they exist, are sometimes ignored. Additionally, but somehow as a consequence, we consider the anchor node as being the start container of the first range and the focus node as the end container of the first range. This has to do with the fact that not all the browsers distinguish the direction in which the user makes the selection (from left to right or the opposite).
| Constructor Summary | |
|---|---|
AbstractSelection()
|
|
| Method Summary | |
|---|---|
void |
collapse(com.google.gwt.dom.client.Node parentNode,
int offset)
Collapses the selection to a single point, at the specified offset in the given DOM node. |
void |
collapseToEnd()
Collapses the whole selection to a single point at the end of the current selection (irrespective of direction). |
void |
collapseToStart()
Collapses the whole selection to a single point at the start of the current selection (irrespective of direction). |
boolean |
containsNode(com.google.gwt.dom.client.Node node,
boolean partlyContained)
Indicates whether the given node is part of the selection. |
void |
deleteFromDocument()
Deletes this selection from document the nodes belong to. |
void |
extend(com.google.gwt.dom.client.Node parentNode,
int offset)
Extends the selection by moving the selection end to the specified node and offset, preserving the selection begin position. |
com.google.gwt.dom.client.Node |
getAnchorNode()
|
int |
getAnchorOffset()
|
com.google.gwt.dom.client.Node |
getFocusNode()
|
int |
getFocusOffset()
|
boolean |
isCollapsed()
|
void |
selectAllChildren(com.google.gwt.dom.client.Node parentNode)
Adds all children of the specified node to the selection. |
void |
selectionLanguageChange(boolean langRTL)
Modifies the cursor Bidi level after a change in keyboard direction. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.xwiki.gwt.dom.client.Selection |
|---|
addRange, getRangeAt, getRangeCount, removeAllRanges, removeRange |
| Constructor Detail |
|---|
public AbstractSelection()
| Method Detail |
|---|
public void collapse(com.google.gwt.dom.client.Node parentNode,
int offset)
collapse in interface SelectionparentNode - the DOM node where the selection will be setoffset - specifies where to place the selection in the given nodeSelection.collapse(Node, int)public void collapseToEnd()
collapseToEnd in interface SelectionSelection.collapseToEnd()public void collapseToStart()
collapseToStart in interface SelectionSelection.collapseToStart()
public boolean containsNode(com.google.gwt.dom.client.Node node,
boolean partlyContained)
containsNode in interface Selectionnode - the DOM node to be testedpartlyContained - if false, the entire subtree rooted in the given node is tested
Selection.containsNode(Node, boolean)public void deleteFromDocument()
deleteFromDocument in interface SelectionSelection.deleteFromDocument()
public void extend(com.google.gwt.dom.client.Node parentNode,
int offset)
extend in interface SelectionparentNode - the node where the selection will be extended tooffset - specifies where to end the selection in the given nodeSelection.extend(Node, int)public com.google.gwt.dom.client.Node getAnchorNode()
getAnchorNode in interface SelectionSelection.getAnchorNode()public int getAnchorOffset()
getAnchorOffset in interface SelectionSelection.getAnchorNode() where the selection beginsSelection.getAnchorOffset()public com.google.gwt.dom.client.Node getFocusNode()
getFocusNode in interface SelectionSelection.getFocusNode()public int getFocusOffset()
getFocusOffset in interface SelectionSelection.getFocusNode() where the selection ends.Selection.getFocusOffset()public boolean isCollapsed()
isCollapsed in interface SelectionSelection.isCollapsed()public void selectAllChildren(com.google.gwt.dom.client.Node parentNode)
selectAllChildren in interface SelectionparentNode - the parent of the children to be added to the selectionSelection.selectAllChildren(Node)public void selectionLanguageChange(boolean langRTL)
selectionLanguageChange in interface SelectionlangRTL - is true if the new language is right-to-left or false if the new language is left-to-rightSelection.selectionLanguageChange(boolean)public java.lang.String toString()
toString in interface SelectiontoString in class java.lang.ObjectSelection.toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||