Repository: flex-asjs Updated Branches: refs/heads/develop 8d88042d3 -> 815228c4b
Invisible items don't get laid out, so optionally lay them out when they show. Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/ca552633 Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/ca552633 Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/ca552633 Branch: refs/heads/develop Commit: ca552633123ea47a402828b1e1c047a302c06cea Parents: ee803d5 Author: yishayw <[email protected]> Authored: Thu Jan 26 15:10:38 2017 +0200 Committer: yishayw <[email protected]> Committed: Thu Jan 26 15:10:38 2017 +0200 ---------------------------------------------------------------------- .../flex/html/beads/layouts/LayoutOnShow.as | 71 ++++++++++++++++++++ .../HTML/src/main/resources/basic-manifest.xml | 1 + 2 files changed, 72 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ca552633/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/LayoutOnShow.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/LayoutOnShow.as b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/LayoutOnShow.as new file mode 100644 index 0000000..73e2c82 --- /dev/null +++ b/frameworks/projects/HTML/src/main/flex/org/apache/flex/html/beads/layouts/LayoutOnShow.as @@ -0,0 +1,71 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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.html.beads.layouts +{ + + import org.apache.flex.core.IBead; + import org.apache.flex.core.IStrand; + import org.apache.flex.events.Event; + import org.apache.flex.events.IEventDispatcher; + + /** + * + * This bead ensures that IUIBase objects that are displayed + * are also laid out. Basic components can do without this behavior + * if it is known that the layout does not change. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public class LayoutOnShow implements IBead + { + /** + * Constructor. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public function LayoutOnShow() + { + } + + /*** + * @copy org.apache.flex.core.IBead#strand + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public function set strand(value:IStrand):void + { + var eventDispatcher:IEventDispatcher = IEventDispatcher(value); + eventDispatcher.addEventListener('show', showHandler); + } + + private function showHandler(e:Event):void + { + IEventDispatcher(e.target).dispatchEvent(new Event('layoutNeeded')); + } + } +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ca552633/frameworks/projects/HTML/src/main/resources/basic-manifest.xml ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/src/main/resources/basic-manifest.xml b/frameworks/projects/HTML/src/main/resources/basic-manifest.xml index a48bb56..d344ef4 100644 --- a/frameworks/projects/HTML/src/main/resources/basic-manifest.xml +++ b/frameworks/projects/HTML/src/main/resources/basic-manifest.xml @@ -132,6 +132,7 @@ <component id="ToolTipBead" class="org.apache.flex.html.accessories.ToolTipBead" /> <component id="LayoutChangeNotifier" class="org.apache.flex.html.beads.layouts.LayoutChangeNotifier"/> + <component id="LayoutOnShow" class="org.apache.flex.html.beads.layouts.LayoutOnShow"/> <component id="ImageButton" class="org.apache.flex.html.ImageButton"/> <component id="FlexibleFirstChildHorizontalLayout" class="org.apache.flex.html.beads.layouts.FlexibleFirstChildHorizontalLayout"/> <component id="OneFlexibleChildVerticalLayout" class="org.apache.flex.html.beads.layouts.OneFlexibleChildVerticalLayout"/>
