Class TextSelectionTouchTool

java.lang.Object
com.levigo.jadice.web.client.tool.Tool
com.levigo.jadice.web.client.tools.TextSelectionTouchTool
All Implemented Interfaces:
MenuContributor

public class TextSelectionTouchTool extends Tool
A tool for selecting text via touch input. Text is selected when with a long touch.
  • Field Details

  • Constructor Details

    • TextSelectionTouchTool

      public TextSelectionTouchTool()
  • Method Details

    • getPageView

      protected com.levigo.jadice.web.client.viewer.internal.BasicPageView getPageView()
    • repaint

      protected void repaint()
    • getActivationFeedback

      protected Tool.ActivationRequest getActivationFeedback(TouchEditEvent e)
      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 handling TouchMoveEvent events. If this method returns null no feedback is provided at all. This method should only return an activation request if it will actually candidate for auto-activation later on using Tool.getActivationRequestForTouchStart(TouchEditEvent) or Tool.getActivationRequestForTouchMove(TouchEditEvent).
      Overrides:
      getActivationFeedback in class Tool
      Parameters:
      e - the TouchEditEvent
      Returns:
      the Tool.ActivationRequest
    • setManager

      protected void setManager(ToolManager manager)
      Description copied from class: Tool
      Receives the ToolManager instance, which the Tool implementation has been registered for. If the Tool is deregistered this method will be called with null.
      Overrides:
      setManager in class Tool
      Parameters:
      manager - the ToolManager
    • render

      protected void render(RenderParameters parameters, boolean isActive)
      Description copied from class: Tool
      Renders the Tool's UI onto the given Graphics2D context using the given RenderControls.

      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.

      Overrides:
      render in class Tool
      Parameters:
      parameters - the view component which is currently being rendered
      isActive - whether the called tool is currently active
    • handleTouchStart

      protected void handleTouchStart(TouchEditEvent e, boolean isActive)
      Description copied from class: Tool
      Invoked when a touch started.
      Overrides:
      handleTouchStart in class Tool
      Parameters:
      e - the TouchEditEvent
      isActive - whether this tool is currently active
    • handleMouseReleased

      protected void handleMouseReleased(MouseEditEvent e, boolean isActive)
      Description copied from class: Tool
      Invoked when a mouse button has been released on a component.
      Overrides:
      handleMouseReleased in class Tool
      Parameters:
      e - the event
      isActive - whether this tool is currently active
    • copySelectedText

      protected void copySelectedText(List<Selection> selections)
      Copy the selected text to the Clipboard so that one can paste it later on into some target application.
      Parameters:
      selections - containing selected text elements.
    • setHighlightTool

      public void setHighlightTool(Class<? extends HighlightTool> highlightTool)
      Overwrite the used HighlightTool. This is for testing only.
      Parameters:
      highlightTool - the Class to use
    • getHighlightTool

      protected HighlightTool getHighlightTool()
    • setActive

      protected void setActive(boolean active)
      Description copied from class: Tool
      Receive notification from the tool manager about the tool's active state.
      Overrides:
      setActive in class Tool
      Parameters:
      active - controls whether to activate or deactivate this Tool
    • contribute

      public void contribute(ContributionContext context, MenuBuilder menuBuilder)
      Description copied from interface: MenuContributor
      This method is called in order to give the menu contributor a chance to contribute context menu entries via the supplied MenuBuilder.
      Specified by:
      contribute in interface MenuContributor
      Overrides:
      contribute in class Tool
      Parameters:
      context - the ContributionContext which provides contribution context informations
      menuBuilder - the MenuBuilder to which the tool may contribute entries.