This section describes the AMP applications, extension points, and plug-ins. Applications and Extension PointsWriting an AMP application is slightly different from writing a typical General Interface application because AMP takes over certain parts of the application life cycle. AMP itself defines the extension points that AMP applications use to perform actions at life cycle events.
A non-AMP General Interface application defines a default component file that the runtime loads when the application loads. This setting is managed in the Project Settings dialog or with the objectseturl deployment parameter saved in the config.xml file. AMP applications do not define a default component file. Rather, they extend the jsx3.amp.main.layout extension point to provide a layout. The declaration of this extension point documents its contract. <!-- Exactly one plug-in should extend this point to provide the default component file to paint. --> <extension point id="layout" name="Main Component Extension Point"> <!-- This should return a function with the following signature: function(parent : jsx3.app.Model) --> <processor type="return-async"/> </extension> The following example shows a possible implementation of this extension point. <extension point="jsx3.amp.main.layout"> <eval>[function (parent) { var b = new jsx3.gui.Block(); b.setText("Hello World"); parent.setChild(b); }][0] </eval> </extension> The array literal syntax ([function(){}][0]) is included to make sure that the script evaluates to the function reference rather than just declaring a function in the global scope. A non-AMP application defines an onLoad script that is executed as soon as the application paints for the first time. Instead of defining such a script in the Project Settings dialog, an AMP application extends the jsx3.amp.main.init extension point. The processor on this extension point is the simple eval type. <extension point="jsx3.amp.main.init"> <eval load="true">this.getPlugIn().onAppInit();</eval> </extension> Standard Extension Points and Plug-InsAMP defines other standard extension points and plug-ins for several useful application-level GUI controls. AMP also defines a plug-in for each optional class in the General Interface standard library. The names of these plug-ins are equal to the fully-qualified names of the classes that they load. Using these plug-ins, an AMP application can completely bypass lazy class loading, which is implemented with a synchronous (lower performing) load. See the General Interface AMP API documentation for more information. Extension Point: jsx3.amp.main.progressThis extension point allows application code to be notified of AMP loading progress. For example, an application may implement a custom load progress indicator when it first loads. An application may also provide feedback to the user when AMP is loading resources over the course of running the application. Plug-In: jsx3.amp.util.menumgrThis plug-in allows a menu bar to be composed of AMP extensions. This plug-in is helpful if an application requires an extensible menu bars or context menus. Plug-In: jsx3.amp.util.prefspanelThis plug-in implements an extensible preferences panel. Panes may be added to the panel via AMP extensions. Plug-In: jsx3.amp.util.wizardThis plug-in implements a wizard control. Wizard panes may be added to the wizard via AMP extensions. Plug-In: jsx3.amp.util.toolbarmgrThis plug-in allows a toolbar to be composed of AMP extensions. Optional Classes of the General Interface Standard LibraryThe General Interface standard library contains the following optional classes; an AMP plug-in is defined for each of these classes: jsx3.app.UserSettings jsx3.gui.Alerts jsx3.gui.Block jsx3.gui.BlockX jsx3.gui.Button jsx3.gui.CheckBox jsx3.gui.ColorPicker jsx3.gui.DatePicker jsx3.gui.Dialog jsx3.gui.Form jsx3.gui.Image jsx3.gui.ImageButton jsx3.gui.LayoutGrid jsx3.gui.Matrix jsx3.gui.Matrix.Column jsx3.gui.Menu jsx3.gui.Painted jsx3.gui.RadioButton jsx3.gui.Select jsx3.gui.Slider jsx3.gui.Sound jsx3.gui.Splitter jsx3.gui.Stack jsx3.gui.StackGroup jsx3.gui.Tab jsx3.gui.TabbedPane jsx3.gui.Table jsx3.gui.TextBox jsx3.gui.TimePicker jsx3.gui.ToolbarButton jsx3.gui.Tree jsx3.gui.Window jsx3.gui.WindowBar jsx3.net.Form jsx3.net.Service jsx3.xml.Cacheable |
Contents
|
