Changes between Version 5 and Version 6 of GROUP_SCRIPTING_R0


Ignore:
Timestamp:
07/07/09 16:00:01 (16 years ago)
Author:
mitex
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GROUP_SCRIPTING_R0

    v5 v6  
    6060    * the script is persisted as a plain text file with ".js" extension 
    6161 
     62 * view: 
     63  * menuitems InsertScriptItem and InsertScriptFileItem in Insert menu 
     64  * document window for resource viewing, editing and running: 
     65   * class {{{ScriptDocumentWindow}}} extends {{{DefaultDocumentWindow}}} implements {{{DocumentView}}} 
     66   * RwProp<ResourceRef> model - the script resource that is displayed 
     67   * resource property {{{swingFrameSync}}} that adds a text area and "Run" button to {{{swingComponent}}} 
     68 
     69 * logic: 
     70  * enum ScriptingLogic: 
     71   * INSERT_SCRIPT 
     72    * listens for the event in {{{InsertScriptItem}}} 
     73    * creates a new empty {{{ScriptResource}}} in current book 
     74    * adds it to {{{App.documents}}} (see below for details) 
     75   * INSERT_SCRIPT_FILE 
     76    * listens for the event in {{{InsertScriptFileItem}}} 
     77    * displays a file dialog for "JavaScript files (*.js)" with "Insert" button 
     78    * using the persisters, creates a new {{{ScriptResource}}} in current book 
     79    * adds it to {{{App.documents}}} (see below for details) 
     80   * RUN_SCRIPT 
     81    * listens for the event in the "Run" button 
     82    * write the following temporary solution: 
     83     * create a new context using {{{Context cx = Context.enter();}}} 
     84     * initialize the standard objects (Object, Function, etc.) using {{{Scriptable scope = cx.initStandardObjects();}}} 
     85     * evaluate the resource's text: {{{Object result = cx.evaluateString(scope, s, "<cmd>", 1, null);}}} 
     86     * open a message box to display the result by creating a new {{{MessageDialogInput}}} and invoking {{{DialogManager#showDialog}}} 
     87     * exit from the context with {{{Context.exit();}}}. Call this from a finally block. 
     88 
     89 * Refactor {{{App}}} and {{{AppDocumentsDesktop}}}: 
     90 
    6291 * Source code: [source:/branches/private/deni/scripting/] 
    6392