public static interface GeckoSession.SelectionActionDelegate
Modifier and Type | Interface and Description |
---|---|
static class |
GeckoSession.SelectionActionDelegate.Selection
Represents attributes of a selection.
|
Modifier and Type | Field and Description |
---|---|
static String |
ACTION_COLLAPSE_TO_END
Collapse the current selection to its end position.
|
static String |
ACTION_COLLAPSE_TO_START
Collapse the current selection to its start position.
|
static String |
ACTION_COPY
Copy the selected content onto the clipboard.
|
static String |
ACTION_CUT
Copy onto the clipboard then delete the selected content.
|
static String |
ACTION_DELETE
Delete the selected content.
|
static String |
ACTION_HIDE
Hide selection actions and cause
onHideAction(org.mozilla.geckoview.GeckoSession, int) to be called. |
static String |
ACTION_PASTE
Replace the selected content with the clipboard content.
|
static String |
ACTION_SELECT_ALL
Select the entire content of the document or editor.
|
static String |
ACTION_UNSELECT
Clear the current selection.
|
static int |
FLAG_IS_COLLAPSED
The selection is collapsed at a single position.
|
static int |
FLAG_IS_EDITABLE
The selection is inside editable content such as an input element or
contentEditable node.
|
static int |
FLAG_IS_PASSWORD
The selection is inside a password field.
|
static int |
HIDE_REASON_ACTIVE_SCROLL
Actions are no longer available due to the user actively scrolling the page.
|
static int |
HIDE_REASON_ACTIVE_SELECTION
Actions are no longer available due to the user actively changing the
selection.
|
static int |
HIDE_REASON_INVISIBLE_SELECTION
Actions are no longer available due to the user moving the selection out of view.
|
static int |
HIDE_REASON_NO_SELECTION
Actions are no longer available due to the user clearing the selection.
|
Modifier and Type | Method and Description |
---|---|
default void |
onHideAction(GeckoSession session,
int reason)
Previous actions are no longer available due to the user interacting with the
page.
|
default void |
onShowActionRequest(GeckoSession session,
GeckoSession.SelectionActionDelegate.Selection selection)
Selection actions are available.
|
static final int FLAG_IS_COLLAPSED
static final int FLAG_IS_EDITABLE
static final int FLAG_IS_PASSWORD
static final String ACTION_HIDE
onHideAction(org.mozilla.geckoview.GeckoSession, int)
to be called.static final String ACTION_CUT
static final String ACTION_COPY
static final String ACTION_DELETE
static final String ACTION_PASTE
static final String ACTION_SELECT_ALL
static final String ACTION_UNSELECT
static final String ACTION_COLLAPSE_TO_START
static final String ACTION_COLLAPSE_TO_END
static final int HIDE_REASON_NO_SELECTION
static final int HIDE_REASON_INVISIBLE_SELECTION
static final int HIDE_REASON_ACTIVE_SELECTION
onShowActionRequest(org.mozilla.geckoview.GeckoSession, org.mozilla.geckoview.GeckoSession.SelectionActionDelegate.Selection)
may be called again once the user has
set a selection, if the new selection has available actions.static final int HIDE_REASON_ACTIVE_SCROLL
onShowActionRequest(org.mozilla.geckoview.GeckoSession, org.mozilla.geckoview.GeckoSession.SelectionActionDelegate.Selection)
may be called again once the user has stopped
scrolling the page, if the selection is still visible. Until then, previous
actions are still available after a callback with this reason.@UiThread default void onShowActionRequest(@NonNull GeckoSession session, @NonNull GeckoSession.SelectionActionDelegate.Selection selection)
GeckoSession.SelectionActionDelegate.Selection.isActionAvailable(java.lang.String)
then either use the relevant
helper method or GeckoSession.SelectionActionDelegate.Selection.execute(java.lang.String)
Once an onHideAction(org.mozilla.geckoview.GeckoSession, int)
call (with particular reasons) or another onShowActionRequest(org.mozilla.geckoview.GeckoSession, org.mozilla.geckoview.GeckoSession.SelectionActionDelegate.Selection)
call is received, the previous Selection object is no longer
usable.session
- The GeckoSession that initiated the callback.selection
- Current selection attributes and Callback object for performing built-in
actions. May be used multiple times to perform multiple actions at once.@UiThread default void onHideAction(@NonNull GeckoSession session, int reason)
session
- The GeckoSession that initiated the callback.reason
- The reason that actions are no longer available, as one of the
HIDE_REASON_*
constants.