From Aptana Development
- Create a new project
- Create a scripts folder in the project
- Create a new JS file in the scripts folder
- Add the following content:
/*
* Menu: Samples > Web View
* Toolbar: Samples > Web View
* Kudos: Paul Colton
* License: EPL 1.0
* DOM: http://localhost/org.eclipse.eclipsemonkey.lang.javascript
*/
function main()
{
webView = views.getView("GoogleWebView");
webView.showView(true);
webView.setTitle("Test");
webView.url = "http://www.aptana.com";
webView.addEventListener("LocationChanging", onLocationChanging);
}
function onLocationChanging(event)
{
var location = event.innerEvent.location;
// Print out the location to the Java console
Packages.java.lang.System.out.println("You clicked on: " + location);
}
- Save the file
- Ensure it was added in the Scripts view
- Ensure it was added to the Scripts menu
- Ensure it was added to the toolbar
- Change Menu name
- Ensure it was added in the Scripts view
- Ensure the old script was removed Scripts view ( May require refresh button to be selected )
- Ensure it was added to the Scripts menu
- Ensure the old script was removed from the Scripts menu
- Change Toolbar name
- Ensure text was updated on Toolbar
- Add image to scripts folder inside project created
- Add Image: <image resource> to script metadata
- Ensure icon displays in toolbar
- Ensure icon displays in Scripts menu
- Run script from toolbar
- Ensure web view opened to www.aptana.com
- Close the view
- Run script from Scripts view
- Ensure web view opened to www.aptana.com
- Close the view
- Run script from menubar
- Ensure web view opened to www.aptana.com
- Close the view
- Delete the scripts folder
- Ensure it was removed from the Scripts view, Script menu, and toolbar
Links