Repository: flex-asjs Updated Branches: refs/heads/develop 9b467ea51 -> df24969c6
refactor list item primary content to be a bead Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/df24969c Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/df24969c Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/df24969c Branch: refs/heads/develop Commit: df24969c67d0dd4dc175bdca736ee8f9ab3e6737 Parents: 9b467ea Author: Carlos Rovira <carlosrov...@apache.org> Authored: Sat Dec 10 17:36:47 2016 +0100 Committer: Carlos Rovira <carlosrov...@apache.org> Committed: Sat Dec 10 17:36:47 2016 +0100 ---------------------------------------------------------------------- .../flex/mdl/beads/ListItemPrimaryContent.as | 85 +++++++++++++++++ .../supportClasses/ListItemPrimaryContent.as | 97 -------------------- .../src/main/resources/mdl-manifest.xml | 2 +- 3 files changed, 86 insertions(+), 98 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/df24969c/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/ListItemPrimaryContent.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/ListItemPrimaryContent.as b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/ListItemPrimaryContent.as new file mode 100644 index 0000000..de0948b --- /dev/null +++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/beads/ListItemPrimaryContent.as @@ -0,0 +1,85 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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.mdl.beads +{ + import org.apache.flex.core.IStrand; + import org.apache.flex.core.IBead; + import org.apache.flex.core.UIBase; + + COMPILE::JS + { + import org.apache.flex.core.WrappedHTMLElement; + } + + /** + * The ListItemPrimaryContent class decorates a tag element in a list item renderer + * + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public class ListItemPrimaryContent implements IBead + { + /** + * constructor. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public function ListItemPrimaryContent() + { + super(); + } + + private var host:UIBase; + + private var _strand:IStrand; + /** + * @copy org.apache.flex.core.IBead#strand + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + * @flexjsignorecoercion org.apache.flex.mdl.TextInput; + */ + public function set strand(value:IStrand):void + { + _strand = value; + + COMPILE::JS + { + host = value as UIBase; + + if (host.element is HTMLElement) + { + host.element.classList.add("mdl-list__item-primary-content"); + } + else + { + throw new Error("Host component must be an MDL element."); + } + } + } + } +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/df24969c/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/supportClasses/ListItemPrimaryContent.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/supportClasses/ListItemPrimaryContent.as b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/supportClasses/ListItemPrimaryContent.as deleted file mode 100644 index 99e6fb2..0000000 --- a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/supportClasses/ListItemPrimaryContent.as +++ /dev/null @@ -1,97 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////// -// -// 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.mdl.supportClasses -{ - import org.apache.flex.core.ContainerBase; - - COMPILE::JS - { - import org.apache.flex.core.WrappedHTMLElement; - } - - /** - * The ListItemPrimaryContent class represents an HTML <span> element - * - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public class ListItemPrimaryContent extends ContainerBase - { - /** - * constructor. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function ListItemPrimaryContent() - { - super(); - - className = ""; //set to empty string avoid 'undefined' output when no class selector is assigned by user; - } - - private var _text:String = ""; - - /** - * The text of the heading - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function get text():String - { - return _text; - } - - public function set text(value:String):void - { - _text = value; - - COMPILE::JS - { - if(MXMLDescriptor == null) { - element.innerHTML = text; - } - } - } - - /** - * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement - */ - COMPILE::JS - override protected function createElement():WrappedHTMLElement - { - typeNames = "mdl-list__item-primary-content"; - - element = document.createElement('span') as WrappedHTMLElement; - - positioner = element; - element.flexjs_wrapper = this; - - return element; - } - } -} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/df24969c/frameworks/projects/MaterialDesignLite/src/main/resources/mdl-manifest.xml ---------------------------------------------------------------------- diff --git a/frameworks/projects/MaterialDesignLite/src/main/resources/mdl-manifest.xml b/frameworks/projects/MaterialDesignLite/src/main/resources/mdl-manifest.xml index 578dafa..958382d 100644 --- a/frameworks/projects/MaterialDesignLite/src/main/resources/mdl-manifest.xml +++ b/frameworks/projects/MaterialDesignLite/src/main/resources/mdl-manifest.xml @@ -45,7 +45,7 @@ <component id="List" class="org.apache.flex.mdl.List"/> <component id="ListView" class="org.apache.flex.mdl.beads.views.ListView"/> <component id="ListItemRenderer" class="org.apache.flex.mdl.itemRenderers.ListItemRenderer"/> - <component id="ListItemPrimaryContent" class="org.apache.flex.mdl.supportClasses.ListItemPrimaryContent"/> + <component id="ListItemPrimaryContent" class="org.apache.flex.mdl.beads.ListItemPrimaryContent"/> <component id="ItemRendererFactoryForArrayData" class="org.apache.flex.mdl.supportClasses.ItemRendererFactoryForArrayData"/> <component id="NavigationLayout" class="org.apache.flex.mdl.NavigationLayout"/> <component id="LayoutTitle" class="org.apache.flex.mdl.LayoutTitle"/>