Class TextSelectionTouchTool
java.lang.Object
com.levigo.jadice.web.client.tool.Tool
com.levigo.jadice.web.client.tools.TextSelectionTouchTool
- All Implemented Interfaces:
MenuContributor
A tool for selecting text via touch input. Text is selected when with a long touch.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.levigo.jadice.web.client.tool.Tool
Tool.ActivationRequest
-
Field Summary
Fields inherited from class com.levigo.jadice.web.client.tool.Tool
DEFAULT_PRIORITY, MAX_PRIORITY, MIN_PRIORITY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
contribute
(ContributionContext context, MenuBuilder menuBuilder) This method is called in order to give the menu contributor a chance to contribute context menu entries via the suppliedMenuBuilder
.protected void
copySelectedText
(List<Selection> selections) Copy the selected text to theClipboard
so that one can paste it later on into some target application.protected Tool.ActivationRequest
Provide feedback for the user about what would happen, if the finger were moved from the current location.protected HighlightTool
protected com.levigo.jadice.web.client.viewer.internal.BasicPageView
protected void
handleMouseReleased
(MouseEditEvent e, boolean isActive) Invoked when a mouse button has been released on a component.protected void
handleTouchStart
(TouchEditEvent e, boolean isActive) Invoked when a touch started.protected void
render
(RenderParameters parameters, boolean isActive) Renders the Tool's UI onto the givenGraphics2D
context using the givenRenderControls
.protected void
repaint()
protected void
setActive
(boolean active) Receive notification from the tool manager about the tool's active state.void
setHighlightTool
(Class<? extends HighlightTool> highlightTool) Overwrite the used HighlightTool.protected void
setManager
(ToolManager manager) Receives theToolManager
instance, which theTool
implementation has been registered for.Methods inherited from class com.levigo.jadice.web.client.tool.Tool
ensureDebugId, getActivationFeedback, getActivationRequest, getActivationRequestForKeyPressed, getActivationRequestForMouseDragged, getActivationRequestForMousePressed, getActivationRequestForTouchMove, getActivationRequestForTouchStart, getDispatchPriority, getManager, getRenderPriority, handleEditEvent, handleGestureChange, handleGestureEnd, handleGestureStart, handleKeyPressed, handleKeyReleased, handleKeyTyped, handleMouseClicked, handleMouseDragged, handleMouseEntered, handleMouseExited, handleMouseMoved, handleMousePressed, handleMouseWheelMoved, handleTouchEnd, handleTouchMove, propagatePropertyChange, setCursor, setCursor, setEnabled, setStatusFeedback
-
Field Details
-
KEY_SELECT
- See Also:
-
-
Constructor Details
-
TextSelectionTouchTool
public TextSelectionTouchTool()
-
-
Method Details
-
getPageView
protected com.levigo.jadice.web.client.viewer.internal.BasicPageView getPageView() -
repaint
protected void repaint() -
getActivationFeedback
Description copied from class:Tool
Provide feedback for the user about what would happen, if the finger were moved from the current location. This method is called while handlingTouchMoveEvent
events. If this method returnsnull
no feedback is provided at all. This method should only return an activation request if it will actually candidate for auto-activation later on usingTool.getActivationRequestForTouchStart(TouchEditEvent)
orTool.getActivationRequestForTouchMove(TouchEditEvent)
.- Overrides:
getActivationFeedback
in classTool
- Parameters:
e
- theTouchEditEvent
- Returns:
- the
Tool.ActivationRequest
-
setManager
Description copied from class:Tool
Receives theToolManager
instance, which theTool
implementation has been registered for. If theTool
isderegistered
this method will be called with null.- Overrides:
setManager
in classTool
- Parameters:
manager
- theToolManager
-
render
Description copied from class:Tool
Renders the Tool's UI onto the givenGraphics2D
context using the givenRenderControls
.This render method is called within the context and during the rendering of a single page. The page being rendered is passed to implementors of this method in order to be able to control and influence the page rendering.
-
handleTouchStart
Description copied from class:Tool
Invoked when a touch started.- Overrides:
handleTouchStart
in classTool
- Parameters:
e
- theTouchEditEvent
isActive
- whether this tool is currently active
-
handleMouseReleased
Description copied from class:Tool
Invoked when a mouse button has been released on a component.- Overrides:
handleMouseReleased
in classTool
- Parameters:
e
- the eventisActive
- whether this tool is currently active
-
copySelectedText
Copy the selected text to theClipboard
so that one can paste it later on into some target application.- Parameters:
selections
- containing selected text elements.
-
setHighlightTool
Overwrite the used HighlightTool. This is for testing only.- Parameters:
highlightTool
- the Class to use
-
getHighlightTool
-
setActive
protected void setActive(boolean active) Description copied from class:Tool
Receive notification from the tool manager about the tool's active state.
-