Since I'm digging into components more I have been writing a lot more getters/setters than I used to, which I don't like, because they are just boring. Luckily, I found a TextMate command by Jason Froderman that will automatically create getter/setter pairs from a class property you have selected. Yeah!
note: it wont work if you already have a value assigned to the property:
-
private var a:Number
works
-
private var a:Number =10
no workie.
New Car Loans new car financing
You can also use a snippet, a little simpler. I set my tab trigger to "getset"
// @property ${2:Description}
private var \$${1:name}:${4:Type};
/////////////////////////////////////
/*
// @method get ${1:name}
//
// @description ${2:Description}
// @return ${4:Void}
*/
function get ${1:name} ():${4:Type} {
return \$${1:name};
}
/////////////////////////////////////
/*
// @method set ${1:name}
//
// @description ${2:Description}
// @param p_${1:name}:${4:Type} Description
// @return ${4:Type}
*/
function set ${1:name} (p_${1:name}:${4:Type}):${4:Type} {
\$${1:name} = p_${1:name};
${5:statement;}
}