Hi, This is the finished bead. We put "base" on it to indicate it is a class you can use as the basis for control view beads. But feel free to change it now before it gets too much use.
‹peter On 5/3/17, 1:17 PM, "Piotr Zarzycki" <piotrzarzyck...@gmail.com> wrote: >Hi Peter, > >Is this finished bead which I can use straight in my components ? If this >is not class which should be extended - I think better would be name >without "Base". > >Just my feeling when I look without going into the code. > >Piotr > > > >2017-05-03 19:08 GMT+02:00 <p...@apache.org>: > >> Repository: flex-asjs >> Updated Branches: >> refs/heads/develop 7965c6de2 -> 88f0bcbe0 >> >> >> Added AbsolutePositioningViewBeadBase so control components can position >> their sub-elements using absolute positioning. >> >> >> Project: >>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgit-wip-u >>s.apache.org%2Frepos%2Fasf%2Fflex-asjs%2Frepo&data=02%7C01%7C%7Cb4705bba1 >>ccf4c8d0bfa08d492484269%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C6362 >>94286433550282&sdata=76h%2FPdcpqBabnqn%2BJlZpiP4Vp5XzSizXlHTS5EUNd%2BY%3D >>&reserved=0 >> Commit: >>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgit-wip-u >>s.apache.org%2Frepos%2Fasf%2Fflex-asjs%2Fcommit%2F88f0bcbe&data=02%7C01%7 >>C%7Cb4705bba1ccf4c8d0bfa08d492484269%7Cfa7b1b5a7b34438794aed2c178decee1%7 >>C0%7C0%7C636294286433550282&sdata=oM9XL7xk139jn12ioIful8YwO%2BNgKoqCWVvPg >>BLpE20%3D&reserved=0 >> Tree: >>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgit-wip-u >>s.apache.org%2Frepos%2Fasf%2Fflex-asjs%2Ftree%2F88f0bcbe&data=02%7C01%7C% >>7Cb4705bba1ccf4c8d0bfa08d492484269%7Cfa7b1b5a7b34438794aed2c178decee1%7C0 >>%7C0%7C636294286433550282&sdata=YHG%2FTeTBVMccD%2FCzVNUZO9e74fT9gjAqXv7k2 >>rW94uw%3D&reserved=0 >> Diff: >>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgit-wip-u >>s.apache.org%2Frepos%2Fasf%2Fflex-asjs%2Fdiff%2F88f0bcbe&data=02%7C01%7C% >>7Cb4705bba1ccf4c8d0bfa08d492484269%7Cfa7b1b5a7b34438794aed2c178decee1%7C0 >>%7C0%7C636294286433550282&sdata=KH7zotCmcVuj7GLuKHa20cUYCxh189IeobJk%2FLK >>d1Js%3D&reserved=0 >> >> Branch: refs/heads/develop >> Commit: 88f0bcbe0728e2831e097a1b9593f835cf3c564d >> Parents: 7965c6d >> Author: Peter Ent <p...@apache.org> >> Authored: Wed May 3 13:08:08 2017 -0400 >> Committer: Peter Ent <p...@apache.org> >> Committed: Wed May 3 13:08:08 2017 -0400 >> >> ---------------------------------------------------------------------- >> .../Basic/src/main/flex/BasicClasses.as | 1 + >> .../beads/AbsolutePositioningViewBeadBase.as | 113 >>+++++++++++++++++++ >> 2 files changed, 114 insertions(+) >> ---------------------------------------------------------------------- >> >> >> >>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgit-wip-u >>s.apache.org%2Frepos%2Fasf%2Fflex-asjs%2Fblob%2F&data=02%7C01%7C%7Cb4705b >>ba1ccf4c8d0bfa08d492484269%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C6 >>36294286433550282&sdata=kVtfAYLBRzSsOY4OWt4F1UGCg1gZbrCrYsDaoH5RpOo%3D&re >>served=0 >> 88f0bcbe/frameworks/projects/Basic/src/main/flex/BasicClasses.as >> ---------------------------------------------------------------------- >> diff --git a/frameworks/projects/Basic/src/main/flex/BasicClasses.as >> b/frameworks/projects/Basic/src/main/flex/BasicClasses.as >> index 4436e43..c7655cc 100644 >> --- a/frameworks/projects/Basic/src/main/flex/BasicClasses.as >> +++ b/frameworks/projects/Basic/src/main/flex/BasicClasses.as >> @@ -32,6 +32,7 @@ internal class BasicClasses >> import org.apache.flex.html.beads.DispatchInputFinishedBead; >> DispatchInputFinishedBead; >> import org.apache.flex.html.accessories.PasswordInputBead; >> PasswordInputBead; >> import org.apache.flex.html.accessories.TextPromptBead; >> TextPromptBead; >> + import >>org.apache.flex.html.beads.AbsolutePositioningViewBeadBase; >> AbsolutePositioningViewBeadBase; >> import org.apache.flex.html.beads.AlertView; AlertView; >> import org.apache.flex.html.beads.models.AlertModel; AlertModel; >> COMPILE::SWF >> >> >>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgit-wip-u >>s.apache.org%2Frepos%2Fasf%2Fflex-asjs%2Fblob%2F&data=02%7C01%7C%7Cb4705b >>ba1ccf4c8d0bfa08d492484269%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C6 >>36294286433550282&sdata=kVtfAYLBRzSsOY4OWt4F1UGCg1gZbrCrYsDaoH5RpOo%3D&re >>served=0 >> 88f0bcbe/frameworks/projects/Basic/src/main/flex/org/ >> apache/flex/html/beads/AbsolutePositioningViewBeadBase.as >> ---------------------------------------------------------------------- >> diff --git a/frameworks/projects/Basic/src/main/flex/org/apache/flex/ >> html/beads/AbsolutePositioningViewBeadBase.as >>b/frameworks/projects/Basic/ >> src/main/flex/org/apache/flex/html/beads/AbsolutePositioningViewBeadBas >> e.as >> new file mode 100644 >> index 0000000..4843e44 >> --- /dev/null >> +++ >>b/frameworks/projects/Basic/src/main/flex/org/apache/flex/html/beads/ >> AbsolutePositioningViewBeadBase.as >> @@ -0,0 +1,113 @@ >> +/////////////////////////////////////////////////////////// >> ///////////////////// >> +// >> +// 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 >> +// >> +// >>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.apach >>e.org%2Flicenses%2FLICENSE-2.0&data=02%7C01%7C%7Cb4705bba1ccf4c8d0bfa08d4 >>92484269%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636294286433550282& >>sdata=IpjFpYKliPChgVuQA3Z7cFRE%2BKFErCCQKQu%2FhXHv62o%3D&reserved=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 >> +{ >> + import org.apache.flex.core.IBeadView; >> + import org.apache.flex.core.IChild; >> + import org.apache.flex.core.IStrand; >> + import org.apache.flex.core.IUIBase; >> + >> + /** >> + * Use AbsolutePositioningViewBeadBase as the base class for >> custom control view beads. >> + * This class sets the strand's position style to "relative" >>(HTML >> platform) if it is >> + * not already set to either "absolute" or "relative". Then use >> this class's >> + * setAbsolutePosition(child, x, y) function to place children. >> The function not >> + * only set's the child's left and top styles (HTML platform), >>it >> also sets the child's >> + * position to "absolute" (HTML platform). >> + * >> + * On the Flash platform, this class will only set the child's x >> and y properties without >> + * any other side effects. >> + * >> + * @viewbead >> + * @langversion 3.0 >> + * @playerversion Flash 10.2 >> + * @playerversion AIR 2.6 >> + * @productversion FlexJS 0.8 >> + */ >> + public class AbsolutePositioningViewBeadBase implements >>IBeadView >> + { >> + /** >> + * Constructor. >> + * >> + * @langversion 3.0 >> + * @playerversion Flash 10.2 >> + * @playerversion AIR 2.6 >> + * @productversion FlexJS 0.8 >> + */ >> + public function AbsolutePositioningViewBeadBase() >> + { >> + super(); >> + } >> + >> + protected var _strand:IStrand; >> + >> + /** >> + * @copy org.apache.flex.core.IBeaViewd#host >> + * >> + * @langversion 3.0 >> + * @playerversion Flash 10.2 >> + * @playerversion AIR 2.6 >> + * @productversion FlexJS 0.8 >> + */ >> + public function get host():IUIBase >> + { >> + return IUIBase(_strand); >> + } >> + >> + /** >> + * @copy org.apache.flex.core.IBead#strand >> + * >> + * @langversion 3.0 >> + * @playerversion Flash 10.2 >> + * @playerversion AIR 2.6 >> + * @productversion FlexJS 0.8 >> + */ >> + public function set strand(value:IStrand):void >> + { >> + _strand = value; >> + >> + COMPILE::JS { >> + if (host.element.style.position != >> "absolute" && host.element.style.position != "relative") { >> + host.element.style.position = >> "relative"; >> + } >> + } >> + } >> + >> + /** >> + * Sets the position of the child and, on the HTML >> platform, sets the child's position style >> + * value to "absolute". >> + * >> + * @langversion 3.0 >> + * @playerversion Flash 10.2 >> + * @playerversion AIR 2.6 >> + * @productversion FlexJS 0.8 >> + */ >> + public function setAbsolutePosition(child:IChild, >> x:Number, y:Number):void >> + { >> + var childHost:IUIBase = IUIBase(child); >> + >> + childHost.x = x; >> + childHost.y = y; >> + >> + COMPILE::JS { >> + childHost.element.style.position = >> "absolute"; >> + } >> + } >> + } >> +} >> \ No newline at end of file >> >>