Re: git commit: [flex-asjs] [refs/heads/develop] - Export common bead loading logic to a utils class.
Thanks Yishay. I was thinking more and more about that and I was going to write today that I will go to you suggestion with Util in my case with MDL Chip component. I will use it with pleasure.:) Piotr 2016-12-01 15:33 GMT+01:00 : > Repository: flex-asjs > Updated Branches: > refs/heads/develop 5863a8c83 -> e5020da9e > > > Export common bead loading logic to a utils class. > > > Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo > Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/e5020da9 > Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/e5020da9 > Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/e5020da9 > > Branch: refs/heads/develop > Commit: e5020da9e01c07519415668acc465db78ee6b643 > Parents: 5863a8c > Author: yishayw > Authored: Thu Dec 1 16:33:28 2016 +0200 > Committer: yishayw > Committed: Thu Dec 1 16:33:28 2016 +0200 > > -- > .../projects/Core/src/main/flex/CoreClasses.as | 1 + > .../flex/org/apache/flex/utils/StrandUtils.as | 70 > .../flex/html/beads/AccordionCollapseBead.as| 14 +--- > 3 files changed, 73 insertions(+), 12 deletions(-) > -- > > > http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ > e5020da9/frameworks/projects/Core/src/main/flex/CoreClasses.as > -- > diff --git a/frameworks/projects/Core/src/main/flex/CoreClasses.as > b/frameworks/projects/Core/src/main/flex/CoreClasses.as > index d8c65ef..c4b0752 100644 > --- a/frameworks/projects/Core/src/main/flex/CoreClasses.as > +++ b/frameworks/projects/Core/src/main/flex/CoreClasses.as > @@ -130,6 +130,7 @@ internal class CoreClasses > import org.apache.flex.utils.CSSBorderUtils; CSSBorderUtils; > } > import org.apache.flex.utils.ColorUtil; ColorUtil; > + import org.apache.flex.utils.StrandUtils; StrandUtils; > import org.apache.flex.utils.CSSContainerUtils; CSSContainerUtils; > import org.apache.flex.utils.DisplayUtils; DisplayUtils; > COMPILE::SWF > > http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/ > e5020da9/frameworks/projects/Core/src/main/flex/org/apache/ > flex/utils/StrandUtils.as > -- > diff --git > a/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/StrandUtils.as > b/frameworks/projects/Core/src/main/flex/org/apache/flex/ > utils/StrandUtils.as > new file mode 100644 > index 000..cb6f134 > --- /dev/null > +++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/ > utils/StrandUtils.as > @@ -0,0 +1,70 @@ > +/// > / > +// > +// 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.utils > +{ > + import org.apache.flex.core.IBead; > + import org.apache.flex.core.IBeadModel; > + import org.apache.flex.core.IStrand; > + import org.apache.flex.core.ValuesManager; > + > + /** > +* The StrandUtils class is an all-static class > +* with methods for working with strands and beads. > +* > +* @langversion 3.0 > +* @playerversion Flash 10.2 > +* @playerversion AIR 2.6 > +* @productversion FlexJS 0.0 > +*/ > + public class StrandUtils > + { > + > + // > -- > + // > + // Class methods > + // > + // > -- > + > + /** > +* @return Loaded Bead. > +* > +* @langversion 3.0 > +* @playerversion Flash 9 > +* @playerversion AIR 1.1 > +* @productversion Flex 3 > +*/ > + public stati
git commit: [flex-asjs] [refs/heads/develop] - Export common bead loading logic to a utils class.
Repository: flex-asjs Updated Branches: refs/heads/develop 5863a8c83 -> e5020da9e Export common bead loading logic to a utils class. Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/e5020da9 Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/e5020da9 Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/e5020da9 Branch: refs/heads/develop Commit: e5020da9e01c07519415668acc465db78ee6b643 Parents: 5863a8c Author: yishayw Authored: Thu Dec 1 16:33:28 2016 +0200 Committer: yishayw Committed: Thu Dec 1 16:33:28 2016 +0200 -- .../projects/Core/src/main/flex/CoreClasses.as | 1 + .../flex/org/apache/flex/utils/StrandUtils.as | 70 .../flex/html/beads/AccordionCollapseBead.as| 14 +--- 3 files changed, 73 insertions(+), 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/e5020da9/frameworks/projects/Core/src/main/flex/CoreClasses.as -- diff --git a/frameworks/projects/Core/src/main/flex/CoreClasses.as b/frameworks/projects/Core/src/main/flex/CoreClasses.as index d8c65ef..c4b0752 100644 --- a/frameworks/projects/Core/src/main/flex/CoreClasses.as +++ b/frameworks/projects/Core/src/main/flex/CoreClasses.as @@ -130,6 +130,7 @@ internal class CoreClasses import org.apache.flex.utils.CSSBorderUtils; CSSBorderUtils; } import org.apache.flex.utils.ColorUtil; ColorUtil; + import org.apache.flex.utils.StrandUtils; StrandUtils; import org.apache.flex.utils.CSSContainerUtils; CSSContainerUtils; import org.apache.flex.utils.DisplayUtils; DisplayUtils; COMPILE::SWF http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/e5020da9/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/StrandUtils.as -- diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/StrandUtils.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/StrandUtils.as new file mode 100644 index 000..cb6f134 --- /dev/null +++ b/frameworks/projects/Core/src/main/flex/org/apache/flex/utils/StrandUtils.as @@ -0,0 +1,70 @@ + +// +// 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.utils +{ + import org.apache.flex.core.IBead; + import org.apache.flex.core.IBeadModel; + import org.apache.flex.core.IStrand; + import org.apache.flex.core.ValuesManager; + + /** +* The StrandUtils class is an all-static class +* with methods for working with strands and beads. +* +* @langversion 3.0 +* @playerversion Flash 10.2 +* @playerversion AIR 2.6 +* @productversion FlexJS 0.0 +*/ + public class StrandUtils + { + + //-- + // + // Class methods + // + //-- + + /** +* @return Loaded Bead. +* +* @langversion 3.0 +* @playerversion Flash 9 +* @playerversion AIR 1.1 +* @productversion Flex 3 +*/ + public static function loadBead(classOrInterface:Class, classOrInterfaceName:String, strand:IStrand):IBead + { + var result:IBead = strand.getBeadByType(classOrInterface); + if (result == null) + { + var c:Class = ValuesManager.valuesImpl.getValue(strand, classOrInterfaceName) as Class; + if (