get/set generation for Flex classes and UIComponents

I'm new to IDEA but i'm already feeling at home allthough i'm comping from Eclipse. I'm already making heavy use the templates - what a timesaver! But i have a suggestion for the code generation of properties of Flex classes and components.

The Bindable Metatag seems not to be conform with the "reference" declaration. Also i'd love to have a generation for calling the invalidation methods in UIComponents.

In the end i'd like to have something like the following code shows and in think other developers might think the same:

private var _name:String;


- not Bindable declared:

private var _name:Sting;

public function get name():String
{
    return _name;
}

public function set name(value:String):void
{
    if (_name == value)
        return;
    _name = value;
}


-declared Bindable

private var _name:Sting;

[Bindable("nameChanged")]
public function get name():String
{
    return _name;
}

public function set name(value:String):void
{
    if (_name == value)
        return;
    _name = value;
    dispatchEvent(new Event("nameChanged"));
}



-declared Bindable and calling the invalidiation methods (including dirty flag) in UIComponents.

private var _name:Sting;
private var _nameChanged:Boolean = false;

[Bindable("nameChanged")]
public function get name():String
{
    return _name;
}

public function set name(value:String):void
{
    if (_name == value)
        return;
    _name = value;
    _nameChanged = true;
    invalidateProperties();
    invalidateSize();
    invalidateDisplayList();
    dispatchEvent(new Event("nameChanged"));
}



The last think i'd like to point out is, that the properties will be added at the end of the file. Putting them directly under the member would make the navigation a lil' bit easier. I think it could be a nice enhancement of the feature.



Please sign in to leave a comment.