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:
@@ -34,31 +34,19 @@ import mx.core.UIComponent;
|
|||||||
public class FlexUtil
|
public class FlexUtil
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Creates a label with the supplied text and tooltip, and optionally applies a style class to
|
* Creates a label with the supplied text, and optionally applies a style class and tooltip
|
||||||
* it.
|
* to it.
|
||||||
*/
|
*/
|
||||||
public static function createTipLabel (
|
public static function createLabel (
|
||||||
text :String, toolTip :String, style :String = null) :Label
|
text :String, style :String = null, toolTip :String = null) :Label
|
||||||
{
|
{
|
||||||
var label :Label = new Label();
|
var label :Label = new Label();
|
||||||
label.text = text;
|
label.text = text;
|
||||||
if (toolTip != null) {
|
label.styleName = style;
|
||||||
label.toolTip = toolTip;
|
label.toolTip = toolTip;
|
||||||
}
|
|
||||||
if (style != null) {
|
|
||||||
label.styleName = style;
|
|
||||||
}
|
|
||||||
return label;
|
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.
|
* Create an uneditable/unselectable multiline Text widget with the specified text and width.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user