Changes between Version 12 and Version 13 of SCRIPTING_ACTIONS_API_R0
- Timestamp:
- 07/16/09 16:37:06 (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
SCRIPTING_ACTIONS_API_R0
v12 v13 91 91 * Register it as an extension 92 92 * Class {{{RunScriptConfigurationPanel}}} implements {{{ActionConfigurationPanel}}} extends {{{BaseSwingVisualElement}}} 93 * Nested class {{{AvailableScripts}}} extends {{{BoundComboBox<Script>}}} 94 * displays all script resources in current book 95 * @Own auto property of type {{{AvailableScripts}}} which returns {{{computeElementProp(AvailableScripts.class, RunScriptConfigurationPanel.class, null);}}} 93 * {{{BoundComboBox<Script>}}} that displays all script resources in current book 96 94 * The swing component should be a panel with the combo box. 95 * Register it as an extension 96 * Class {{{RunScriptActionPersister}}} extends {{{Persister<Ref<RunScriptAction>, Storage>}}} 97 * Schema "link-action:run-script|storage|r3" 97 98 * Register it as an extension 98 99 * Enum {{{org.sophie2.extra.func.scripting.logic.RunScriptLogic}}} implements {{{OperationDef}}} … … 106 107 * Class {{{JSBook}}} extends {{{ScriptableObject}}} 107 108 * Override {{{getClassName}}} to return "Book". That means that script writers will use "Book" instead of "JSBook". 108 * Create a method {{{void setBook(ResourceRef book)}}} which sets the "real" book that is adapted. 109 * Create a method {{{void setBook(ResourceRef book)}}} which sets the "real" book that is adapted. This method is not exposed to users. 109 110 * Create getters, setters and other methods according to the analysis. 110 111 * For example, for the title write {{{String jsGet_title()}}} and {{{void jsSet_title(String title)}}}. This will allow users to benefit from the easy JavaScript syntax: "book.title = 'Design Patterns'". 112 * For page reordering fix the method {{{Book.movePage(int, int)}}} (add validation of indices). 111 113 * Class {{{JSPage}}} extends {{{ScriptableObject}}} 112 114 * {{{getClassName}}} returns "Page". 115 * Create getters, setters and other methods according to the analysis. 113 116 * Class {{{JSFrame}}} extends {{{ScriptableObject}}} 114 117 * {{{getClassName}}} returns "Frame". 118 * Create getters, setters and other methods according to the analysis. 115 119 * Class {{{JSApp}}} extends {{{ScriptableObject}}} 116 120 * {{{getClassName}}} returns "App".