From 45a6e39f2cb61bbeb09fc5aaa9b4d6e0b75bd4da Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Wed, 28 Jan 2009 02:11:45 +0000 Subject: [PATCH] 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 --- src/as/com/threerings/flex/FlexUtil.as | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/src/as/com/threerings/flex/FlexUtil.as b/src/as/com/threerings/flex/FlexUtil.as index 88cc45ba..4af5cffd 100644 --- a/src/as/com/threerings/flex/FlexUtil.as +++ b/src/as/com/threerings/flex/FlexUtil.as @@ -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. */