Package snap.view
Class ViewEnv
java.lang.Object
snap.view.ViewEnv
An interface for platform specific UI functionality.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
activateApp
(View aView) Activates the App giving focus to given node.protected void
abstract ViewEvent
createEvent
(View aView, Object anEvent, ViewEvent.Type aType, String aName) Sends an event for a UI node.createHelper
(View aView) Returns a ViewHelper for given native component.Returns the system clipboard.Returns the clipboard for dragging.static ViewEnv
getEnv()
Returns the node environment.Returns the screen bounds inset to usable area.getUISource
(Class<?> aClass) Returns a UI source for given class.abstract boolean
Returns whether current thread is event thread.void
runDelayed
(Runnable aRun, int aDelay) Runs given runnable after delay.void
runIntervals
(Runnable aRun, int aPeriod) Runs given runnable repeatedly every period milliseconds.abstract void
Run given runnable on event thread.void
runLaterAndWait
(Runnable aRun) Runs a runnable later and waits for it to finish.void
runLaterOnce
(Runnable aRun) Runs the given runnable once.void
runLaterOnce
(String aName, Runnable aRun) Runs the given runnable for name once.void
showFilePicker
(String[] fileTypes, Consumer<WebFile> pickedFileHandler) Shows a file picker.void
stopIntervals
(Runnable aRun) Stops running given runnable.
-
Field Details
-
_env
-
-
Constructor Details
-
ViewEnv
public ViewEnv()
-
-
Method Details
-
getEnv
Returns the node environment. -
isEventThread
public abstract boolean isEventThread()Returns whether current thread is event thread. -
runLater
Run given runnable on event thread. -
runLaterOnce
Runs the given runnable once. -
runLaterOnce
Runs the given runnable for name once. -
runDelayed
Runs given runnable after delay. -
runIntervals
Runs given runnable repeatedly every period milliseconds. -
stopIntervals
Stops running given runnable. -
runLaterAndWait
Runs a runnable later and waits for it to finish. -
getUISource
Returns a UI source for given class. -
getClipboard
Returns the system clipboard. -
getClipboardDrag
Returns the clipboard for dragging. -
createHelper
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
Returns the screen bounds inset to usable area. -
activateApp
Activates the App giving focus to given node. -
showFilePicker
Shows a file picker. -
complain
-