uk.ac.kcl.cch.jb.pliny.browser
Interface IBrowserToolbarContribution

All Known Implementing Classes:
BrowserButtonForSetup

public interface IBrowserToolbarContribution

Plugins who wish to contribute an action button to the browser for Pliny must implement this interface. See the extension point defined by the Pliny plugin 'browserToolbarContribution'.

The browser displays a button for each object of this kind that it finds (via its extension point), and will provide to the code behind this interface the URL and title of the current webpage. It is the job of the supplying plugin to process this through (run()) when the user clicks on the button.

For the contract to work the browser requires the following:

There is an implementation in BrowserButtonForSetup

Author:
Bradley

Method Summary
 void run(org.eclipse.ui.IWorkbenchPage page)
          When the browser use clicks on the contributed button the browser will call this code, passing as a parameter its workbench Page.
 void setTitle(String title)
          Each time the browser processes the web page and collects the page title it will call this method to provide the current web page's title to the implementor.
 void setupToolItem(org.eclipse.swt.widgets.ToolItem item)
          The browser calls this to get a button to display.
 void setUrl(URL url)
          Each time the browser user changes the current web page the browser will call this method to keep the implementing process informed about the current URL the user is seeing.
 

Method Detail

setupToolItem

public void setupToolItem(org.eclipse.swt.widgets.ToolItem item)
The browser calls this to get a button to display. The implementor must define the provided ToolItem -- with an image or text label and other options for display of the button such as a tooltip.

Parameters:
item - ToolItem the browser will display

setUrl

public void setUrl(URL url)
Each time the browser user changes the current web page the browser will call this method to keep the implementing process informed about the current URL the user is seeing.

Parameters:
url - URL the URL of the current displayed page

setTitle

public void setTitle(String title)
Each time the browser processes the web page and collects the page title it will call this method to provide the current web page's title to the implementor.

Parameters:
title -

run

public void run(org.eclipse.ui.IWorkbenchPage page)
When the browser use clicks on the contributed button the browser will call this code, passing as a parameter its workbench Page. The implementor should interpret this as a request to process the previously passed URL and title.

Parameters:
page - IWorkbenchPage the browser's page