Designing an extension user interface

 < Day Day Up > 

Typically, you create an extension to perform a task that users encounter frequently. Certain parts of the task are repetitive; by creating an extension, you can automate the repetitive actions. Some steps in the task can change, or specific attributes of the code that the extension processes can change. To receive user inputs for these variable values, you build a UI.

For example, you might create an extension to update a web catalog. Users periodically need to change values for image sources, item descriptions, and prices. Although the values change, the procedures for getting these values and formatting the information for display on the website remain the same. A simple extension can automate the formatting while letting users manually input the new, updated values for image sources, item descriptions, and prices. A more robust extension can retrieve these values periodically from a database.

The purpose of your extension UI is to receive information that the user inputs. This information handles the variable aspects of a repetitive task that the extension performs. Dreamweaver supports HTML and JavaScript form elements as the basic building blocks for creating extension UI controls and displays the UI using its own HTML renderer. Therefore, an extension UI can be as simple as an HTML file that contains a two-column table with text descriptions and form input fields.

When you design an extension, you should determine what variables are necessary and what form elements can best handle them.

Consider the following basic guidelines when you design an extension UI:

  • To name your extension, place the name in the title tag of your HTML file. Dreamweaver displays the name in the extension title bar.

  • Keep text labels on the left side of your UI, aligned right, with text boxes on the right side, aligned left. This arrangement lets the user's eyes easily locate the beginning of any text box. Minimal text can follow the text box as explanation or units of measure.

  • Keep checkbox and radio button labels on the right side of your UI, aligned left.

  • For readable code, assign logical names to your text boxes. If you use Dreamweaver to create your extension UI, you can use the Property inspector or the Quick Tag Editor to assign names to the fields.

In a typical scenario, after you create the UI, you test the extension code to see that it properly performs the following UI-related tasks:

  • Getting the values from the text boxes

  • Setting default values for the text boxes or gathering values from the selection

  • Applying changes to the user document

     < Day Day Up > 


    Developing Extensions for Macromedia Dreamweaver 8
    Developing Extensions for Macromedia Dreamweaver 8
    ISBN: 0321395409
    EAN: 2147483647
    Year: 2005
    Pages: 282

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net