Uploaded image for project: 'Appcelerator Studio'
  1. Appcelerator Studio
  2. TISTUD-2784

Provide Content Assist for attribute names in Alloy view XML files

    Details

      Description

      Alloy uses XML files to define views. We should provide content assist for the attributes of elements.

      <Alloy>
        <View class="my_class" id="myLabel" onClick="" />
      </Alloy>
      

      For attribute CA we need to look up the properties for the given element's type in the JS index, as well as the events.

      To look up the type name, we take the element name as the type name and determine the namespace prefix. The default prefix is Titanium.UI.. If there is an ns attribute, use it's value as the namespace. Alloy will provide us with the exceptions to the rule for namespace mappings.

      e.g.
      View -> Titanium.UI.View
      Label -> Titanium.UI.Label
      <View ns="Ti.Map"/> -> Titanium.Map.View
      Toolbar -> Titanium.UI.iOS.Toolbar

      The list of attribute name proposals is:

      1. The list of properties of the type
      2. The list of events of the type. Each event name is transformed to be "on" + Character.toUppercase(event.name().charAt(0)) + event.name().substring(1); - i.e. "click" -> "onClick"
      3. The common set of attributes: class, id and ns.

      It should be noted that the Alloy element may only have class and id attributes. The special Require element may have class, id, src, and type.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                cwilliams Christopher Williams
                Reporter:
                cwilliams Christopher Williams
              • Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: