Package org.dwcj
Class App
java.lang.Object
org.dwcj.App
- Direct Known Subclasses:
ButtonAlignment,ButtonDemo,ButtonDisable,ButtonExpanses,ButtonHelloWorld,WelcomeApp
This is the central class representing an app. In order to implement an app,
extend this class and
override the run() method.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumAn enum for the default application themes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddInlineJavaScript(String script) Inject an inline script into the pagestatic voidaddInlineJavaScript(String script, boolean top) Inject an inline script into the pagestatic voidaddInlineJavaScript(String script, boolean top, String attributes) Inject an inline script into the pagestatic voidaddInlineJavaScript(String script, boolean top, Map<String, String> attributes) Inject an inline script into the pagestatic voidInject an inline stylesheet into the pagestatic voidaddInlineStyleSheet(String css, boolean top) Inject an inline stylesheet into the pagestatic voidaddInlineStyleSheet(String css, boolean top, String attributes) Inject an inline stylesheet into the pagestatic voidaddInlineStyleSheet(String css, boolean top, Map<String, String> attributes) Inject an inline stylesheet into the pagestatic voidaddJavaScript(String url) Inject a script into the pagestatic voidaddJavaScript(String url, boolean top) Inject a script into the pagestatic voidaddJavaScript(String url, boolean top, String attributes) Inject a script into the pagestatic voidaddJavaScript(String url, boolean top, Map<String, String> attributes) Inject a script into the pagestatic voidInject a link into the pagestatic voidInject a link into the pagestatic voidInject a link into the pagestatic voidInject a link into the pagestatic voidaddStyleSheet(String url) Inject a stylesheet into the pagestatic voidaddStyleSheet(String url, boolean top) Inject a stylesheet into the pagestatic voidaddStyleSheet(String url, boolean top, String attributes) Inject a stylesheet into the pagestatic voidaddStyleSheet(String url, boolean top, Map<String, String> attributes) Inject a stylesheet into the pagestatic voidbusy(boolean busy) Show or hide a busy indicator overlaystatic voidshow the busy indicator with the text passed to this methodvoidcleanup()Override this method to implement custom cleanup e.g.static voidconsoleError(String output) static voidconsoleLog(String output) Log a String to the browser console (console.out)static StringGet the registered DWC application namestatic StringgetAttribute(String name) Get an attribute from the documentstatic StringgetAttribute(String name, String selector) Get an attribute from the documentstatic StringGet the name of the dark themestatic StringGet the name of the light theme to use for the application.static NamespacegetNamespace(String prefix, String name, Boolean fCreateIfMissing) static NamespacegetNamespace(Namespace.NamespaceType namespaceType) static StringgetTheme()Get the application themestatic StringgetTitle()Get the application titlestatic intShows a message boxstatic intstatic intabstract voidrun()Override this method to implement your app behaviorstatic voidsetAttribute(String name) Set an attribute on the documentstatic voidsetAttribute(String name, String value) Set an attribute on the documentstatic voidsetAttribute(String name, String value, String selector) Set an attribute on the documentstatic voidsetDarkTheme(String darkTheme) Set the name of the dark theme to use for the application.static voidsetLightTheme(String lightTheme) Set the name of the light theme to use for the application.static voidSet a meta tagstatic voidSet a meta tagstatic voidSet a meta tagstatic voidSet the application themestatic voidSet the application themestatic voidSet the application titlevoidCall this method to terminate your App.
-
Constructor Details
-
App
protected App()
-
-
Method Details
-
setTitle
Set the application title- Parameters:
title- The title to set- Throws:
DwcRuntimeException
-
getTitle
Get the application title- Returns:
- The title
- Throws:
DwcRuntimeException
-
getApplicationName
Get the registered DWC application name- Returns:
- the application name
- Throws:
DwcRuntimeException
-
setTheme
Set the application theme- Parameters:
theme- The theme to set- Throws:
DwcRuntimeException
-
setTheme
Set the application theme- Parameters:
theme- The theme to set- Throws:
DwcRuntimeException- See Also:
-
getTheme
Get the application theme- Returns:
- The theme
- Throws:
DwcRuntimeException
-
setDarkTheme
Set the name of the dark theme to use for the application. The dark theme setting is used when the application theme is set to "system".- Parameters:
darkTheme- The dark theme to set- Throws:
DwcRuntimeException
-
getDarkTheme
Get the name of the dark theme- Returns:
- The dark theme
- Throws:
DwcRuntimeException
-
setLightTheme
Set the name of the light theme to use for the application. The light theme setting is used when the application theme is set to "system".- Parameters:
lightTheme- The light theme to set- Throws:
DwcRuntimeException
-
getLightTheme
Get the name of the light theme to use for the application.- Returns:
- The light theme
- Throws:
DwcRuntimeException
-
setMeta
Set a meta tag- Parameters:
name- The name of the meta tagcontent- The content of the meta tagattributes- A map of attributes to set- Throws:
DwcRuntimeException
-
setMeta
Set a meta tag- Parameters:
name- The name of the meta tagcontent- The content of the meta tagattributes- A map of attributes to set (comma separated)- Throws:
DwcRuntimeException
-
setMeta
Set a meta tag- Parameters:
name- The name of the meta tagcontent- The content of the meta tag- Throws:
DwcRuntimeException
-
setAttribute
Set an attribute on the document- Parameters:
name- The name of the attributevalue- The value of the attributeselector- By default, setAttribute applies to the document element on the web page. If a selector is specified, it selects a descendant element within the document to set this attribute. If a specified selector doesn't return any elements, the default document element is used.- Throws:
DwcRuntimeException
-
setAttribute
Set an attribute on the document- Parameters:
name- The name of the attributevalue- The value of the attribute- Throws:
DwcRuntimeException
-
setAttribute
Set an attribute on the document- Parameters:
name- The name of the attribute- Throws:
DwcRuntimeException
-
getAttribute
Get an attribute from the document- Parameters:
name- The name of the attributeselector- By default, setAttribute applies to the document element on the web page. If a selector is specified, it selects a descendant element within the document to set this attribute. If a specified selector doesn't return any elements, the default document element is used.- Returns:
- The attribute value
- Throws:
DwcRuntimeException
-
getAttribute
Get an attribute from the document- Parameters:
name- The name of the attribute- Returns:
- The attribute value
- Throws:
DwcRuntimeException
-
addStyleSheet
Inject a stylesheet into the page- Parameters:
url- The URL of the stylesheettop- Whether to inject the stylesheet at the top of the pageattributes- A map of attributes to set- Throws:
DwcRuntimeException
-
addStyleSheet
Inject a stylesheet into the page- Parameters:
url- The URL of the stylesheettop- Whether to inject the stylesheet at the top of the pageattributes- A map of attributes to set (comma separated)- Throws:
DwcRuntimeException
-
addStyleSheet
Inject a stylesheet into the page- Parameters:
url- The URL of the stylesheettop- Whether to inject the stylesheet at the top of the page- Throws:
DwcRuntimeException
-
addStyleSheet
Inject a stylesheet into the page- Parameters:
url- The URL of the stylesheet- Throws:
DwcRuntimeException
-
addInlineStyleSheet
Inject an inline stylesheet into the page- Parameters:
css- The CSS to injecttop- Whether to inject the stylesheet at the top of the pageattributes- A map of attributes to set- Throws:
DwcRuntimeException
-
addInlineStyleSheet
Inject an inline stylesheet into the page- Parameters:
css- The CSS to injecttop- Whether to inject the stylesheet at the top of the pageattributes- A map of attributes to set (comma separated)- Throws:
DwcRuntimeException
-
addInlineStyleSheet
Inject an inline stylesheet into the page- Parameters:
css- The CSS to injecttop- Whether to inject the stylesheet at the top of the page- Throws:
DwcRuntimeException
-
addInlineStyleSheet
Inject an inline stylesheet into the page- Parameters:
css- The CSS to inject- Throws:
DwcRuntimeException
-
addJavaScript
Inject a script into the page- Parameters:
url- The URL of the scripttop- Whether to inject the script at the top of the pageattributes- A map of attributes to set- Throws:
DwcRuntimeException
-
addJavaScript
Inject a script into the page- Parameters:
url- The URL of the scripttop- Whether to inject the script at the top of the pageattributes- A map of attributes to set (comma separated)- Throws:
DwcRuntimeException
-
addJavaScript
Inject a script into the page- Parameters:
url- The URL of the scripttop- Whether to inject the script at the top of the page- Throws:
DwcRuntimeException
-
addJavaScript
Inject a script into the page- Parameters:
url- The URL of the script- Throws:
DwcRuntimeException
-
addInlineJavaScript
Inject an inline script into the page- Parameters:
script- The script to injecttop- Whether to inject the script at the top of the pageattributes- A map of attributes to set- Throws:
DwcRuntimeException
-
addInlineJavaScript
Inject an inline script into the page- Parameters:
script- The script to injecttop- Whether to inject the script at the top of the pageattributes- A map of attributes to set (comma separated)- Throws:
DwcRuntimeException
-
addInlineJavaScript
Inject an inline script into the page- Parameters:
script- The script to injecttop- Whether to inject the script at the top of the page- Throws:
DwcRuntimeException
-
addInlineJavaScript
Inject an inline script into the page- Parameters:
script- The script to inject- Throws:
DwcRuntimeException
-
addLink
Inject a link into the page- Parameters:
url- The URL of the linktop- Whether to inject the link at the top of the pageattributes- A map of attributes to set- Throws:
DwcRuntimeException
-
addLink
Inject a link into the page- Parameters:
url- The URL of the linktop- Whether to inject the link at the top of the pageattributes- A map of attributes to set (comma separated)- Throws:
DwcRuntimeException
-
addLink
Inject a link into the page- Parameters:
url- The URL of the linktop- Whether to inject the link at the top of the page- Throws:
DwcRuntimeException
-
addLink
Inject a link into the page- Parameters:
url- The URL of the link- Throws:
DwcRuntimeException
-
consoleLog
Log a String to the browser console (console.out)- Parameters:
output- The message to log
-
consoleError
-
msgbox
Shows a message box- Parameters:
alert- The message to show- Returns:
-
msgbox
- Parameters:
alert- The message to showoptions-- Returns:
-
msgbox
- Parameters:
alert- The message to showoptions-title-- Returns:
-
busy
public static void busy(boolean busy) Show or hide a busy indicator overlay- Parameters:
busy- A boolean value true=show false=hide
-
busy
show the busy indicator with the text passed to this method- Parameters:
busyText- the text to show
-
terminate
public void terminate()Call this method to terminate your App. -
cleanup
public void cleanup()Override this method to implement custom cleanup e.g. kill all background threads that may still run -
run
Override this method to implement your app behavior -
getNamespace
-
getNamespace
-