Repository: flex-asjs Updated Branches: refs/heads/develop f497350a1 -> cc7eedd4c
Added toolTip property to the Express project for some of the button classes. Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/cc7eedd4 Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/cc7eedd4 Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/cc7eedd4 Branch: refs/heads/develop Commit: cc7eedd4c4cced049296915392de4251422f7d4a Parents: f497350 Author: Peter Ent <[email protected]> Authored: Mon Feb 13 13:23:13 2017 -0500 Committer: Peter Ent <[email protected]> Committed: Mon Feb 13 13:23:13 2017 -0500 ---------------------------------------------------------------------- .../src/main/flex/MyInitialView.mxml | 3 +- .../Express/src/main/flex/ExpressClasses.as | 2 + .../apache/flex/express/ImageAndTextButton.as | 64 ++++++++++++++++++++ .../flex/org/apache/flex/express/ImageButton.as | 64 ++++++++++++++++++++ .../flex/org/apache/flex/express/TextButton.as | 34 ++++++++++- .../src/main/resources/express-manifest.xml | 4 +- 6 files changed, 166 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/cc7eedd4/examples/express/DataBindingExample/src/main/flex/MyInitialView.mxml ---------------------------------------------------------------------- diff --git a/examples/express/DataBindingExample/src/main/flex/MyInitialView.mxml b/examples/express/DataBindingExample/src/main/flex/MyInitialView.mxml index a1ea2e4..aa0c446 100644 --- a/examples/express/DataBindingExample/src/main/flex/MyInitialView.mxml +++ b/examples/express/DataBindingExample/src/main/flex/MyInitialView.mxml @@ -106,7 +106,8 @@ limitations under the License. <js:HContainer> <js:VContainer className="leftSide"> <js:TextInput id="symbolTI" text="{MyModel(applicationModel).stockSymbol}" prompt="symbol" /> - <js:TextButton text="Get Quote" className="quoteButton" + <js:TextButton text="Get Quote" className="quoteButton" + toolTip="Requests stock quote from Yahoo!" click="_symbol = symbolTI.text; dispatchEvent(new CustomEvent('buttonClicked'))" /> <js:Label id="field" text="{fieldText}"/> <js:Label className="output" height="24" text="{MyModel(applicationModel).responseText}" /> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/cc7eedd4/frameworks/projects/Express/src/main/flex/ExpressClasses.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Express/src/main/flex/ExpressClasses.as b/frameworks/projects/Express/src/main/flex/ExpressClasses.as index 81f5b23..5f185ee 100644 --- a/frameworks/projects/Express/src/main/flex/ExpressClasses.as +++ b/frameworks/projects/Express/src/main/flex/ExpressClasses.as @@ -32,6 +32,8 @@ internal class ExpressClasses import org.apache.flex.express.Container; Container; import org.apache.flex.express.HContainer; HContainer; import org.apache.flex.express.HView; HView; + import org.apache.flex.express.ImageAndTextButton; ImageAndTextButton; + import org.apache.flex.express.ImageButton; ImageButton; import org.apache.flex.express.List; List; import org.apache.flex.express.MXMLItemRenderer; MXMLItemRenderer; import org.apache.flex.express.MXMLViewer; MXMLViewer; http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/cc7eedd4/frameworks/projects/Express/src/main/flex/org/apache/flex/express/ImageAndTextButton.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Express/src/main/flex/org/apache/flex/express/ImageAndTextButton.as b/frameworks/projects/Express/src/main/flex/org/apache/flex/express/ImageAndTextButton.as new file mode 100644 index 0000000..ca8ef71 --- /dev/null +++ b/frameworks/projects/Express/src/main/flex/org/apache/flex/express/ImageAndTextButton.as @@ -0,0 +1,64 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//////////////////////////////////////////////////////////////////////////////// +package org.apache.flex.express +{ + import org.apache.flex.events.Event; + import org.apache.flex.html.ImageAndTextButton; + import org.apache.flex.html.accessories.ToolTipBead; + + /** + * This class extends ImageAndTextButton and adds the toolTip bead + * as a convenience. + */ + public class ImageAndTextButton extends org.apache.flex.html.ImageAndTextButton + { + public function ImageAndTextButton() + { + super(); + } + + private var _toolTipBead:ToolTipBead = null; + + [Bindable("toolTipChanged")] + /** + * Displays a hint when the mouse hovers over the button + */ + public function get toolTip():String + { + if (_toolTipBead) { + return _toolTipBead.toolTip; + } + else { + return null; + } + } + public function set toolTip(value:String):void + { + _toolTipBead = getBeadByType(ToolTipBead) as ToolTipBead; + + if (_toolTipBead == null) { + _toolTipBead = new ToolTipBead(); + addBead(_toolTipBead); + } + _toolTipBead.toolTip = value; + + dispatchEvent(new Event("toolTipChanged")); + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/cc7eedd4/frameworks/projects/Express/src/main/flex/org/apache/flex/express/ImageButton.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Express/src/main/flex/org/apache/flex/express/ImageButton.as b/frameworks/projects/Express/src/main/flex/org/apache/flex/express/ImageButton.as new file mode 100644 index 0000000..d6e2ef8 --- /dev/null +++ b/frameworks/projects/Express/src/main/flex/org/apache/flex/express/ImageButton.as @@ -0,0 +1,64 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//////////////////////////////////////////////////////////////////////////////// +package org.apache.flex.express +{ + import org.apache.flex.events.Event; + import org.apache.flex.html.ImageButton; + import org.apache.flex.html.accessories.ToolTipBead; + + /** + * This class extends ImageButton and adds the toolTip bead + * as a convenience. + */ + public class ImageButton extends org.apache.flex.html.ImageButton + { + public function ImageButton() + { + super(); + } + + private var _toolTipBead:ToolTipBead = null; + + [Bindable("toolTipChanged")] + /** + * Displays a hint when the mouse hovers over the button + */ + public function get toolTip():String + { + if (_toolTipBead) { + return _toolTipBead.toolTip; + } + else { + return null; + } + } + public function set toolTip(value:String):void + { + _toolTipBead = getBeadByType(ToolTipBead) as ToolTipBead; + + if (_toolTipBead == null) { + _toolTipBead = new ToolTipBead(); + addBead(_toolTipBead); + } + _toolTipBead.toolTip = value; + + dispatchEvent(new Event("toolTipChanged")); + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/cc7eedd4/frameworks/projects/Express/src/main/flex/org/apache/flex/express/TextButton.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Express/src/main/flex/org/apache/flex/express/TextButton.as b/frameworks/projects/Express/src/main/flex/org/apache/flex/express/TextButton.as index 3ccdd52..286f0eb 100644 --- a/frameworks/projects/Express/src/main/flex/org/apache/flex/express/TextButton.as +++ b/frameworks/projects/Express/src/main/flex/org/apache/flex/express/TextButton.as @@ -21,10 +21,11 @@ package org.apache.flex.express import org.apache.flex.events.Event; import org.apache.flex.html.TextButton; import org.apache.flex.html.beads.DisableBead; + import org.apache.flex.html.accessories.ToolTipBead; /** - * This class extends Container and adds the HorizontalLayout - * bead for convenience. + * This class extends TextButton and adds the toolTip bead + * as a convenience. */ public class TextButton extends org.apache.flex.html.TextButton { @@ -35,6 +36,7 @@ package org.apache.flex.express private var _disableBead:DisableBead; private var _enabled:Boolean = true; + private var _toolTipBead:ToolTipBead = null; [Bindable("enabledChanged")] /** @@ -48,6 +50,8 @@ package org.apache.flex.express { _enabled = value; + _disableBead = getBeadByType(DisableBead) as DisableBead; + if (_disableBead == null) { _disableBead = new DisableBead(); addBead(_disableBead); @@ -57,5 +61,31 @@ package org.apache.flex.express dispatchEvent(new Event("enabledChanged")); } + + [Bindable("toolTipChanged")] + /** + * Displays a hint when the mouse hovers over the button + */ + public function get toolTip():String + { + if (_toolTipBead) { + return _toolTipBead.toolTip; + } + else { + return null; + } + } + public function set toolTip(value:String):void + { + _toolTipBead = getBeadByType(ToolTipBead) as ToolTipBead; + + if (_toolTipBead == null) { + _toolTipBead = new ToolTipBead(); + addBead(_toolTipBead); + } + _toolTipBead.toolTip = value; + + dispatchEvent(new Event("toolTipChanged")); + } } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/cc7eedd4/frameworks/projects/Express/src/main/resources/express-manifest.xml ---------------------------------------------------------------------- diff --git a/frameworks/projects/Express/src/main/resources/express-manifest.xml b/frameworks/projects/Express/src/main/resources/express-manifest.xml index d4edbcf..c0d2b16 100644 --- a/frameworks/projects/Express/src/main/resources/express-manifest.xml +++ b/frameworks/projects/Express/src/main/resources/express-manifest.xml @@ -26,6 +26,8 @@ <component id="Container" class="org.apache.flex.express.Container"/> <component id="HContainer" class="org.apache.flex.express.HContainer"/> <component id="HView" class="org.apache.flex.express.HView"/> + <component id="ImageAndTextButton" class="org.apache.flex.express.ImageAndTextButton"/> + <component id="ImageButton" class="org.apache.flex.express.ImageButton" /> <component id="List" class="org.apache.flex.express.List"/> <component id="MXMLItemRenderer" class="org.apache.flex.express.MXMLItemRenderer"/> <component id="MXMLViewer" class="org.apache.flex.express.MXMLViewer"/> @@ -43,7 +45,6 @@ <component id="Image" class="org.apache.flex.html.Image" lookupOnly="true" /> <component id="Label" class="org.apache.flex.html.Label" lookupOnly="true" /> <component id="MultilineLabel" class="org.apache.flex.html.MultilineLabel" lookupOnly="true" /> - <component id="ImageAndTextButton" class="org.apache.flex.html.ImageAndTextButton" lookupOnly="true" /> <component id="ToggleTextButton" class="org.apache.flex.html.ToggleTextButton" lookupOnly="true" /> <component id="TextArea" class="org.apache.flex.html.TextArea" lookupOnly="true" /> <component id="SimpleList" class="org.apache.flex.html.SimpleList" lookupOnly="true" /> @@ -92,7 +93,6 @@ <component id="ToolTipBead" class="org.apache.flex.html.accessories.ToolTipBead" lookupOnly="true" /> <component id="LayoutChangeNotifier" class="org.apache.flex.html.beads.layouts.LayoutChangeNotifier" lookupOnly="true" /> - <component id="ImageButton" class="org.apache.flex.html.ImageButton" lookupOnly="true" /> <component id="FlexibleFirstChildHorizontalLayout" class="org.apache.flex.html.beads.layouts.FlexibleFirstChildHorizontalLayout" lookupOnly="true" /> <component id="OneFlexibleChildVerticalLayout" class="org.apache.flex.html.beads.layouts.OneFlexibleChildVerticalLayout" lookupOnly="true" /> <component id="OneFlexibleChildHorizontalLayout" class="org.apache.flex.html.beads.layouts.OneFlexibleChildHorizontalLayout" lookupOnly="true" />
