public class HtmlViewWidget extends BBjWidget implements SaveableWidget, EmailableWidget
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.com" 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.com"
|
BASIS_UTILITY_DEVICE_PIXEL_RATIO_KEY_NAME$, DevicePixelRatio!
BASIS_DASHBOARD_UTILITY_FILL_ERROR_ACTION_KEY_NAME$, CachedImage!, DashboardWidget!, FillErrorAction, ON_FILL_ERROR_IGNORE, ON_FILL_ERROR_STOP, ON_FILL_ERROR_WARN, UserData!
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.
|
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.
|
void |
executeScript(BBjString p_script$)
Executes the specified JavaScript in the HtmlViewWidget after it has been
created.
|
void |
executeScripts(BBjString p_script$,
BBjString p_poppedOutScript$)
Adds the specified JavaScript into a vector of JavaScripts that will be executed in the HtmlViewWidget.
|
BBjString |
getUserAgent()
Returns the user agent string for the HtmlViewWidget
|
void |
injectScript(BBjString p_script$)
Injects the specified JavaScript into the HtmlViewWidget, making it available for
subsequent use with the executeScript() method.
|
void |
injectScripts(BBjString p_script$,
BBjString p_poppedOutScript$)
Adds the specified JavaScript into a vector of JavaScripts that will be injected into the HtmlViewWidget.
|
void |
injectUrl(BBjString p_url$)
Injects the specified JavaScript URL into the HtmlViewWidget, making it available for
subsequent use with the executeScript() 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.
|
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
|
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$)
Sets a callback for the HtmlViewWidget given a control event and a callback routine
|
void |
setCallback(BBjNumber p_event,
CustomObject p_callbackObject!,
BBjString p_callbackRoutine$)
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.
|
void |
setTexts(BBjString p_text$,
BBjString p_poppedOutText$)
Sets the HTML text for the HtmlViewWidget.
|
void |
setUrl(BBjString p_url$)
Sets the URL for the HtmlViewWidget.
|
void |
setURL(BBjString p_url$)
Sets the URL for the HtmlViewWidget.
|
void |
setUrls(BBjString p_url$,
BBjString p_poppedOutUrl$)
Sets the URL for the HtmlViewWidget.
|
void |
setUserAgent(BBjString p_userAgent$)
Sets the user agent string for the HtmlViewWidget
|
display, getDevicePixelRatio, logQueryPerformance, setDevicePixelRatio
active, getClientSlash, getFillError, getFillErrorDesc, getImage, getImage, imageFileSaveDialog, logError, name, previewImage, previewText, setActive, setFillErrorDisplayImage, setFillErrorDisplayText, setLastSaveDir, spacesValid, title
public BBjString Url$
public BBjString Text$
public BBjString PoppedOutUrl$
public BBjString PoppedOutText$
public HtmlViewWidget(BBjString p_name$, BBjString p_title$, BBjString p_previewText$, BBjString p_previewImage$)
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$)
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 void create(BBjChildWindow p_widgetControlWindow!)
public void OnPageLoaded(BBjPageLoadedEvent p_event!)
public void OnControlPopupRequest(BBjPopupRequestEvent p_event!)
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!)
public HtmlViewWidget clone()
public void setURL(BBjString p_url$)
The string parameter should include the protocol, so "http://www.basis.com" 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$)
The string parameter should include the protocol, so "http://www.basis.com" 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$)
The string parameter should include the protocol, so "http://www.basis.com" 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 widgetpublic void setText(BBjString p_text$)
p_text$
- The HTML-formated text that will be used to fill the widgetpublic void setTexts(BBjString p_text$, BBjString p_poppedOutText$)
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 widgetpublic void destroy()
public BBjNumber isDestroyed()
isDestroyed
in interface Widget
isDestroyed
in class BBjWidget
public void resize(BBjNumber p_width, BBjNumber p_height)
public void refresh()
refresh
in interface RefreshableWidget
public void save()
save
in interface SaveableWidget
public void email(BBjNumber p_parentX, BBjNumber p_parentY, BBjNumber p_parentWidth, BBjNumber p_parentHeight)
email
in interface EmailableWidget
p_parentX
- X location of the parent windowp_parentY
- Y location of the parent windowp_parentWidth
- Width of the parent windowp_parentHeight
- Height of the parent windowpublic void executeScript(BBjString p_script$)
p_script$
- The JavaScript to executepublic void executeScripts(BBjString p_script$, BBjString p_poppedOutScript$)
p_script$
- The JavaScript to execute in the HtmlViewWidgetp_poppedOutScript$
- The JavaScript to execute in the popped-out HtmlViewWidgetpublic void executeAsyncScript(BBjString p_script$)
p_script$
- The JavaScript to executepublic void executeAsyncScripts(BBjString p_script$, BBjString p_poppedOutScript$)
p_script$
- The JavaScript to execute in the HtmlViewWidgetp_poppedOutScript$
- The JavaScript to execute in the popped-out HtmlViewWidgetpublic void injectScript(BBjString p_script$)
p_script$
- The JavaScript to inject into the HtmlViewWidgetpublic void injectScripts(BBjString p_script$, BBjString p_poppedOutScript$)
p_script$
- The JavaScript to inject into the HtmlViewWidgetp_poppedOutScript$
- The JavaScript to inject into the popped-out HtmlViewWidgetpublic void injectUrl(BBjString p_url$)
p_url$
- The URL of the hosted JavaScript file to inject into the HtmlViewWidgetpublic void injectUrls(BBjString p_url$, BBjString p_poppedOutUrl$)
p_script$
- The JavaScript to inject into the HtmlViewWidgetp_poppedOutUrl$
- The The JavaScript to inject into the popped-out HtmlViewWidgetpublic BBjString getUserAgent()
This requires a BBj 15 or greater interpreter
public void setUserAgent(BBjString p_userAgent$)
This requires a BBj 15 or greater interpreter
p_userAgent$
- The user agent string to be used for the HtmlViewWidgetpublic void setCallback(BBjNumber p_event, BBjString p_callbackRoutine$)
Example:
myHtmlViewWdget!.setCallback(BBjAPI().ON_PAGE_LOADED, pgm(-2) + "::myHtmlPageLoadedRoutine")
The myHtmlPageLoadedRoutine would look similar to:
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 controlBBjHtmlView documentation for
the list of valid events for the HtmlViewWidget, since they are the same as the events for the BBjHtmlView.
public void setCallback(BBjNumber p_event, CustomObject p_callbackObject!, BBjString p_callbackRoutine$)
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 controlBBjHtmlView documentation for
the list of valid events for the HtmlViewWidget, since they are the same as the events for the BBjHtmlView.