Example - Scripting

Introduction

These examples show how to use Javascript and HTML-based user-interface to create extensions.
 

Running the example

Before invoking any of the examples, open the Script Console view by selecting the menu item "Perspective > Show View > Other... > Scripting > Script Console".  Messages generated by the samples will be presented within the Script Console view.

There are a number of examples within the Toolkit Scripting examples.  Following are the instructions on how to run each example.

Details

All files referenced in these examples (sample scripts, xml, etc.) cav be found in the directory "/plugins/org.eclipse.scripting.examples".

User Interfaces

A common user interface is used for all of the samples except for the Resource Editor sample.  The common user interface consists of two pages.

The first page demonstrates the use of some of the scripting Toolkit functions.  These are:
     Prompting for a workbench container
     Prompting for workbench files
     Prompting for a system directory
     Prompting for a system file
     Presenting a message box with an OK button
     Presenting a message box with OK and Cancel buttons

The second page demonstrates the ability to associate presentation elements with data elements.  Selecting one or more items in the Departments list box changes the contents in the Employees list box and the contents of the entry fields and label that reside below the list boxes.  If the content of the entry fields at the bottom of the page are modified, the data model is automatically updated with the entered text.

Resource Editor Example

The Resource Editor example displays a data entry page.  If the file excaliburEditorScript.xml is selected, and the popup menu item "Open With > Scripted Resource Editor Example" is selected, the following editor page will be presented.  If any other XML file is selected, the fields will be shown empty.
 

Copyright IBM Corp. 2000, 2001.  All Rights Reserved.