You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by pi...@apache.org on 2017/03/30 05:21:39 UTC
[15/16] git commit: [flex-asjs] [refs/heads/feature/chart-work] - Fix
ListExample: - Cleanup all unnecessary code - Clean up pom - Bring back
ListExample to Maven build
Fix ListExample:
- Cleanup all unnecessary code
- Clean up pom
- Bring back ListExample to Maven build
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/04ad0ed7
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/04ad0ed7
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/04ad0ed7
Branch: refs/heads/feature/chart-work
Commit: 04ad0ed75ca0ff74b7cfc8916193c64c56eb4e53
Parents: f7a3610
Author: piotrz <pi...@apache.org>
Authored: Wed Mar 29 22:15:55 2017 +0200
Committer: piotrz <pi...@apache.org>
Committed: Wed Mar 29 22:15:55 2017 +0200
----------------------------------------------------------------------
examples/flexjs/ListExample/pom.xml | 33 ----------
.../src/main/flex/MyInitialView.mxml | 4 --
.../src/main/flex/simple/GenericList.as | 66 ++------------------
.../src/main/flex/simple/GenericListView.as | 38 ++---------
.../main/flex/simple/IRFactoryForArrayData.as | 2 +-
examples/flexjs/pom.xml | 2 +-
6 files changed, 11 insertions(+), 134 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/04ad0ed7/examples/flexjs/ListExample/pom.xml
----------------------------------------------------------------------
diff --git a/examples/flexjs/ListExample/pom.xml b/examples/flexjs/ListExample/pom.xml
index 1904e11..190702b 100644
--- a/examples/flexjs/ListExample/pom.xml
+++ b/examples/flexjs/ListExample/pom.xml
@@ -46,30 +46,12 @@
<extensions>true</extensions>
<configuration>
<mainClass>ListExample.mxml</mainClass>
- <removeCirculars>true</removeCirculars>
- <!-- Not a config option of flexjs-maven-plugin -->
- <!--flashVersion>20.0</flashVersion-->
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
- <!-- Already added in parent -->
- <!--dependency>
- <groupId>org.apache.flex.flexjs.framework</groupId>
- <artifactId>Core</artifactId>
- <version>0.8.0-SNAPSHOT</version>
- <type>swc</type>
- </dependency-->
-
- <dependency>
- <groupId>org.apache.flex.flexjs.framework</groupId>
- <artifactId>Network</artifactId>
- <version>0.8.0-SNAPSHOT</version>
- <type>swc</type>
- </dependency>
-
<!-- Needed for Flash compilation -->
<dependency>
<groupId>com.adobe.flash.framework</groupId>
@@ -78,20 +60,5 @@
<type>swc</type>
<scope>provided</scope>
</dependency>
-
- <!-- Needed for JavaScript compilation -->
- <!-- Already added in parent -->
- <!--dependency>
- <groupId>org.apache.flex.flexjs.framework</groupId>
- <artifactId>HTML</artifactId>
- <version>0.8.0-SNAPSHOT</version>
- <type>swc</type>
- </dependency>
- <dependency>
- <groupId>org.apache.flex.flexjs.framework</groupId>
- <artifactId>Language</artifactId>
- <version>0.8.0-SNAPSHOT</version>
- <type>swc</type>
- </dependency-->
</dependencies>
</project>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/04ad0ed7/examples/flexjs/ListExample/src/main/flex/MyInitialView.mxml
----------------------------------------------------------------------
diff --git a/examples/flexjs/ListExample/src/main/flex/MyInitialView.mxml b/examples/flexjs/ListExample/src/main/flex/MyInitialView.mxml
index 154149c..09543ae 100644
--- a/examples/flexjs/ListExample/src/main/flex/MyInitialView.mxml
+++ b/examples/flexjs/ListExample/src/main/flex/MyInitialView.mxml
@@ -20,10 +20,6 @@ limitations under the License.
<js:View xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:js="library://ns.apache.org/flexjs/basic"
xmlns:gen="simple.*">
- <fx:Script>
-
- </fx:Script>
-
<fx:Style>
@namespace gen "simple.*";
@namespace js "library://ns.apache.org/flexjs/basic";
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/04ad0ed7/examples/flexjs/ListExample/src/main/flex/simple/GenericList.as
----------------------------------------------------------------------
diff --git a/examples/flexjs/ListExample/src/main/flex/simple/GenericList.as b/examples/flexjs/ListExample/src/main/flex/simple/GenericList.as
index c582b6f..1543167 100644
--- a/examples/flexjs/ListExample/src/main/flex/simple/GenericList.as
+++ b/examples/flexjs/ListExample/src/main/flex/simple/GenericList.as
@@ -18,75 +18,17 @@
////////////////////////////////////////////////////////////////////////////////
package simple
{
- import org.apache.flex.core.IItemRenderer;
- import org.apache.flex.core.IItemRendererParent;
- import org.apache.flex.core.ILayoutHost;
- import org.apache.flex.core.ILayoutParent;
- import org.apache.flex.core.ISelectionModel;
- import org.apache.flex.core.IParentIUIBase;
- import org.apache.flex.core.UIBase;
- import org.apache.flex.core.IChild;
+ import org.apache.flex.html.DataContainer;
- /**
+ /**
* GenericList relies on an itemRenderer factory to produce its children componenents
* and on a layout to arrange them. This is the only UI element aside from the itemRenderers.
*/
- public class GenericList extends UIBase implements IItemRendererParent, ILayoutParent, ILayoutHost
+ public class GenericList extends DataContainer
{
public function GenericList()
{
super();
}
-
- public function get dataProvider():Object
- {
- return ISelectionModel(model).dataProvider;
- }
- public function set dataProvider(value:Object):void
- {
- ISelectionModel(model).dataProvider = value;
- }
-
- public function get labelField():String
- {
- return ISelectionModel(model).labelField;
- }
- public function set labelField(value:String):void
- {
- ISelectionModel(model).labelField = value;
- }
-
- public function getLayoutHost():ILayoutHost
- {
- return this;
- }
-
- public function get contentView():IParentIUIBase
- {
- return this;
- }
-
- public function getItemRendererForIndex(index:int):IItemRenderer
- {
- var child:IItemRenderer = getElementAt(index) as IItemRenderer;
- return child;
- }
-
- public function removeAllElements():void
- {
- while (numElements > 0) {
- var child:IChild = getElementAt(0);
- removeElement(child);
- }
- }
-
- public function updateAllItemRenderers():void
- {
- //todo: IItemRenderer does not define update function but DataItemRenderer does
- //for(var i:int = 0; i < numElements; i++) {
- // var child:IItemRenderer = getElementAt(i) as IItemRenderer;
- // child.update();
- //}
- }
- }
+ }
}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/04ad0ed7/examples/flexjs/ListExample/src/main/flex/simple/GenericListView.as
----------------------------------------------------------------------
diff --git a/examples/flexjs/ListExample/src/main/flex/simple/GenericListView.as b/examples/flexjs/ListExample/src/main/flex/simple/GenericListView.as
index d14a6f8..f4ee1fb 100644
--- a/examples/flexjs/ListExample/src/main/flex/simple/GenericListView.as
+++ b/examples/flexjs/ListExample/src/main/flex/simple/GenericListView.as
@@ -18,35 +18,24 @@
////////////////////////////////////////////////////////////////////////////////
package simple
{
- import org.apache.flex.core.BeadViewBase;
import org.apache.flex.core.IBeadLayout;
import org.apache.flex.core.IDataProviderItemRendererMapper;
- import org.apache.flex.core.IItemRendererParent;
- import org.apache.flex.core.IParentIUIBase;
import org.apache.flex.core.IStrand;
- import org.apache.flex.core.ISelectionModel;
import org.apache.flex.core.ValuesManager;
- import org.apache.flex.html.beads.IListView;
import org.apache.flex.events.Event;
+ import org.apache.flex.html.beads.ListView;
- /**
+ /**
* GenericListView makes sure the itemRendererFactory and the layout beads are installed.
*/
- public class GenericListView extends BeadViewBase implements IListView
+ public class GenericListView extends ListView
{
public function GenericListView()
{
super();
}
- public function get dataGroup():IItemRendererParent
- {
- return _strand as IItemRendererParent;
- }
-
- protected var listModel:ISelectionModel;
-
override public function set strand(value:IStrand):void
{
super.strand = value;
@@ -62,33 +51,16 @@ package simple
host.addEventListener("itemsCreated", itemsCreatedHandler);
- listModel = _strand.getBeadByType(ISelectionModel) as ISelectionModel;
- listModel.addEventListener("dataProviderChanged", dataProviderChangeHandler);
-
performLayout(null);
}
/**
* @private
*/
- protected function itemsCreatedHandler(event:Event):void
- {
- performLayout(event);
- }
-
- /**
- * @private
- */
- protected function dataProviderChangeHandler(event:Event):void
+ override protected function performLayout(event:Event):void
{
- performLayout(event);
- }
+ super.performLayout(event);
- /**
- * @private
- */
- protected function performLayout(event:Event):void
- {
var layout:IBeadLayout = _strand.getBeadByType(IBeadLayout) as IBeadLayout;
if (layout == null) {
var c:Class = ValuesManager.valuesImpl.getValue(host, "iBeadLayout");
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/04ad0ed7/examples/flexjs/ListExample/src/main/flex/simple/IRFactoryForArrayData.as
----------------------------------------------------------------------
diff --git a/examples/flexjs/ListExample/src/main/flex/simple/IRFactoryForArrayData.as b/examples/flexjs/ListExample/src/main/flex/simple/IRFactoryForArrayData.as
index ad0a37e..956b847 100644
--- a/examples/flexjs/ListExample/src/main/flex/simple/IRFactoryForArrayData.as
+++ b/examples/flexjs/ListExample/src/main/flex/simple/IRFactoryForArrayData.as
@@ -141,7 +141,7 @@ package simple
if (!dp)
return;
- dataGroup.removeAllElements();
+ dataGroup.removeAllItemRenderers();
var listView:IListView = _strand.getBeadByType(IListView) as IListView;
var presentationModel:IListPresentationModel = _strand.getBeadByType(IListPresentationModel) as IListPresentationModel;
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/04ad0ed7/examples/flexjs/pom.xml
----------------------------------------------------------------------
diff --git a/examples/flexjs/pom.xml b/examples/flexjs/pom.xml
index d49f223..0831f2f 100644
--- a/examples/flexjs/pom.xml
+++ b/examples/flexjs/pom.xml
@@ -50,7 +50,7 @@
<module>FlexTeamPage_MDL</module>
<module>FlexWebsiteStatsViewer</module>
<module>HelloWorld</module>
- <!--<module>ListExample</module>-->
+ <module>ListExample</module>
<module>MapSearch</module>
<!--module>MDLBlogExample</module>-->
<module>MDLDynamicTabsExample</module>