Class ContextMenu.TouchTimer

Object
Timer
TouchTimer
Enclosing class:
ContextMenu

public class ContextMenu.TouchTimer extends Timer
Timer for handling touch events triggering the context menu. Used to save the position where the context menu was requested as well as the listening widget for use once the timer fires (if it does).
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) ContextMenu.Listener
    Listening widget that triggered the scheduling for the context menu.
    (package private) int
    Horizontal position of touch event scheduled to trigger context menu (relative to browser window).
    (package private) int
    Vertical position of touch event scheduled to trigger context menu (relative to browser window).
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a new timer for touch events.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    run()
    void
    save(ContextMenu.Listener ref, int x, int y)
    Save the listener widget as well as the position (relative to browser window) where the context menu will be displayed when (and if) the timer fires.

    Methods inherited from class Timer

    cancel, isRunning, schedule, scheduleRepeating

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • touchX

      int touchX
      Horizontal position of touch event scheduled to trigger context menu (relative to browser window).
    • touchY

      int touchY
      Vertical position of touch event scheduled to trigger context menu (relative to browser window).
    • listener

      Listening widget that triggered the scheduling for the context menu.
  • Constructor Details

    • TouchTimer

      public TouchTimer()
      Constructs a new timer for touch events.
  • Method Details

    • save

      public void save(ContextMenu.Listener ref, int x, int y)
      Save the listener widget as well as the position (relative to browser window) where the context menu will be displayed when (and if) the timer fires.
      Parameters:
      ref - listener widget that is (potentially) requesting a context menu
      x - horizontal position of touch event
      y - vertical position of touch event
    • run

      public void run()

      Show context menu.

      Specified by:
      run in class Timer