| Modifier and Type | Field and Description |
|---|---|
| private final HostServicesDelegate |
| Access | Constructor and Description |
|---|---|
| pack-priv | HostServices(Application
the application class app)Package scope constructor to create the HostServices object. |
| Modifier and Type | Method and Description |
|---|---|
| public final String | Returns: the code base URI for this application.Gets the code base URI for this application. |
| public final String | Returns: the document base URI for this application.Gets the document base URI for this application. |
| public final String | Returns: the fully resolved URI.the base URI against which to resolve the relative URI base, String the relative URI to be resolved rel)Resolves the specified relative URI against the base URI and returns the resolved URI. |
| public final void | showDocument(String
the URI of the web page that will be opened in a browser. uri)Opens the specified URI in a new browser window or tab. |
| delegate | back to summary |
|---|---|
| private final HostServicesDelegate delegate | |
| HostServices | back to summary |
|---|---|
| pack-priv HostServices(Application app) Package scope constructor to create the HostServices object.
| |
| getCodeBase | back to summary |
|---|---|
| public final String getCodeBase() Gets the code base URI for this application. This method returns the directory containing the application jar file. If the application is not packaged in a jar file, this method returns the empty string.
| |
| getDocumentBase | back to summary |
|---|---|
| public final String getDocumentBase() Gets the document base URI for this application. This method returns the URI of the current directory.
| |
| resolveURI | back to summary |
|---|---|
| public final String resolveURI(String base, String rel) Resolves the specified relative URI against the base URI and returns the resolved URI. Example:
HostServices services = getHostServices();
String myImage = services.resolveURI(services.getDocumentBase(),
"image.jpg");
Image image = new Image(myImage);
| |
| showDocument | back to summary |
|---|---|
| public final void showDocument(String uri) Opens the specified URI in a new browser window or tab. The determination of whether it is a new browser window or a tab in an existing browser window will be made by the browser preferences. Note that this will respect the pop-up blocker settings of the default browser; it will not try to circumvent them.
| |