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
- Review the information in Changing key mapping for OpenLaszlo actions.
About this task
Procedure
- Start WebSphere Commerce Developer.
- To
open an OpenLaszlo file select one of the
following methods:
- Open file by type:
- Click Navigate > Open OpenLaszlo Type. The Open OpenLaszlo Type dialog opens.
- 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.
- 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:
- Click Navigate > Open OpenLaszlo Type in Hierarchy. The Open OpenLaszlo Type dialog opens.
- 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.
- 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.
- Select one of the hierarchy views:
Hierarchy views View Icon Details Full hierarchy This view displays both the parents and children of the selected type. Subtype hierarchy This view makes the selected type, the root of the tree. Any children of the selected type are also displayed. Supertype hierarchy This view displays only the ancestors of the selected type. - In the
hierarchy view, right-click an entry and then click one
of the following options:
Entry options Header Action Open The 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 type The 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 on Opens the Open OpenLaszlo Type selection dialog. Use this option to display another type's hierarchy. - 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.
- Open file by type:
- The outline view displays a summary of class definitions
and instantiations within an OpenLaszlo file. To use the outline view:
- 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.
- 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.
- Open an OpenLaszlo file by completing step 2.
- Navigate to the Outline view. The class definitions are:
The root objects of an OpenLaszlo file are:Class definitions Class Icon Definition view Elements that can display graphical interface widgets. node Objects that hold data.
Underneath the class definitions, the outline view displays the following elements:Root objects Element Icon canvas library Elements Element Icon attribute event handler include method node instantiation OpenLaszlo instantiation script unknown class type view instantiation - Navigate to the Outline view. Right-click an element;
then click
one of these options:
Element options Option Action Open Declaration Opens 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
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
View Hierarchy Opens 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.