public class HtmlViewWidget extends BBjWidget implements SaveableWidget,
HtmlViewWidget A Dashboard Utility Widget that displays html text or the contents of a URL
Modifier and Type | Field and Description |
---|---|
BBjString | PoppedOutText$ A string with HTML contents to be used for the popped-out version of the widget. |
BBjString | PoppedOutUrl$ A string representation of the URL, such as "http://www.basis.cloud" to be used for the popped-out version of the widget. |
BBjString | Text$ A string with HTML contents |
BBjString | Url$ A string representation of the URL, such as "http://www.basis.cloud" |
BASIS_DASHBOARD_UTILITY_FILL_ERROR_ACTION_KEY_NAME$, CachedImage!, DashboardWidget!, FillErrorAction, ON_FILL_ERROR_IGNORE, ON_FILL_ERROR_STOP, ON_FILL_ERROR_WARN, UserData! Fields inherited from class BBjWidget
BASIS_UTILITY_DEVICE_PIXEL_RATIO_KEY_NAME$, DevicePixelRatio!
Constructor and Description |
---|
HtmlViewWidget(BBjString p_name$, BBjString p_title$, BBjString p_previewText$, BBjString p_previewImage$) Creates an HtmlViewWidget |
HtmlViewWidget(BBjString p_name$, BBjString p_title$, BBjString p_previewText$, BBjString p_previewImage$, BBjString p_text$) Creates an HtmlViewWidget |
Modifier and Type | Method and Description |
---|---|
HtmlViewWidget | clone() An internal method used by the Dashboard class to clone a category widget so that it may be displayed in a popped out window |
void | create(BBjChildWindow p_widgetControlWindow!) Creates the HtmlViewWidget |
void | destroy() Destroys the HtmlViewWidget |
void | email(BBjNumber p_parentX, BBjNumber p_parentY, BBjNumber p_parentWidth, BBjNumber p_parentHeight) Displays a dialog that facilitates emailing a screenshot of the HtmlViewWidget as an attachment to one or more recipients |
void | executeAsyncScript(BBjString p_script$) Asynchronously executes the specified JavaScript in the HtmlViewWidget after it has been created. This method sets a single JavaScript, so calling it multiple times will overwrite any previous JavaScript specified earlier. To add multiple JavaScript files to a list that will all be executed in the HtmlViewWidget use the executeAsyncScripts() method. That method also allows you to specify different scripts for the regular and popped-out versions of the widget, whereas this simplified version uses the same script for both. |
void | executeAsyncScripts(BBjString p_script$, BBjString p_poppedOutScript$) Adds the specified JavaScript into a vector of JavaScripts that will be executed asynchronously in the HtmlViewWidget. When the HtmlViewWidget control is created all of the JavaScripts in the vector will be executed in the control. By specifying a different JavaScript string for the p_poppedOutScript$ parameter you can change the behavior of the popped-out version or simply rename unique elements, such as DIV IDs. |
void | executeScript(BBjString p_script$) Executes the specified JavaScript in the HtmlViewWidget after it has been created. This method sets a single JavaScript, so calling it multiple times will overwrite any previous JavaScript specified earlier. To add multiple JavaScript files to a list that will all be executed in the HtmlViewWidget use the executeScripts() method. That method also allows you to specify different scripts for the regular and popped-out versions of the widget, whereas this simplified version uses the same script for both. |
void | executeScripts(BBjString p_script$, BBjString p_poppedOutScript$) Adds the specified JavaScript into a vector of JavaScripts that will be executed in the HtmlViewWidget. When the HtmlViewWidget control is created all of the JavaScripts in the vector will be executed in the control. By specifying a different JavaScript string for the p_poppedOutScript$ parameter you can change the behavior of the popped-out version or simply rename unique elements, such as DIV IDs. |
BBjString | getUserAgent() Returns the user agent string for the HtmlViewWidget This requires a BBj 15 or greater interpreter |
void | injectScript(BBjString p_script$) Injects the specified JavaScript into the HtmlViewWidget, making it available for subsequent use with the executeScript() method. This method sets a single JavaScript, so calling it multiple times will overwrite any previous JavaScript specified earlier. To add multiple JavaScript files to a list that will all be injected into the HtmlViewWidget use the injectScripts() method. That method also allows you to specify different scripts for the regular and popped-out versions of the widget, whereas this version uses the same script for both. |
void | injectScripts(BBjString p_script$, BBjString p_poppedOutScript$) Adds the specified JavaScript into a vector of JavaScripts that will be injected into the HtmlViewWidget. When the HtmlViewWidget control is created all of the JavaScripts in the vector will be injected into the control for subsequent use with the executeScript() method. By specifying a different JavaScript string for the p_poppedOutScript$ parameter you can change the behavior of the popped-out version or simply rename unique elements, such as DIV IDs. |
void | injectUrl(BBjString p_url$) Injects the specified JavaScript URL into the HtmlViewWidget, making it available for subsequent use with the executeScript() method. This method sets a single JavaScript URL, so calling it multiple times will overwrite any previous JavaScript URLs specified earlier. To add multiple JavaScript URLs to a list that will all be injected into the HtmlViewWidget use the injectUrls() method. |
void | injectUrls(BBjString p_url$, BBjString p_poppedOutUrl$) Adds the specified URL into a vector of URLs that will be injected into the HtmlViewWidget. When the HtmlViewWidget control is created all of the JavaScript URLs in the vector will be injected into the control for subsequent use with the executeScript() method. By specifying a different URL for the p_poppedOutUrl$ parameter you can change the behavior of the popped-out version of the widget. |
BBjNumber | isDestroyed() Returns if the HtmlViewWidget is destroyed |
void | OnControlPopupRequest(BBjPopupRequestEvent p_event!) An internal method that is called when the mouse is right-clicked over the HtmlViewWidget This method exists so that a custom popup menu will be displayed instead of the default browser's popup menu. The method is technically a no-op, but needs to exist as we need to register for the window's ON_POPUP_REQUEST event in order to prevent the browser from displaying its own popup menu when running in BUI. |
void | OnHtmlViewEvent(BBjSysGuiEvent p_event!) An internal method that is called when an event occurs on the HtmlViewerWidget for which a callback event has been registered |
void | OnPageLoaded(BBjPageLoadedEvent p_event!) An internal method that is called when the HtmlViewWidget's content (URL or HTML text) has finished loading so that URLs and JavaScript can be injected/executed if applicable |
void | refresh() Refreshes the HtmlViewWidget contents by reloading the URL or setting the HTML text, and injecting/executing JavaScripts if applicable |
void | resize(BBjNumber p_width, BBjNumber p_height) Resizes the widget using the provided with and height |
void | save() Saves an image representation of the HtmlViewWidget on the client's machine |
void | setCallback(BBjNumber p_event, BBjString p_callbackRoutine$) setCallback Sets a callback for the HtmlViewWidget given a control event and a callback routine Example:
The myHtmlPageLoadedRoutine would look similar to: {@code myHtmlPageLoadedRoutine: event! = BBjAPI().getLastEvent() htmlViewWidgetEvent! = event!.getObject() dbWidget! = htmlViewWidgetEvent!.getDashboardWidget() widget! = htmlViewWidgetEvent!.getWidget() |
void | setCallback(BBjNumber p_event, CustomObject p_callbackObject!, BBjString p_callbackRoutine$) setCallback Sets a callback for the HtmlViewWidget, given a control event, callback object, and a callback routine |
void | setText(BBjString p_text$) Sets the HTML text for the HtmlViewWidget. If you want the popped-out version of the widget to have different HTML you should use the setTexts() method. |
void | setTexts(BBjString p_text$, BBjString p_poppedOutText$) Sets the HTML text for the HtmlViewWidget. By specifying a different string for the p_poppedOutText$ parameter you can change the contents and behavior of the popped-out version or simply rename unique elements, such as DIV IDs. |
void | setURL(BBjString p_url$) Sets the URL for the HtmlViewWidget. If you wish the popped-out version of the widget to have a different URL you should use the setUrls() method. The string parameter should include the protocol, so "http://www.basis.cloud" is one example. Note that you must call the refresh() method after this method to force the HtmlViewWidget to load the new URL. |
void | setUrl(BBjString p_url$) Sets the URL for the HtmlViewWidget. If you wish the popped-out version of the widget to have a different URL you should use the setUrls() method. The string parameter should include the protocol, so "http://www.basis.cloud" is one example. Note that you must call the refresh() method after this method to force the HtmlViewWidget to load the new URL. |
void | setUrls(BBjString p_url$, BBjString p_poppedOutUrl$) Sets the URL for the HtmlViewWidget. By specifying a different string for the p_poppedOutUrl$ parameter you can change the contents and behavior of the popped-out version of the widget. The string parameter should include the protocol, so "http://www.basis.cloud" is one example. Note that you must call the refresh() method after this method to force the regular (non-popped-out) HtmlViewWidget to load the new URL. |
void | setUserAgent(BBjString p_userAgent$) Sets the user agent string for the HtmlViewWidget This requires a BBj 15 or greater interpreter |
active, destroy, getClientSlash, getFillError, getFillErrorDesc, getImage, getImage, imageFileSaveDialog, isDestroyed, logError, name, previewImage, previewText, setActive, setFillErrorDisplayImage, setFillErrorDisplayText, setLastSaveDir, spacesValid, title
create, destroy, display, getDevicePixelRatio, isDestroyed, logQueryPerformance, resize, setDevicePixelRatio
public BBjString PoppedOutText$
A string with HTML contents to be used for the popped-out version of the widget.
BBj 17.00
public BBjString PoppedOutUrl$
A string representation of the URL, such as "http://www.basis.cloud" to be used for the popped-out version of the widget.
BBj 17.00
public BBjString Text$
A string with HTML contents
public BBjString Url$
A string representation of the URL, such as "http://www.basis.cloud"
public HtmlViewWidget(BBjString p_name$, BBjString p_title$, BBjString p_previewText$, BBjString p_previewImage$)
Creates an HtmlViewWidget
p_name$
The widget's namep_title$
The widget's titlep_previewText$
The widget's preview text as shown in the Customize view and the widget toolbar's tooltipp_previewImage$
The widget's preview image. If this is an empty string, then one will be created automatically in the Customize view.public HtmlViewWidget(BBjString p_name$, BBjString p_title$, BBjString p_previewText$, BBjString p_previewImage$, BBjString p_text$)
Creates an HtmlViewWidget
p_name$
The widget's namep_title$
The widget's titlep_previewText$
The widget's preview text as shown in the Customize view and the widget toolbar's tooltipp_previewImage$
The widget's preview image. If this is an empty string, then one will be created automatically in the Customize view.p_text$
The widget's HTML contents contained in a stringpublic HtmlViewWidget clone()
An internal method used by the Dashboard class to clone a category widget so that it may be displayed in a popped out window
public void create(BBjChildWindow p_widgetControlWindow!)
Creates the HtmlViewWidget
p_widgetControlWindow!
The BBjChildWindow that will contain the widgetpublic void destroy()
Destroys the HtmlViewWidget
public void email(BBjNumber p_parentX, BBjNumber p_parentY, BBjNumber p_parentWidth, BBjNumber p_parentHeight)
Displays a dialog that facilitates emailing a screenshot of the HtmlViewWidget as an attachment to one or more recipients
In BBj 15.11 and higher
public void executeAsyncScript(BBjString p_script$)
Asynchronously executes the specified JavaScript in the HtmlViewWidget after it has been created. This method sets a single JavaScript, so calling it multiple times will overwrite any previous JavaScript specified earlier. To add multiple JavaScript files to a list that will all be executed in the HtmlViewWidget use the executeAsyncScripts() method. That method also allows you to specify different scripts for the regular and popped-out versions of the widget, whereas this simplified version uses the same script for both.
p_script$
The JavaScript to execute BBj 19.10
public void executeAsyncScripts(BBjString p_script$, BBjString p_poppedOutScript$)
Adds the specified JavaScript into a vector of JavaScripts that will be executed asynchronously in the HtmlViewWidget. When the HtmlViewWidget control is created all of the JavaScripts in the vector will be executed in the control. By specifying a different JavaScript string for the p_poppedOutScript$ parameter you can change the behavior of the popped-out version or simply rename unique elements, such as DIV IDs.
p_script$
The JavaScript to execute in the HtmlViewWidgetp_poppedOutScript$
The JavaScript to execute in the popped-out HtmlViewWidget BBj 19.10
public void executeScript(BBjString p_script$)
Executes the specified JavaScript in the HtmlViewWidget after it has been created. This method sets a single JavaScript, so calling it multiple times will overwrite any previous JavaScript specified earlier. To add multiple JavaScript files to a list that will all be executed in the HtmlViewWidget use the executeScripts() method. That method also allows you to specify different scripts for the regular and popped-out versions of the widget, whereas this simplified version uses the same script for both.
p_script$
The JavaScript to execute In BBj 15.11 and higher
public void executeScripts(BBjString p_script$, BBjString p_poppedOutScript$)
Adds the specified JavaScript into a vector of JavaScripts that will be executed in the HtmlViewWidget. When the HtmlViewWidget control is created all of the JavaScripts in the vector will be executed in the control. By specifying a different JavaScript string for the p_poppedOutScript$ parameter you can change the behavior of the popped-out version or simply rename unique elements, such as DIV IDs.
p_script$
The JavaScript to execute in the HtmlViewWidgetp_poppedOutScript$
The JavaScript to execute in the popped-out HtmlViewWidget In BBj 17.00 and higher
public BBjString getUserAgent()
Returns the user agent string for the HtmlViewWidget
This requires a BBj 15 or greater interpreter
In BBj 15.11 and higher
public void injectScript(BBjString p_script$)
Injects the specified JavaScript into the HtmlViewWidget, making it available for subsequent use with the executeScript() method. This method sets a single JavaScript, so calling it multiple times will overwrite any previous JavaScript specified earlier. To add multiple JavaScript files to a list that will all be injected into the HtmlViewWidget use the injectScripts() method. That method also allows you to specify different scripts for the regular and popped-out versions of the widget, whereas this version uses the same script for both.
p_script$
The JavaScript to inject into the HtmlViewWidget In BBj 15.11 and higher
public void injectScripts(BBjString p_script$, BBjString p_poppedOutScript$)
Adds the specified JavaScript into a vector of JavaScripts that will be injected into the HtmlViewWidget. When the HtmlViewWidget control is created all of the JavaScripts in the vector will be injected into the control for subsequent use with the executeScript() method. By specifying a different JavaScript string for the p_poppedOutScript$ parameter you can change the behavior of the popped-out version or simply rename unique elements, such as DIV IDs.
p_script$
The JavaScript to inject into the HtmlViewWidgetp_poppedOutScript$
The JavaScript to inject into the popped-out HtmlViewWidget In BBj 17.00 and higher
public void injectUrl(BBjString p_url$)
Injects the specified JavaScript URL into the HtmlViewWidget, making it available for subsequent use with the executeScript() method. This method sets a single JavaScript URL, so calling it multiple times will overwrite any previous JavaScript URLs specified earlier. To add multiple JavaScript URLs to a list that will all be injected into the HtmlViewWidget use the injectUrls() method.
p_url$
The URL of the hosted JavaScript file to inject into the HtmlViewWidget BBj 17.00
public void injectUrls(BBjString p_url$, BBjString p_poppedOutUrl$)
Adds the specified URL into a vector of URLs that will be injected into the HtmlViewWidget. When the HtmlViewWidget control is created all of the JavaScript URLs in the vector will be injected into the control for subsequent use with the executeScript() method. By specifying a different URL for the p_poppedOutUrl$ parameter you can change the behavior of the popped-out version of the widget.
p_script$
The JavaScript to inject into the HtmlViewWidgetp_poppedOutUrl$
The The JavaScript to inject into the popped-out HtmlViewWidget In BBj 17.00 and higher
public BBjNumber isDestroyed()
Returns if the HtmlViewWidget is destroyed
public void OnControlPopupRequest(BBjPopupRequestEvent p_event!)
An internal method that is called when the mouse is right-clicked over the HtmlViewWidget
This method exists so that a custom popup menu will be displayed instead of the default browser's popup menu. The method is technically a no-op, but needs to exist as we need to register for the window's ON_POPUP_REQUEST event in order to prevent the browser from displaying its own popup menu when running in BUI.
p_event!
BBjPopupRequestEvent that contains event informationpublic void OnHtmlViewEvent(BBjSysGuiEvent p_event!)
An internal method that is called when an event occurs on the HtmlViewerWidget for which a callback event has been registered
public void OnPageLoaded(BBjPageLoadedEvent p_event!)
An internal method that is called when the HtmlViewWidget's content (URL or HTML text) has finished loading so that URLs and JavaScript can be injected/executed if applicable
public void refresh()
Refreshes the HtmlViewWidget contents by reloading the URL or setting the HTML text, and injecting/executing JavaScripts if applicable
public void resize(BBjNumber p_width, BBjNumber p_height)
Resizes the widget using the provided with and height
p_width
The width of the widget in pixels.p_height
The height of the widget in pixels.public void save()
Saves an image representation of the HtmlViewWidget on the client's machine
In BBj 15.11 and higher
public void setCallback(BBjNumber p_event, BBjString p_callbackRoutine$)
setCallback Sets a callback for the HtmlViewWidget given a control event and a callback routine
Example:
myHtmlViewWdget!.setCallback(BBjAPI().ON_PAGE_LOADED, pgm(-2) + "::myHtmlPageLoadedRoutine")
The myHtmlPageLoadedRoutine would look similar to:
{@code myHtmlPageLoadedRoutine: event! = BBjAPI().getLastEvent() htmlViewWidgetEvent! = event!.getObject() dbWidget! = htmlViewWidgetEvent!.getDashboardWidget() widget! = htmlViewWidgetEvent!.getWidget()rem * * Do Custom Stuff Here * *
exit }
p_event
BBjHtmlView control event that will trigger the callbackp_callbackRoutine$
Subroutine name to callback when the event occurs on the control The BBjHtmlView documentation for the list of valid events for the HtmlViewWidget, since they are the same as the events for the BBjHtmlView.
BBj 17.00
public void setCallback(BBjNumber p_event, CustomObject p_callbackObject!, BBjString p_callbackRoutine$)
setCallback Sets a callback for the HtmlViewWidget, given a control event, callback object, and a callback routine
p_event
BBjHtmlView control event that will trigger the callbackp_callbackObject
A CustomObject containing the method to be called when the when the event occurs on the controlp_callbackRoutine$
The name of the object's method to be called when the event occurs on the control The BBjHtmlView documentation for the list of valid events for the HtmlViewWidget, since they are the same as the events for the BBjHtmlView.
BBj 17.00
public void setText(BBjString p_text$)
Sets the HTML text for the HtmlViewWidget. If you want the popped-out version of the widget to have different HTML you should use the setTexts() method.
p_text$
The HTML-formated text that will be used to fill the widgetpublic void setTexts(BBjString p_text$, BBjString p_poppedOutText$)
Sets the HTML text for the HtmlViewWidget. By specifying a different string for the p_poppedOutText$ parameter you can change the contents and behavior of the popped-out version or simply rename unique elements, such as DIV IDs.
p_text$
The HTML-formated text that will be used to fill the widgetp_poppedOutText$
The HTML-formated text that will be used to fill the popped-out widget BBj 17.00
public void setURL(BBjString p_url$)
Sets the URL for the HtmlViewWidget. If you wish the popped-out version of the widget to have a different URL you should use the setUrls() method.
The string parameter should include the protocol, so "http://www.basis.cloud" is one example. Note that you must call the refresh() method after this method to force the HtmlViewWidget to load the new URL.
p_url$
A string representation of the URL that will be used to fill the widgetpublic void setUrl(BBjString p_url$)
Sets the URL for the HtmlViewWidget. If you wish the popped-out version of the widget to have a different URL you should use the setUrls() method.
The string parameter should include the protocol, so "http://www.basis.cloud" is one example. Note that you must call the refresh() method after this method to force the HtmlViewWidget to load the new URL.
p_url$
A string representation of the URL that will be used to fill the widgetpublic void setUrls(BBjString p_url$, BBjString p_poppedOutUrl$)
Sets the URL for the HtmlViewWidget. By specifying a different string for the p_poppedOutUrl$ parameter you can change the contents and behavior of the popped-out version of the widget.
The string parameter should include the protocol, so "http://www.basis.cloud" is one example. Note that you must call the refresh() method after this method to force the regular (non-popped-out) HtmlViewWidget to load the new URL.
p_url$
A string representation of the URL that will be used to fill the widgetBBjString
p_poppedOutUrl$ A string representation of the URL that will be used to fill the popped-out widget BBj 17.00
public void setUserAgent(BBjString p_userAgent$)
Sets the user agent string for the HtmlViewWidget
This requires a BBj 15 or greater interpreter
p_userAgent$
The user agent string to be used for the HtmlViewWidget In BBj 15.11 and higher