Scriptlet Editor

From PresenceWiki
Revision as of 08:55, 10 February 2011 by Mattpryor (Talk | contribs)

(diff) ←Older revision | view current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search

The Scriptlet Editor allows inline editing and pre-compilation of Java Scriptlets. To launch the editor right click within a Presence Text Area and select "Helpers > Scriptlet Editor" from the pop-up menu. Alternatively press control+j. If the cursor is within an existing scriptlet, that scriptlet will be edited. Otherwise a new blank text area will be shown.

http://www.international-presence.com/wikidocs/images/scriptlet_editor.png

Import directives will be shown in the drop-down list at the top right of the screen:

http://www.international-presence.com/wikidocs/images/scriptlet_editor_imports.png

Click the add ( + ) button to add a class or package to be imported, and remove ( - ) to delete the current import. This list will be translated into a semi-colon separated list in the "import" attribute of the enclosing <java> tag when the editor is closed.

Compile

This attempts to compile the scriptlet code. If there are compilation errors, these will be displayed in an alert box (see below). If there are multiple errors you can scroll through them with the "Previous Error" and "Next Error" buttons. The code which caused the currently displayed error will be highlighted.

http://www.international-presence.com/wikidocs/images/scriptlet_editor_error.png

Okay

If the scriptlet has already been compiled and there have been no changes made, this will dismiss the editor and paste the scriptlet code (including the <java> tags) into the parent text area. Otherwise an attempt will be made to compile the code first:

http://www.international-presence.com/wikidocs/images/scriptlet_editor_finished.png
The finished result after clicking "Okay".

Cancel

This abandons any changes made to the script and dismisses the editor.