public static class GeckoSession.SelectionActionDelegate.Selection extends Object
Modifier and Type | Field and Description |
---|---|
Collection<String> |
availableActions
Set of valid actions available through
execute(String) |
RectF |
clientRect
The bounds of the current selection in client coordinates.
|
int |
flags
Flags describing the current selection, as a bitwise combination
of the
FLAG_* constants. |
String |
text
Text content of the current selection.
|
Modifier | Constructor and Description |
---|---|
protected |
Selection()
Empty constructor for tests.
|
Modifier and Type | Method and Description |
---|---|
void |
collapseToEnd()
Collapse the current selection to its end position.
|
void |
collapseToStart()
Collapse the current selection to its start position.
|
void |
copy()
Copy the selected content onto the clipboard.
|
void |
cut()
Copy onto the clipboard then delete the selected content.
|
void |
delete()
Delete the selected content.
|
void |
execute(String action)
Execute an
GeckoSession.SelectionActionDelegate action. |
void |
hide()
Hide selection actions and cause
GeckoSession.SelectionActionDelegate.onHideAction(org.mozilla.geckoview.GeckoSession, int) to be called. |
boolean |
isActionAvailable(String action)
Checks if the passed action is available
|
void |
paste()
Replace the selected content with the clipboard content.
|
void |
selectAll()
Select the entire content of the document or editor.
|
void |
unselect()
Clear the current selection.
|
public final int flags
FLAG_*
constants.@NonNull public final String text
@Nullable public final RectF clientRect
GeckoSession.getClientToScreenMatrix(android.graphics.Matrix)
to perform transformation to screen
coordinates.@NonNull public final Collection<String> availableActions
execute(String)
@AnyThread public boolean isActionAvailable(@NonNull String action)
action
- An GeckoSession.SelectionActionDelegate
to perform@AnyThread public void execute(@NonNull String action)
GeckoSession.SelectionActionDelegate
action.action
- A GeckoSession.SelectionActionDelegate
action.IllegalStateException
- If the action was not available.@AnyThread public void hide()
GeckoSession.SelectionActionDelegate.onHideAction(org.mozilla.geckoview.GeckoSession, int)
to be called.IllegalStateException
- If the action was not available.@AnyThread public void cut()
IllegalStateException
- If the action was not available.@AnyThread public void copy()
IllegalStateException
- If the action was not available.@AnyThread public void delete()
IllegalStateException
- If the action was not available.@AnyThread public void paste()
IllegalStateException
- If the action was not available.@AnyThread public void selectAll()
IllegalStateException
- If the action was not available.@AnyThread public void unselect()
IllegalStateException
- If the action was not available.@AnyThread public void collapseToStart()
IllegalStateException
- If the action was not available.@AnyThread public void collapseToEnd()
IllegalStateException
- If the action was not available.