You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ca...@apache.org on 2020/11/15 10:20:52 UTC
[royale-asjs] branch develop updated: jewel-virtualdatagrid: start
of virtual datagrid. requires work on mapper
This is an automated email from the ASF dual-hosted git repository.
carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
The following commit(s) were added to refs/heads/develop by this push:
new 573af4d jewel-virtualdatagrid: start of virtual datagrid. requires work on mapper
573af4d is described below
commit 573af4d483416a64d82dca7211cb93f2593885b8
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Sun Nov 15 11:20:36 2020 +0100
jewel-virtualdatagrid: start of virtual datagrid. requires work on mapper
---
.../projects/Jewel/src/main/resources/defaults.css | 4 +
.../Jewel/src/main/resources/jewel-manifest.xml | 3 +
.../org/apache/royale/jewel/VirtualDataGrid.as | 45 +++++++++
.../datagrid/VirtualDataGridColumnList.as | 111 +++++++++++++++++++++
.../Jewel/src/main/sass/components/_datagrid.sass | 4 +
5 files changed, 167 insertions(+)
diff --git a/frameworks/projects/Jewel/src/main/resources/defaults.css b/frameworks/projects/Jewel/src/main/resources/defaults.css
index 2ab7a2c..05ba274 100644
--- a/frameworks/projects/Jewel/src/main/resources/defaults.css
+++ b/frameworks/projects/Jewel/src/main/resources/defaults.css
@@ -553,6 +553,10 @@ j|DataGridButtonBar {
IItemRenderer: ClassReference("org.apache.royale.jewel.itemRenderers.DatagridHeaderRenderer");
}
+j|VirtualDataGrid {
+ columnClass: ClassReference("org.apache.royale.jewel.supportClasses.datagrid.VirtualDataGridColumnList");
+}
+
.jewel.datechooser .jewel.table {
min-width: 324px;
min-height: 364px;
diff --git a/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml b/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml
index fb47b86..a60a666 100644
--- a/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml
+++ b/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml
@@ -52,6 +52,9 @@
<component id="DataGridColumnList" class="org.apache.royale.jewel.supportClasses.datagrid.DataGridColumnList"/>
<component id="DataGridListArea" class="org.apache.royale.jewel.supportClasses.datagrid.DataGridListArea"/>
<component id="DataGridButtonBar" class="org.apache.royale.jewel.supportClasses.datagrid.DataGridButtonBar"/>
+
+ <component id="VirtualDataGrid" class="org.apache.royale.jewel.VirtualDataGrid"/>
+ <component id="VirtualDataGridColumnList" class="org.apache.royale.jewel.supportClasses.datagrid.VirtualDataGridColumnList"/>
<component id="DataGridColumnLabelsChange" class="org.apache.royale.jewel.beads.controls.datagrid.DataGridColumnLabelsChange"/>
<component id="DataGridSort" class="org.apache.royale.jewel.beads.controls.datagrid.DataGridSort"/>
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/VirtualDataGrid.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/VirtualDataGrid.as
new file mode 100644
index 0000000..bcdfdbd
--- /dev/null
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/VirtualDataGrid.as
@@ -0,0 +1,45 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.royale.jewel
+{
+ /**
+ * The VirtualDataGrid class is a DataGrid component used for large data providers that need to create and recicle just
+ * the visible list renderers.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.9.8
+ */
+ public class VirtualDataGrid extends DataGrid
+ {
+ /**
+ * constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.9.8
+ */
+ public function VirtualDataGrid()
+ {
+ super();
+ }
+ }
+}
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/VirtualDataGridColumnList.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/VirtualDataGridColumnList.as
new file mode 100644
index 0000000..4f5e8f6
--- /dev/null
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/datagrid/VirtualDataGridColumnList.as
@@ -0,0 +1,111 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.royale.jewel.supportClasses.datagrid
+{
+ import org.apache.royale.core.IBead;
+ import org.apache.royale.core.IDataGrid;
+ import org.apache.royale.jewel.VirtualList;
+ import org.apache.royale.jewel.beads.models.DataGridColumnListPresentationModel;
+ import org.apache.royale.jewel.supportClasses.datagrid.IDataGridColumnList;
+ import org.apache.royale.jewel.supportClasses.list.IListPresentationModel;
+
+ /**
+ * The VirtualDataGridColumnList class is the VirtualList class used internally
+ * by VirtualDataGrid for each column.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.9.8
+ */
+ public class VirtualDataGridColumnList extends VirtualList implements IDataGridColumnList
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.9.8
+ */
+ public function VirtualDataGridColumnList()
+ {
+ super();
+ typeNames = "jewel list column";
+ }
+
+ private var _columnInfo:IDataGridColumn;
+ /**
+ * The DataGridColumn for this list
+ *
+ *
+ * @toplevel
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.10.0
+ *
+ * @royalesuppresspublicvarwarning
+ */
+ public function get columnInfo():IDataGridColumn
+ {
+ return _columnInfo;
+ }
+ public function set columnInfo(value:IDataGridColumn):void
+ {
+ if(_columnInfo != value)
+ _columnInfo = value;
+ }
+
+ private var _datagrid:IDataGrid;
+ /**
+ * Pointer back to the IDataGrid that owns this column List
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.9.8
+ */
+ public function get datagrid():IDataGrid {
+ return _datagrid;
+ }
+ public function set datagrid(value:IDataGrid):void {
+ _datagrid = value;
+ }
+
+ /**
+ * The presentation model for the list.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.9
+ * @royaleignorecoercion org.apache.royale.jewel.supportClasses.list.IListPresentationModel
+ */
+ override public function get presentationModel():IBead
+ {
+ var presModel:IListPresentationModel = getBeadByType(IListPresentationModel) as IListPresentationModel;
+ if (presModel == null) {
+ presModel = new DataGridColumnListPresentationModel();
+ addBead(presModel);
+ }
+ return presModel;
+ }
+ }
+}
diff --git a/frameworks/projects/Jewel/src/main/sass/components/_datagrid.sass b/frameworks/projects/Jewel/src/main/sass/components/_datagrid.sass
index 6e62aa5..481abf7 100644
--- a/frameworks/projects/Jewel/src/main/sass/components/_datagrid.sass
+++ b/frameworks/projects/Jewel/src/main/sass/components/_datagrid.sass
@@ -83,3 +83,7 @@ j|DataGridColumnList
//Nothing to change from j|ButtonBar
j|DataGridButtonBar
IItemRenderer: ClassReference("org.apache.royale.jewel.itemRenderers.DatagridHeaderRenderer")
+
+
+j|VirtualDataGrid
+ columnClass: ClassReference("org.apache.royale.jewel.supportClasses.datagrid.VirtualDataGridColumnList")
\ No newline at end of file