|
||||||||||
| 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
org.xwiki.gwt.dom.client.internal.ie.IESelection
public class IESelection
The implementation of Mozilla's selection specification using Internet Explorer's selection API.
| Nested Class Summary | |
|---|---|
protected static class |
IESelection.RangeBoundary
Specifies where a range starts or ends inside the DOM tree. |
| Constructor Summary | |
|---|---|
IESelection(NativeSelection nativeSelection)
Creates a new instance that wraps the given native selection object. |
|
| Method Summary | |
|---|---|
void |
addRange(Range range)
Adds a range to this selection. |
protected void |
addTextRange(Range range)
Creates a text selection from the given range. |
protected Element |
createBoundaryMarker()
|
protected IESelection.RangeBoundary |
getBoundary(TextRange textRange,
boolean start)
Computes the start or end container of a text range. |
protected int |
getFirstLineHeight(TextRange textRange)
|
protected int |
getLeft(Element element)
NOTE: For a strong element that starts in the middle of a line and spans multiple lines this method
returns the distance in pixels from its first character (provided it starts with text) to the left boundary of
the parent window. |
protected NativeSelection |
getNativeSelection()
|
protected int |
getOffset(TextRange left,
TextRange right,
boolean rightBoundary)
Computes the number of characters between the start of the left range to the specified boundary of the right range. |
Range |
getRangeAt(int index)
|
int |
getRangeCount()
|
protected int |
getTop(Element element)
|
protected void |
moveTextRangeBeforeElement(TextRange textRange,
Element element)
Moves the given text range before the specified element. |
void |
removeAllRanges()
Removes all ranges from the current selection. |
void |
removeRange(Range range)
Removes the given range from the selection. |
| Methods inherited from class org.xwiki.gwt.dom.client.internal.AbstractSelection |
|---|
collapse, collapseToEnd, collapseToStart, containsNode, deleteFromDocument, extend, getAnchorNode, getAnchorOffset, getFocusNode, getFocusOffset, isCollapsed, selectAllChildren, selectionLanguageChange, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public IESelection(NativeSelection nativeSelection)
nativeSelection - the underlying native selection object to be used| Method Detail |
|---|
protected NativeSelection getNativeSelection()
nativeSelectionpublic void addRange(Range range)
range - the range to be addedSelection.addRange(Range)protected void addTextRange(Range range)
range - the range to be added to the selectionprotected Element createBoundaryMarker()
public Range getRangeAt(int index)
index - the index of the range to retrieve. Usually the selection contains just one range.
Selection.getRangeAt(int)public int getRangeCount()
Selection.getRangeCount()public void removeAllRanges()
Selection.removeAllRanges()public void removeRange(Range range)
range - the range to be removed from the selection.Selection.removeRange(Range)
protected IESelection.RangeBoundary getBoundary(TextRange textRange,
boolean start)
textRange - the text range for which to compute the boundary containerstart - specifies which boundary container to compute
protected void moveTextRangeBeforeElement(TextRange textRange,
Element element)
textRange - the text range to be movedelement - the element before which the text range is movedprotected int getLeft(Element element)
strong element that starts in the middle of a line and spans multiple lines this method
returns the distance in pixels from its first character (provided it starts with text) to the left boundary of
the parent window. This is important since the bounding rectangle of the strong element can have the
width of the parent window so the distance from the left side of this bounding rectangle to the left boundary of
the parent window could be 0.
element - a DOM element
protected int getTop(Element element)
element - a DOM element
protected int getFirstLineHeight(TextRange textRange)
textRange - a text range
protected int getOffset(TextRange left,
TextRange right,
boolean rightBoundary)
left - the left text rangeright - the rich text rangerightBoundary - specifies which boundary of the right text range to consider. Use true for start
boundary and false for end boundary.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||