(class)
public abstract EmbeddedBrowserGraphic
{inherits
Visual}
A Graphic that contains a web browser that can be directed to browse to various Urls.
Notes
This is only implemented on Windows OSes for now, and creating it on other platforms will throw an
Exception.
Description
This
Graphic will not have any menus or other web browser decorations. It will not be allowed to open new windows. For security reasons, the getters and events that would provide information about the
Url being displayed in the browser are only available to privileged applets.
When an applet is done using the
EmbeddedBrowserGraphic it should call
EmbeddedBrowserGraphic.destroy-browser.
Example
This only works on Windows OSes:
| Example:
Mini Web Browser using EmbeddedBrowserGraphic |
 |
{import * from CURL.GUI.EMBEDDED-BROWSER}
{def eb =
{try
{EmbeddedBrowserGraphic}
catch ex:Exception do
null
}
}
{VBox
{HBox
enabled? = (eb != null),
{CommandButton
label="<-",
{on Action do
{eb.browse-backward}
}
},
{CommandButton
label="->",
{on Action do
{eb.browse-forward}
}
},
{CommandButton
label="Reload",
{on Action do
{eb.browser-refresh force-reload? = true}
}
},
{CommandButton
label="Stop",
{on Action do
{eb.browser-stop}
}
},
{TextField
{on Action at tf:TextField do
{try
{eb.browse-url
{parse-url (tf.value asa String)}
}
catch ex:Exception do
{popup-message ex.message}
}
}
},
{CommandButton
label="+",
{on Action do
{eb.browser-zoom-in}
}
},
{CommandButton
label="-",
{on Action do
{eb.browser-zoom-out}
}
}
},
{if-non-null eb then
eb
else
{paragraph
EmbeddedBrowserGraphic is not supported on this platform.
}
}
}
| |
Introduced in:
version 6.0
accessor public abstract EmbeddedBrowserGraphic.browser-location-url:#
Url
| browser-state: | The state of the top level page being loaded by the browser, this should match the event most recently sent about the top level page being loaded. |
accessor public abstract EmbeddedBrowserGraphic.browser-status-text:
String
accessor public abstract EmbeddedBrowserGraphic.browser-title-text:
String Properties inherited from Visual:
_style-element, clonable-class?, completely-clonable-children?, cursor, data-source, display-context, dragee, font-size, input-method-enabled?, input-method-keyboard-mode, name, options, options-present-here, style-class, style-element, style-manager, style-options, test-description, test-name, test-parent?, test-type-name, test-visible?, tooltip, user-data
|
public abstract
| {EmbeddedBrowserGraphic.browse-backward offset:int = 1 }:void |
|
public abstract
| {EmbeddedBrowserGraphic.browse-forward offset:int = 1 }:void |
|
public abstract
| {EmbeddedBrowserGraphic.browse-url url:Url}:void |
| browse-url-post: | Ask the browser to browse a given Url, doing a post, submitting the given data in the process. |
|
public abstract
| {EmbeddedBrowserGraphic.browser-refresh force-reload?:bool = false }:void |
|
public abstract
| {EmbeddedBrowserGraphic.browser-stop}:void |
|
public abstract
| {EmbeddedBrowserGraphic.browser-zoom-in}:void |
|
public abstract
| {EmbeddedBrowserGraphic.browser-zoom-out}:void |
| destroy-browser: | Destroy the browser, and immediately recover any resources that it was using. |
|
public abstract
| {EmbeddedBrowserGraphic.destroy-browser}:void |
Methods inherited from Visual:
add, add-from-init-args, add-option, add-style-option, animate, change-cursor, clear, clonable-appearance?, clone-appearance, clone-appearance-helper, find-graphical-ancestor, find-test-children, get-focus-manager, get-graphical-root, get-layout-context, get-origin-in-graphical-ancestor, get-origin-in-root, get-test-parent, get-test-property, get-text, get-top-left-in-ancestor, get-view, maybe-fire-attach-event, maybe-fire-detach-event, non-keyword-init-arg, note-attached, note-caret-position, note-detaching, on-drag-enter, on-drag-leave, on-pointer-enter, on-pointer-envelope-event, on-pointer-leave, pop-cursor, prepare-test-object, prepare-test-parent, push-cursor, quantize-width, release-key-focus, remove-option, remove-style-option, request-draw, request-key-focus, scroll-to-include, test-record, test-run, transform-from-display-coordinates, transform-from-graphical-root-coordinates, transform-to-display-coordinates, transform-to-graphical-root-coordinates, xy-offset-to Methods inherited from GuiEventTarget:
handle-event, on-action, on-cancel-mode, on-command-changed, on-commit, on-composition-change-event, on-composition-result-event, on-context-menu-event, on-current-record-change-request, on-current-record-changed, on-destroy-notify, on-destroy-requested, on-drag-over, on-drag-pointer, on-drag-started, on-drop, on-end-composition-event, on-focus-event, on-focus-in, on-focus-out, on-grab-release, on-gui-event, on-input-method-event, on-inspection, on-key-event, on-key-press, on-pointer-button, on-pointer-crossing, on-pointer-event, on-pointer-motion, on-pointer-press, on-pointer-release, on-pointer-scroll, on-raw-key-event, on-raw-key-press, on-raw-key-release, on-reset, on-selectable-added, on-selectable-removed, on-selection-changed, on-selection-context-activated, on-selection-context-deactivated, on-selection-event, on-start-composition-event, on-start-event, on-stop-event, on-view-activate, on-view-deactivate, on-window-close, remove-event-handlers-for-event-class Methods inherited from OptionListInterface:
change-option-parent-notify, clone-options, get-option, get-option-by-name, keyword-init-arg, local-add-notify, local-remove-notify, name-to-option-key, new-option-item, notify-option-children, option-change-notify, option-changed, option-lookup, option-lookup-here, option-propagate-notify, option-set?, propagate-option-change, register-options, remove-styles, set-option-by-name, set-style-option-by-name, unset-option-by-name, unset-style-option-by-name
(factory)
Construct an EmbeddedBrowserGraphic.
external-browse-option: Indicates what should happen for browse requests that are due to user activity, or a web page replacing itself programmatically.
silent?: If true suppress all dialog boxes and just fail any issue that would require user interaction to succeed.
suppress-scrollbars?: If
true suppress all scrollbars even if the content is larger than the
Graphic.
Introduced in:
version 6.0
(accessor)
accessor public abstract EmbeddedBrowserGraphic.browser-location-url:#
Url The Url that the browser has most recently browsed to.
Notes
Throws an
Exception unless the applet would be allowed to read the current top level page.
Introduced in:
version 6.0
(accessor)
The state of the top level page being loaded by the browser, this should match the event most recently sent about the top level page being loaded.
Description
This will stay as
EmbeddedBrowserState.browse-error if an error occurs with the top level page, even though other events will be sent for the top level page.
Notes
Throws an
Exception unless the applet would be allowed to read the current top level page.
Introduced in:
version 6.0
(accessor)
accessor public abstract EmbeddedBrowserGraphic.browser-status-text:
String The current status text.
Notes
Throws an
Exception unless the applet would be allowed to read the current top level page.
Introduced in:
version 6.0
(accessor)
accessor public abstract EmbeddedBrowserGraphic.browser-title-text:
String The current title text.
Notes
Throws an
Exception unless the applet would be allowed to read the current top level page.
Introduced in:
version 6.0
(method)
| public abstract
| {EmbeddedBrowserGraphic.browse-backward offset:int = 1 }:void |
Ask the browser to move backward in its history list.
offset: The number of positions to move backward in the history list. This must be a positive integer. Defaults to one.
Introduced in:
version 6.0
(method)
| public abstract
| {EmbeddedBrowserGraphic.browse-forward offset:int = 1 }:void |
Ask the browser to move forward in its history list.
offset: The number of positions to move forward in the history list. This must be a positive integer. Defaults to one.
Introduced in:
version 6.0
(method)
| public abstract
| {EmbeddedBrowserGraphic.browse-url url:Url}:void |
Ask the browser to browse a given Url.
url: The
Url to be browsed. If the
url denotes a file of a type that the browser does not know how to handle, the browser may instead display an error dialog of some kind.
Introduced in:
version 6.0
(method)
Ask the browser to browse a given Url, doing a post, submitting the given data in the process.
http-url: The
Url to be browsed. If posting
http-url results in data of a type that the browser does not know how to handle, the browser may instead display an error dialog of some kind.
request-headers: An
HttpRequestHeaders containing any additional headers to include in the post.
Description
The procedure effects the same basic behavior as
Applet.browse-url, except that a
form must be specified, and the
http-url must be of the form "http://" or "https://".
The
HttpRequestData has the data to be posted, and the content type of that data, and if it is a
HttpFormData then it represents the fields and values of a form. Its form data will be extracted and encoded (based on its encoding type) and posted to
http-url.
Introduced in:
version 6.0
(method)
| public abstract
| {EmbeddedBrowserGraphic.browser-refresh force-reload?:bool = false }:void |
Refresh the currently displayed page.
force-reload?: If true, reload the content, rather than just checking if it is up to date.
Notes
Throws an
Exception unless the applet would be allowed to read the current top level page.
Introduced in:
version 6.0
(method)
| public abstract
| {EmbeddedBrowserGraphic.browser-stop}:void |
Stop any partially complete browse.
Notes
May also stop animated images and other activity on the web page.
Introduced in:
version 6.0
(method)
| public abstract
| {EmbeddedBrowserGraphic.browser-zoom-in}:void |
Make all text displayed by this object larger.
Introduced in:
version 6.0
(method)
| public abstract
| {EmbeddedBrowserGraphic.browser-zoom-out}:void |
Make all text displayed by this object smaller.
Introduced in:
version 6.0
(method)
| public abstract
| {EmbeddedBrowserGraphic.destroy-browser}:void |
Destroy the browser, and immediately recover any resources that it was using.
Introduced in:
version 6.0