WebSphere Commerce Developer

Editing OpenLaszlo files

You can search for a specific OpenLaszlo type and view OpenLaszlo files in hierarchy and outline views. The OpenLaszlo editor assists you with updating, adding, or deleting OpenLaszlo files.

The editor, based on the XML editor, includes these features:
  • Automatically associates with your OpenLaszlo files
  • Provides syntax highlighting
  • Creates a new OpenLaszlo outline view

Before you begin

About this task

Complete the following steps:

Procedure

  1. Start WebSphere Commerce Developer.
  2. To open an OpenLaszlo file select one of the following methods:

    • Open file by type:
      1. Click Navigate > Open OpenLaszlo Type. The Open OpenLaszlo Type dialog opens.
      2. In the Enter the name of the type field, enter a type. For example, enter *Grid to find all OpenLaszlo types that contain the Grid string.
      3. Any matches are displayed in the Select OpenLaszlo type dialog. Click the appropriate type and click OK. The selection dialog closes and the OpenLaszlo editor opens displaying the OpenLaszlo file. The editor highlights the OpenLaszlo type you selected.

    • Open by type in hierarchy view:
      1. Click Navigate > Open OpenLaszlo Type in Hierarchy. The Open OpenLaszlo Type dialog opens.
      2. In the Enter the name of the type field, enter a type. For example, enter *Grid to find all OpenLaszlo types that contain the Grid string.
      3. Any matches are displayed in the Select OpenLaszlo type dialog. Click the appropriate type and click OK. The selection dialog closes and the OpenLaszlo Hierarchy view opens.
      4. Select one of the hierarchy views:
        Hierarchy views
        View IconDetails
        Full hierarchy This view displays both the parents and children of the selected type.
        Subtype hierarchyThis view makes the selected type, the root of the tree. Any children of the selected type are also displayed.
        Supertype hierarchyThis view displays only the ancestors of the selected type.
      5. In the hierarchy view, right-click an entry and then click one of the following options:
        Entry options
        Header Action
        OpenThe OpenLaszlo editor opens displaying the OpenLaszlo file. If present, the editor highlights the OpenLaszlo type you selected. If the selected type is not located in the OpenLaszlo file, an error dialog opens. This error can occur when attempting to open a base OpenLaszlo type, such as a view.
        Focus on selected typeThe OpenLaszlo Hierarchy view updates to display the selected type hierarchy. Once displayed, the Hierarchy toolbar buttons can be used to alter the hierarchy view.
        Focus onOpens the Open OpenLaszlo Type selection dialog. Use this option to display another type's hierarchy.
      6. Double-click any of the elements in the hierarchy view. If the Open Laszlo type is contained in the file, the OpenLaszlo editor opens the file and highlights the OpenLaszlo type.
  3. The outline view displays a summary of class definitions and instantiations within an OpenLaszlo file. To use the outline view:
    1. Click Window > Show View > Outline to open the outline view. The Link with Editor option is enabled by default. If you do not want this option enabled, access the outline view menu and clear the Link with Editor check box.
    2. The Sort View option is enabled by default. This option groups all similar elements together. For example, all attributes in a class definition are sorted alphabetically and all methods are grouped together and sorted alphabetically. If this option is disabled, the elements are shown in the order they appear within the OpenLaszlo file. If you do not want the Sort View enabled, access the outline view menu and clear the Sort View check box.
    3. Open an OpenLaszlo file by completing step 2.
    4. Navigate to the Outline view. The class definitions are:
      Class definitions
      ClassIcon Definition
      viewview Elements that can display graphical interface widgets.
      nodenodeObjects that hold data.
      The root objects of an OpenLaszlo file are:
      Root objects
      ElementIcon
      canvas
      Canvas
      library
      Library
      Underneath the class definitions, the outline view displays the following elements:
      Elements
      Element Icon
      attribute
      Attributes
      event
      Event
      handler
      Handler
      include
      Include
      method
      Method
      node instantiation
      Node instantiation
      OpenLaszlo instantiation
      OpenLaszlo instantiation
      script
      Script
      unknown class type
      Unknown class type
      view instantiation
      View instantiation
    5. Navigate to the Outline view. Right-click an element; then click one of these options:
      Element options
      Option Action
      Open DeclarationOpens the declaration of the selected element in the OpenLaszlo editor. Declaration types:
      instantiation
      Displays the object's class definition
      class
      Places the cursor at the beginning of the class' definition
      The declaration action is disabled for non-class or non-instantiation related elements such as attributes or methods. The action is also disabled when the object does not exist in the workspace.
      Open Super Declaration Opens the super declaration of the selected element in the OpenLaszlo editor. Declaration types:
      instantiation
      Displays the object's super definition
      class
      Displays the class' super object
      The declaration action is disabled for non-class or non-instantiation related elements like attributes or methods. The action is also disabled when the object does not exist in the workspace.
      View HierarchyOpens the OpenLaszlo Hierarchy view if the view has not been previously opened. The action is disabled when the type is not known or the type is not a class related element.