Package snap.view

Class ViewEnv

java.lang.Object
snap.view.ViewEnv

public abstract class ViewEnv extends Object
An interface for platform specific UI functionality.
  • Field Details

    • _env

      protected static ViewEnv _env
  • Constructor Details

    • ViewEnv

      public ViewEnv()
  • Method Details

    • getEnv

      public static ViewEnv getEnv()
      Returns the node environment.
    • isEventThread

      public abstract boolean isEventThread()
      Returns whether current thread is event thread.
    • runLater

      public abstract void runLater(Runnable aRun)
      Run given runnable on event thread.
    • runLaterOnce

      public void runLaterOnce(Runnable aRun)
      Runs the given runnable once.
    • runLaterOnce

      public void runLaterOnce(String aName, Runnable aRun)
      Runs the given runnable for name once.
    • runDelayed

      public void runDelayed(Runnable aRun, int aDelay)
      Runs given runnable after delay.
    • runIntervals

      public void runIntervals(Runnable aRun, int aPeriod)
      Runs given runnable repeatedly every period milliseconds.
    • stopIntervals

      public void stopIntervals(Runnable aRun)
      Stops running given runnable.
    • runLaterAndWait

      public void runLaterAndWait(Runnable aRun)
      Runs a runnable later and waits for it to finish.
    • getUISource

      public WebURL getUISource(Class<?> aClass)
      Returns a UI source for given class.
    • getClipboard

      public Clipboard getClipboard()
      Returns the system clipboard.
    • getClipboardDrag

      public Clipboard getClipboardDrag()
      Returns the clipboard for dragging.
    • createHelper

      public WindowView.WindowHpr createHelper(View aView)
      Returns a ViewHelper for given native component.
    • createEvent

      public abstract ViewEvent createEvent(View aView, Object anEvent, ViewEvent.Type aType, String aName)
      Sends an event for a UI node.
    • getScreenBoundsInset

      public Rect getScreenBoundsInset()
      Returns the screen bounds inset to usable area.
    • activateApp

      public void activateApp(View aView)
      Activates the App giving focus to given node.
    • showFilePicker

      public void showFilePicker(String[] fileTypes, Consumer<WebFile> pickedFileHandler)
      Shows a file picker.
    • complain

      protected void complain(String s)