This is an automated email from the ASF dual-hosted git repository.
aharui 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 12a0b20 also dispatch itemclick. Fix for #727
12a0b20 is described below
commit 12a0b2034dbf07b47eac8a6614a197c6d2cd9da1
Author: Alex Harui <[email protected]>
AuthorDate: Fri Feb 21 16:24:38 2020 -0800
also dispatch itemclick. Fix for #727
---
.../MXRoyale/src/main/resources/defaults.css | 4 +-
.../MXRoyale/src/main/royale/MXRoyaleClasses.as | 2 +
.../ListSingleSelectionMouseController.as | 68 ++++++++++++++++++++++
.../TreeSingleSelectionMouseController.as | 68 ++++++++++++++++++++++
4 files changed, 140 insertions(+), 2 deletions(-)
diff --git a/frameworks/projects/MXRoyale/src/main/resources/defaults.css
b/frameworks/projects/MXRoyale/src/main/resources/defaults.css
index 3f18c00..2ed060f 100644
--- a/frameworks/projects/MXRoyale/src/main/resources/defaults.css
+++ b/frameworks/projects/MXRoyale/src/main/resources/defaults.css
@@ -271,7 +271,7 @@ List
{
IBeadModel:
ClassReference("mx.controls.beads.models.SingleSelectionICollectionViewModel");
IBeadView: ClassReference("org.apache.royale.html.beads.ListView");
- IBeadController:
ClassReference("org.apache.royale.html.beads.controllers.ListSingleSelectionMouseController");
+ IBeadController:
ClassReference("mx.controls.listClasses.ListSingleSelectionMouseController");
IBeadLayout:
ClassReference("org.apache.royale.html.beads.layouts.VerticalLayout");
IDataProviderItemRendererMapper:
ClassReference("mx.controls.listClasses.DataItemRendererFactoryForICollectionViewData");
IItemRendererClassFactory:
ClassReference("org.apache.royale.core.SelectableItemRendererClassFactory");
@@ -443,7 +443,7 @@ Tree
{
IBeadLayout:
ClassReference("mx.controls.listClasses.ListVerticalLayout");
IBeadModel:
ClassReference("mx.controls.beads.models.SingleSelectionICollectionViewModel");
- IBeadController:
ClassReference("org.apache.royale.html.beads.controllers.TreeSingleSelectionMouseController");
+ IBeadController:
ClassReference("mx.controls.treeClasses.TreeSingleSelectionMouseController");
IDataProviderItemRendererMapper:
ClassReference("mx.controls.treeClasses.DataItemRendererFactoryForICollectionViewHierarchicalData");
IItemRendererInitializer:
ClassReference("mx.controls.beads.TreeItemRendererInitializer");
IItemRenderer:
ClassReference("mx.controls.treeClasses.TreeItemRenderer");
diff --git a/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
b/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
index 8bc090f..574262e 100644
--- a/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
+++ b/frameworks/projects/MXRoyale/src/main/royale/MXRoyaleClasses.as
@@ -180,6 +180,8 @@ internal class MXRoyaleClasses
import mx.controls.beads.layouts.DataGridLayout; DataGridLayout;
import
mx.controls.beads.layouts.AdvancedDataGridVirtualListVerticalLayout;
AdvancedDataGridVirtualListVerticalLayout;
import mx.controls.listClasses.VirtualListVerticalLayout;
VirtualListVerticalLayout;
+ import mx.controls.listClasses.ListSingleSelectionMouseController;
ListSingleSelectionMouseController;
+ import mx.controls.treeClasses.TreeSingleSelectionMouseController;
TreeSingleSelectionMouseController;
import mx.controls.beads.TreeItemRendererMouseController;
TreeItemRendererMouseController;
import mx.formatters.Formatter; Formatter;
import mx.formatters.IFormatter; IFormatter;
diff --git
a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/ListSingleSelectionMouseController.as
b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/ListSingleSelectionMouseController.as
new file mode 100644
index 0000000..a9db8c2
--- /dev/null
+++
b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/listClasses/ListSingleSelectionMouseController.as
@@ -0,0 +1,68 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 mx.controls.listClasses
+{
+ import mx.events.ItemClickEvent;
+
+ import org.apache.royale.collections.ITreeData;
+ import org.apache.royale.core.ISelectionModel;
+ import org.apache.royale.core.IStrand;
+ import org.apache.royale.events.Event;
+ import org.apache.royale.events.IEventDispatcher;
+ import org.apache.royale.events.ItemClickedEvent;
+ import
org.apache.royale.html.beads.controllers.ListSingleSelectionMouseController;
+
+ /**
+ * The TreeSingleSelectionMouseController class is a controller for
+ * org.apache.royale.html.Tree. This controller watches for selection
+ * events on the tree item renderers and uses those events to open
+ * or close nodes of the tree.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.0
+ */
+ public class ListSingleSelectionMouseController extends
org.apache.royale.html.beads.controllers.ListSingleSelectionMouseController
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.0
+ */
+ public function ListSingleSelectionMouseController()
+ {
+ super();
+ }
+
+ /**
+ * @private
+ */
+ override protected function
selectedHandler(event:ItemClickedEvent):void
+ {
+ super.selectedHandler(event);
+ var newEvent:ItemClickEvent = new
ItemClickEvent(ItemClickEvent.ITEM_CLICK);
+ newEvent.index = event.index;
+ IEventDispatcher(_strand).dispatchEvent(newEvent);
+ }
+ }
+}
diff --git
a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/treeClasses/TreeSingleSelectionMouseController.as
b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/treeClasses/TreeSingleSelectionMouseController.as
new file mode 100644
index 0000000..a822b05
--- /dev/null
+++
b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/treeClasses/TreeSingleSelectionMouseController.as
@@ -0,0 +1,68 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 mx.controls.treeClasses
+{
+ import mx.events.ItemClickEvent;
+
+ import org.apache.royale.collections.ITreeData;
+ import org.apache.royale.core.ISelectionModel;
+ import org.apache.royale.core.IStrand;
+ import org.apache.royale.events.Event;
+ import org.apache.royale.events.IEventDispatcher;
+ import org.apache.royale.events.ItemClickedEvent;
+ import
org.apache.royale.html.beads.controllers.TreeSingleSelectionMouseController;
+
+ /**
+ * The TreeSingleSelectionMouseController class is a controller for
+ * org.apache.royale.html.Tree. This controller watches for selection
+ * events on the tree item renderers and uses those events to open
+ * or close nodes of the tree.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.0
+ */
+ public class TreeSingleSelectionMouseController extends
org.apache.royale.html.beads.controllers.TreeSingleSelectionMouseController
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion Royale 0.0
+ */
+ public function TreeSingleSelectionMouseController()
+ {
+ super();
+ }
+
+ /**
+ * @private
+ */
+ override protected function
selectedHandler(event:ItemClickedEvent):void
+ {
+ super.selectedHandler(event);
+ var newEvent:ItemClickEvent = new
ItemClickEvent(ItemClickEvent.ITEM_CLICK);
+ newEvent.index = event.index;
+ IEventDispatcher(_strand).dispatchEvent(newEvent);
+ }
+ }
+}