EmbeddedBrowserGraphic (class)
public abstract EmbeddedBrowserGraphic {inherits Visual}
Package: CURL.GUI.EMBEDDED-BROWSER

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

Constructors
default:Construct an EmbeddedBrowserGraphic.
factory public {EmbeddedBrowserGraphic.default
    location-url:#Url = null,
    external-browse-option:ExternalBrowseOption = ExternalBrowseOption.allow,
    silent?:bool = false,
    suppress-scrollbars?:bool = false,
    ...
}:EmbeddedBrowserGraphic
Properties
browser-location-url:The Url that the browser has most recently browsed to.
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-state:EmbeddedBrowserState
browser-status-text:The current status text.
accessor public abstract EmbeddedBrowserGraphic.browser-status-text:String
browser-title-text:The current title text.
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
Properties inherited from DataBindingTarget: data-binding-context, data-bindings
Properties inherited from EventTarget: event-handlers
Properties inherited from OptionListInterface: option-parent, option-register-proc, registered-option-keys
Methods
browse-backward:Ask the browser to move backward in its history list.
public abstract {EmbeddedBrowserGraphic.browse-backward
    offset:int = 1
}:void
browse-forward:Ask the browser to move forward in its history list.
public abstract {EmbeddedBrowserGraphic.browse-forward
    offset:int = 1
}:void
browse-url:Ask the browser to browse a given Url.
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.browse-url-post
    url:Url,
    request-data:HttpRequestData,
    request-headers:#HttpRequestHeaders = null
}:void
browser-refresh:Refresh the currently displayed page.
public abstract {EmbeddedBrowserGraphic.browser-refresh
    force-reload?:bool = false
}:void
browser-stop:Stop any partially complete browse.
public abstract {EmbeddedBrowserGraphic.browser-stop}:void
browser-zoom-in:Make all text displayed by this object larger.
public abstract {EmbeddedBrowserGraphic.browser-zoom-in}:void
browser-zoom-out:Make all text displayed by this object smaller.
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 GraphicOptions: any-to-Distance, get-display-context
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 DataBindingTarget: add-data-binding, get-data-binding, refresh-data-binding, remove-data-binding, unset-property, update-data-binding, validate-data-binding
Methods inherited from EventTarget: accepts-event-class?, add-event-handler, event-handler-present?, remove-event-handler, verify-event
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
Methods inherited from BasicEventTarget: enqueue-event
Methods inherited from InitRestArgParser: process-rest-args
Methods inherited from Object: object-describe, object-describe-for-debugging, object-serialize

Constructor Details
default (factory)
public {EmbeddedBrowserGraphic.default
    location-url:#Url = null,
    external-browse-option:ExternalBrowseOption = ExternalBrowseOption.allow,
    silent?:bool = false,
    suppress-scrollbars?:bool = false,
    ...
}:EmbeddedBrowserGraphic

Construct an EmbeddedBrowserGraphic.

location-url: If not null the browser will start browsing to this Url, as if EmbeddedBrowserGraphic.browse-url had been called.
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.
...: This can include anything that is appropriate for a Graphic and, if the applet is privileged, EventHandler for subclasses of EmbeddedBrowserEvent.
Introduced in: version 6.0


Property Details
browser-location-url (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


browser-state (accessor)
accessor public abstract EmbeddedBrowserGraphic.browser-state:EmbeddedBrowserState

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


browser-status-text (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


browser-title-text (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 Details
browse-backward (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


browse-forward (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


browse-url (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


browse-url-post (method)
public abstract {EmbeddedBrowserGraphic.browse-url-post
    url:Url,
    request-data:HttpRequestData,
    request-headers:#HttpRequestHeaders = null
}:void

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-data: An HttpRequestData containing the data you wish to post.
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


browser-refresh (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


browser-stop (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


browser-zoom-in (method)
public abstract {EmbeddedBrowserGraphic.browser-zoom-in}:void

Make all text displayed by this object larger.

Introduced in: version 6.0


browser-zoom-out (method)
public abstract {EmbeddedBrowserGraphic.browser-zoom-out}:void

Make all text displayed by this object smaller.

Introduced in: version 6.0


destroy-browser (method)
public abstract {EmbeddedBrowserGraphic.destroy-browser}:void

Destroy the browser, and immediately recover any resources that it was using.

Introduced in: version 6.0