You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ca...@apache.org on 2017/01/15 00:07:11 UTC
git commit: [flex-asjs] [refs/heads/develop] - Update to ads to
TableCell
Repository: flex-asjs
Updated Branches:
refs/heads/develop 4f6eebf3b -> 01048a3e0
Update to ads to TableCell
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/01048a3e
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/01048a3e
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/01048a3e
Branch: refs/heads/develop
Commit: 01048a3e01569a0505920c76f07f88d08c045e3c
Parents: 4f6eebf
Author: Carlos Rovira <ca...@apache.org>
Authored: Sun Jan 15 01:07:08 2017 +0100
Committer: Carlos Rovira <ca...@apache.org>
Committed: Sun Jan 15 01:07:08 2017 +0100
----------------------------------------------------------------------
.../flexjs/MDLExample/src/main/flex/Tables.mxml | 4 +-
.../itemRenderers/CustomTableItemRenderer.mxml | 10 +-
.../main/flex/org/apache/flex/mdl/TableCell.as | 119 ++++++++++++++
.../flex/mdl/itemRenderers/TableItemRenderer.as | 155 -------------------
.../mdl/itemRenderers/TableRowItemRenderer.as | 155 +++++++++++++++++++
.../src/main/resources/defaults.css | 2 +-
.../src/main/resources/mdl-manifest.xml | 3 +-
7 files changed, 284 insertions(+), 164 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/01048a3e/examples/flexjs/MDLExample/src/main/flex/Tables.mxml
----------------------------------------------------------------------
diff --git a/examples/flexjs/MDLExample/src/main/flex/Tables.mxml b/examples/flexjs/MDLExample/src/main/flex/Tables.mxml
index 8cfd7dd..f4dbd22 100644
--- a/examples/flexjs/MDLExample/src/main/flex/Tables.mxml
+++ b/examples/flexjs/MDLExample/src/main/flex/Tables.mxml
@@ -31,7 +31,7 @@ limitations under the License.
<mdl:Table shadow="2" selectable="true" className="customTableItemRenderer">
<mdl:columns>
- <mdl:TableColumn headerText="Material" nonNumeric="true" ascending = "true"/>
+ <mdl:TableColumn headerText="Material" nonNumeric="true"/>
<mdl:TableColumn headerText="Quantity"/>
<mdl:TableColumn headerText="Unit price"/>
</mdl:columns>
@@ -42,7 +42,7 @@ limitations under the License.
destinationPropertyName="dataProvider" />
</mdl:beads>
</mdl:Table>
-
+
</mdl:Grid>
</mdl:TabBarPanel>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/01048a3e/examples/flexjs/MDLExample/src/main/flex/itemRenderers/CustomTableItemRenderer.mxml
----------------------------------------------------------------------
diff --git a/examples/flexjs/MDLExample/src/main/flex/itemRenderers/CustomTableItemRenderer.mxml b/examples/flexjs/MDLExample/src/main/flex/itemRenderers/CustomTableItemRenderer.mxml
index ffc7851..d7d00f6 100644
--- a/examples/flexjs/MDLExample/src/main/flex/itemRenderers/CustomTableItemRenderer.mxml
+++ b/examples/flexjs/MDLExample/src/main/flex/itemRenderers/CustomTableItemRenderer.mxml
@@ -17,7 +17,7 @@ See the License for the specific language governing permissions and
limitations under the License.
-->
-<mdl:TableItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
+<mdl:TableRowItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:js="library://ns.apache.org/flexjs/basic"
xmlns:mdl="library://ns.apache.org/flexjs/mdl"
xmlns="http://www.w3.org/1999/xhtml">
@@ -38,9 +38,9 @@ limitations under the License.
<js:ItemRendererDataBinding />
</mdl:beads>
- <js:Td className="mdl-data-table__cell--non-numeric" text="{material.materialName}"/>
- <js:Td text="{material.quantity}"/>
- <js:Td text="{material.unitPrice}"/>
+ <mdl:TableCell text="{material.materialName}" nonNumeric="true"/>
+ <mdl:TableCell text="{material.quantity}"/>
+ <mdl:TableCell text="{material.unitPrice}"/>
-</mdl:TableItemRenderer>
+</mdl:TableRowItemRenderer>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/01048a3e/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/TableCell.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/TableCell.as b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/TableCell.as
new file mode 100644
index 0000000..8681b98
--- /dev/null
+++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/TableCell.as
@@ -0,0 +1,119 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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
+{
+ import org.apache.flex.core.ContainerBase;
+
+ COMPILE::JS
+ {
+ import org.apache.flex.core.WrappedHTMLElement;
+ }
+
+ /**
+ * The TableCell class is a Cell for MDL Table used normaly in a TableItemRenderer
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class TableCell extends ContainerBase
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function TableCell()
+ {
+ super();
+ }
+
+ private var _text:String = "";
+
+ /**
+ * The text of the td
+ *
+ * @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(textNode == null)
+ {
+ textNode = document.createTextNode('') as Text;
+ element.appendChild(textNode);
+ }
+
+ textNode.nodeValue = value;
+ }
+ }
+
+ COMPILE::JS
+ protected var textNode:Text;
+
+ /**
+ * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
+ */
+ COMPILE::JS
+ override protected function createElement():WrappedHTMLElement
+ {
+ element = document.createElement('td') as WrappedHTMLElement;
+
+ positioner = element;
+ element.flexjs_wrapper = this;
+
+ return element;
+ }
+
+ private var _nonNumeric:Boolean;
+ /**
+ * Activate "mdl-data-table__cell--non-numeric" class selector, for use in table td item.
+ * Applies text formatting to data cell. Numeric is the default
+ * Optional; goes on both table header and table data cells
+ */
+ public function get nonNumeric():Boolean
+ {
+ return _nonNumeric;
+ }
+ public function set nonNumeric(value:Boolean):void
+ {
+ _nonNumeric = value;
+
+ COMPILE::JS
+ {
+ element.classList.toggle("mdl-data-table__cell--non-numeric", _nonNumeric);
+ typeNames = element.className;
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/01048a3e/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/itemRenderers/TableItemRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/itemRenderers/TableItemRenderer.as b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/itemRenderers/TableItemRenderer.as
deleted file mode 100644
index c8a76f0..0000000
--- a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/itemRenderers/TableItemRenderer.as
+++ /dev/null
@@ -1,155 +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.itemRenderers
-{
- COMPILE::JS
- {
- import org.apache.flex.core.WrappedHTMLElement;
- }
-
- import org.apache.flex.html.supportClasses.MXMLItemRenderer;
-
- /**
- * The TableItemRenderer defines the basic Item Renderer for a MDL Table Component.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class TableItemRenderer extends MXMLItemRenderer
- {
- /**
- * constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function TableItemRenderer()
- {
- 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
- private var textNode:Text;
-
- /**
- * Sets the data value and uses the String version of the data for display.
- *
- * @param Object data The object being displayed by the itemRenderer instance.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- override public function set data(value:Object):void
- {
- super.data = value;
-
- var text:String;
- if (labelField || dataField) {
- text = String(value[labelField]);
- } else {
- text = String(value);
- }
-
- COMPILE::JS
- {
- if(textNode != null)
- {
- textNode.nodeValue = text;
- }
- }
- }
-
- /**
- * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
- */
- COMPILE::JS
- override protected function createElement():WrappedHTMLElement
- {
- if(MXMLDescriptor == null)
- {
- positioner = document.createElement('tr') as WrappedHTMLElement;
- element = document.createElement('td') as WrappedHTMLElement;
-
- positioner.appendChild(element);
-
- textNode = document.createTextNode('') as Text;
- element.appendChild(textNode);
- element.flexjs_wrapper = this;
- return positioner;
- } else {
- element = document.createElement('tr') as WrappedHTMLElement;
-
- positioner = element;
-
- element.flexjs_wrapper = this;
-
- return element;
- }
- }
-
- private var _nonNumeric:Boolean;
- /**
- * Activate "mdl-data-table__cell--non-numeric" class selector, for use in table td item.
- * Applies text formatting to data cell. Numeric is the default
- * Optional; goes on both table header and table data cells
- */
- public function get nonNumeric():Boolean
- {
- return _nonNumeric;
- }
- public function set nonNumeric(value:Boolean):void
- {
- _nonNumeric = value;
-
- COMPILE::JS
- {
- element.classList.toggle("mdl-data-table__cell--non-numeric", _nonNumeric);
- typeNames = element.className;
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/01048a3e/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/itemRenderers/TableRowItemRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/itemRenderers/TableRowItemRenderer.as b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/itemRenderers/TableRowItemRenderer.as
new file mode 100644
index 0000000..7b8faf7
--- /dev/null
+++ b/frameworks/projects/MaterialDesignLite/src/main/flex/org/apache/flex/mdl/itemRenderers/TableRowItemRenderer.as
@@ -0,0 +1,155 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.itemRenderers
+{
+ COMPILE::JS
+ {
+ import org.apache.flex.core.WrappedHTMLElement;
+ }
+
+ import org.apache.flex.html.supportClasses.MXMLItemRenderer;
+
+ /**
+ * The TableItemRenderer defines the basic Item Renderer for a MDL Table Component.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class TableRowItemRenderer extends MXMLItemRenderer
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function TableRowItemRenderer()
+ {
+ 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
+ private var textNode:Text;
+
+ /**
+ * Sets the data value and uses the String version of the data for display.
+ *
+ * @param Object data The object being displayed by the itemRenderer instance.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ override public function set data(value:Object):void
+ {
+ super.data = value;
+
+ var text:String;
+ if (labelField || dataField) {
+ text = String(value[labelField]);
+ } else {
+ text = String(value);
+ }
+
+ COMPILE::JS
+ {
+ if(textNode != null)
+ {
+ textNode.nodeValue = text;
+ }
+ }
+ }
+
+ /**
+ * @flexjsignorecoercion org.apache.flex.core.WrappedHTMLElement
+ */
+ COMPILE::JS
+ override protected function createElement():WrappedHTMLElement
+ {
+ if(MXMLDescriptor == null)
+ {
+ positioner = document.createElement('tr') as WrappedHTMLElement;
+ element = document.createElement('td') as WrappedHTMLElement;
+
+ positioner.appendChild(element);
+
+ textNode = document.createTextNode('') as Text;
+ element.appendChild(textNode);
+ element.flexjs_wrapper = this;
+ return positioner;
+ } else {
+ element = document.createElement('tr') as WrappedHTMLElement;
+
+ positioner = element;
+
+ element.flexjs_wrapper = this;
+
+ return element;
+ }
+ }
+
+ private var _nonNumeric:Boolean;
+ /**
+ * Activate "mdl-data-table__cell--non-numeric" class selector, for use in table td item.
+ * Applies text formatting to data cell. Numeric is the default
+ * Optional; goes on both table header and table data cells
+ */
+ public function get nonNumeric():Boolean
+ {
+ return _nonNumeric;
+ }
+ public function set nonNumeric(value:Boolean):void
+ {
+ _nonNumeric = value;
+
+ COMPILE::JS
+ {
+ element.classList.toggle("mdl-data-table__cell--non-numeric", _nonNumeric);
+ typeNames = element.className;
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/01048a3e/frameworks/projects/MaterialDesignLite/src/main/resources/defaults.css
----------------------------------------------------------------------
diff --git a/frameworks/projects/MaterialDesignLite/src/main/resources/defaults.css b/frameworks/projects/MaterialDesignLite/src/main/resources/defaults.css
index f3a33fa..20091a6 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/resources/defaults.css
+++ b/frameworks/projects/MaterialDesignLite/src/main/resources/defaults.css
@@ -63,7 +63,7 @@ Table
IBeadLayout: ClassReference(null); /*"org.apache.flex.html.beads.layouts.VerticalLayout"*/
IDataProviderItemRendererMapper: ClassReference("org.apache.flex.html.beads.DataItemRendererFactoryForArrayData");
IItemRendererClassFactory: ClassReference("org.apache.flex.core.ItemRendererClassFactory");
- IItemRenderer: ClassReference("org.apache.flex.mdl.itemRenderers.TableItemRenderer");
+ IItemRenderer: ClassReference("org.apache.flex.mdl.itemRenderers.TableRowItemRenderer");
}
Navigation
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/01048a3e/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 5eae819..c068148 100644
--- a/frameworks/projects/MaterialDesignLite/src/main/resources/mdl-manifest.xml
+++ b/frameworks/projects/MaterialDesignLite/src/main/resources/mdl-manifest.xml
@@ -59,7 +59,8 @@
<component id="Table" class="org.apache.flex.mdl.Table"/>
<component id="THead" class="org.apache.flex.mdl.THead"/>
<component id="TableColumn" class="org.apache.flex.mdl.TableColumn"/>
- <component id="TableItemRenderer" class="org.apache.flex.mdl.itemRenderers.TableItemRenderer"/>
+ <component id="TableRowItemRenderer" class="org.apache.flex.mdl.itemRenderers.TableRowItemRenderer"/>
+ <component id="TableCell" class="org.apache.flex.mdl.TableCell"/>
<component id="TableView" class="org.apache.flex.mdl.beads.views.TableView"/>
<component id="NavigationLayout" class="org.apache.flex.mdl.NavigationLayout"/>
<component id="LayoutTitle" class="org.apache.flex.mdl.LayoutTitle"/>