Ditch createTipLabel, just add another param to createLabel.

No need to avoid overwriting a defaultly-null field value with null.


git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@767 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Ray Greenwell
2009-01-28 02:11:45 +00:00
parent 8cddf9ef1b
commit 45a6e39f2c
+6 -18
View File
@@ -34,31 +34,19 @@ import mx.core.UIComponent;
public class FlexUtil
{
/**
* Creates a label with the supplied text and tooltip, and optionally applies a style class to
* it.
* Creates a label with the supplied text, and optionally applies a style class and tooltip
* to it.
*/
public static function createTipLabel (
text :String, toolTip :String, style :String = null) :Label
public static function createLabel (
text :String, style :String = null, toolTip :String = null) :Label
{
var label :Label = new Label();
label.text = text;
if (toolTip != null) {
label.toolTip = toolTip;
}
if (style != null) {
label.styleName = style;
}
label.styleName = style;
label.toolTip = toolTip;
return label;
}
/**
* Creates a label with the supplied text, and optionally applies a style class to it.
*/
public static function createLabel (text :String, style :String = null) :Label
{
return createTipLabel(text, null, style);
}
/**
* Create an uneditable/unselectable multiline Text widget with the specified text and width.
*/