org.astrogrid.acr.system
Interface BrowserControl


public interface BrowserControl

AR Service: Control the desktop webbrowser. Trivial interface to display a URL in the desktop's webbrowser.

See Also:
Example of use
Service Name
system.browser

Method Summary
 void openRelative(String relativeURL)
          Display a page from the internal AR webserver in the system webbrowser
 void openURL(URL url)
          Display a page in the system webbrowser.
 

Method Detail

openURL

void openURL(URL url)
             throws ACRException
Display a page in the system webbrowser.

Python Example

# connect to the AR
from xmlrpclib import Server
from os.path import expanduser
ar = Server(file(expanduser('~/.astrogrid-desktop')).next().strip() +'xmlrpc')
 #call this function
ar.system.browser.openURL('http://www.ivoa.net')

Java Example

// connect to the AR
ACR ar = new Finder().find();
// find this component   
BrowserControl bc = (BrowserControl) ar.getService(BrowserControl.class);
 // call this function
bc.openURL(new URL("http://www.ivoa.net"));

Parameters:
url - URL of the resource to display
Throws:
ACRException - if the system webbrowser cannot be launched. Will not throw if after launch the webbrowser then fails to display the page

openRelative

void openRelative(String relativeURL)
                  throws ACRException,
                         InvalidArgumentException
Display a page from the internal AR webserver in the system webbrowser

Parameters:
relativeURL - relative url from root of AR webserver context
See Also:
WebServer.getUrlRoot()
Throws:
ACRException - if the system webbrowser cannot be launched. Will not throw if the webbrowser then fails to display the page
InvalidArgumentException - if valid URL can't be build from parameter relativeURL


Copyright © 2002-2010 AstroGrid. All Rights Reserved.