Octom
Octom

Reputation: 21

Flash Builder 4.7 and Inspectable metadata tag

Since I migrated to FB 4.7 premium, I don't see code hints for my components' attributes anymore.

For instance, the inspection of this attribute used to work:

[Inspectable(category="Common",enumeration="normal,small",defaultValue="normal")]
public function set size(size:String):void {
    // code
}

Did I miss something with FB 4.7 config?

----- EDITION @Lee Burrows:

I'm not sure to understand your point: if FB 4.7 ignores Inspectable tag, how is it able to suggest values for SDK attributes?

An example for VGroup.verticalAlign attribute:

[Inspectable(category="General", enumeration="top,bottom,middle", defaultValue="top")]
public function get verticalAlign():String
{
    return verticalLayout.verticalAlign;
}

In the mxml editor, FB suggests values "top", "bottom" and "middle" for verticalAlign, so why is it not able to suggest my components attributes values as well?

Upvotes: 0

Views: 933

Answers (2)

Octom
Octom

Reputation: 21

Ok I made some tests and I found two things that changed with FB 4.7:

  • In order to see the hints on the authorized value, the attribute must have a setter AND a getter (some of my components had only a setter, which is bad I agree)
  • The [Inspectable] metadata tag should be placed before the getter, and getter only

So the correct syntax for my example is:

[Inspectable(category="Common",enumeration="normal,small",defaultValue="normal")]
public function get size():String {
    // code
}

public function set size(size:String):void {
    // code
}

Now I see the values as code hint in FB 4.7 again.

Upvotes: 1

user1901867
user1901867

Reputation:

FB 4.7 doesnt have a design view - making the [Inspectable] metatag redundant (i believe it was only used by the design view to determine acceptable values for property input fields).

Upvotes: 0

Related Questions