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 98da05e jewel-examples: Add todomvc example. Fully functional, but
need styling
98da05e is described below
commit 98da05e240531a284a087b36cabd7db5d7c82268
Author: Carlos Rovira <[email protected]>
AuthorDate: Mon Jan 27 21:06:23 2020 +0100
jewel-examples: Add todomvc example. Fully functional, but need styling
---
examples/jewel/pom.xml | 188 +++++++++++++++++++++
examples/jewel/todomvc/asconfig.json | 31 ++++
examples/jewel/todomvc/build.xml | 56 ++++++
examples/jewel/todomvc/pom.xml | 94 +++++++++++
.../todomvc/src/main/config/compile-app-config.xml | 46 +++++
.../src/main/resources/todomvc-index-template.html | 30 ++++
.../todomvc/src/main/resources/todomvc-styles.css | 28 +++
examples/jewel/todomvc/src/main/royale/App.mxml | 33 ++++
.../jewel/todomvc/renderers/TodoItemRenderer.mxml | 87 ++++++++++
.../royale/jewel/todomvc/views/MainContent.mxml | 138 +++++++++++++++
.../src/main/royale/jewel/todomvc/vos/TodoVO.as | 32 ++++
examples/jewel/todomvc/todomvc.as3proj | 115 +++++++++++++
examples/pom.xml | 1 +
13 files changed, 879 insertions(+)
diff --git a/examples/jewel/pom.xml b/examples/jewel/pom.xml
new file mode 100644
index 0000000..0e3862f
--- /dev/null
+++ b/examples/jewel/pom.xml
@@ -0,0 +1,188 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.royale.examples</groupId>
+ <artifactId>examples</artifactId>
+ <version>0.9.7-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>examples-jewel</artifactId>
+ <version>0.9.7-SNAPSHOT</version>
+ <packaging>pom</packaging>
+
+ <name>Apache Royale: Examples: Jewel</name>
+
+ <modules>
+ <module>todomvc</module>
+ </modules>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.19.1</version>
+ <executions>
+ <execution>
+ <id>tests-default</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <!-- Run the tests from the 'examples-tests' artifact -->
+ <dependenciesToScan>
+
<dependency>org.apache.royale.examples:examples-tests</dependency>
+ </dependenciesToScan>
+ <systemPropertyVariables>
+ <artifactId>${project.artifactId}</artifactId>
+ <version>${project.version}</version>
+ <type>${project.packaging}</type>
+
<targets>${project.build.plugins.plugin.configuration.targets}</targets>
+ <buildDirectory>${project.build.directory}</buildDirectory>
+ </systemPropertyVariables>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.royale.framework</groupId>
+ <artifactId>Core</artifactId>
+ <version>0.9.7-SNAPSHOT</version>
+ <type>swc</type>
+ <classifier>js</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.royale.framework</groupId>
+ <artifactId>Language</artifactId>
+ <version>0.9.7-SNAPSHOT</version>
+ <type>swc</type>
+ <classifier>js</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.royale.framework</groupId>
+ <artifactId>Jewel</artifactId>
+ <version>0.9.7-SNAPSHOT</version>
+ <type>swc</type>
+ <classifier>js</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.royale.framework</groupId>
+ <artifactId>HTML</artifactId>
+ <version>0.9.7-SNAPSHOT</version>
+ <type>swc</type>
+ <classifier>js</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.royale.framework</groupId>
+ <artifactId>Collections</artifactId>
+ <version>0.9.7-SNAPSHOT</version>
+ <type>swc</type>
+ <classifier>js</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.royale.framework</groupId>
+ <artifactId>Binding</artifactId>
+ <version>0.9.7-SNAPSHOT</version>
+ <type>swc</type>
+ <classifier>js</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.royale.framework</groupId>
+ <artifactId>Graphics</artifactId>
+ <version>0.9.7-SNAPSHOT</version>
+ <type>swc</type>
+ <classifier>js</classifier>
+ </dependency>
+
+ <!-- Import the shared unit-tests we want to run on all examples -->
+ <dependency>
+ <groupId>org.apache.royale.examples</groupId>
+ <artifactId>examples-tests</artifactId>
+ <version>0.9.7-SNAPSHOT</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <profiles>
+ <profile>
+ <id>option-with-swf</id>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.royale.framework</groupId>
+ <artifactId>Core</artifactId>
+ <version>0.9.7-SNAPSHOT</version>
+ <type>swc</type>
+ <classifier>swf</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.royale.framework</groupId>
+ <artifactId>Language</artifactId>
+ <version>0.9.7-SNAPSHOT</version>
+ <type>swc</type>
+ <classifier>swf</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.royale.framework</groupId>
+ <artifactId>Jewel</artifactId>
+ <version>0.9.7-SNAPSHOT</version>
+ <type>swc</type>
+ <classifier>swf</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.royale.framework</groupId>
+ <artifactId>HTML</artifactId>
+ <version>0.9.7-SNAPSHOT</version>
+ <type>swc</type>
+ <classifier>swf</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.royale.framework</groupId>
+ <artifactId>Collections</artifactId>
+ <version>0.9.7-SNAPSHOT</version>
+ <type>swc</type>
+ <classifier>swf</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.royale.framework</groupId>
+ <artifactId>Binding</artifactId>
+ <version>0.9.7-SNAPSHOT</version>
+ <type>swc</type>
+ <classifier>swf</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.royale.framework</groupId>
+ <artifactId>Graphics</artifactId>
+ <version>0.9.7-SNAPSHOT</version>
+ <type>swc</type>
+ <classifier>swf</classifier>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+
+</project>
diff --git a/examples/jewel/todomvc/asconfig.json
b/examples/jewel/todomvc/asconfig.json
new file mode 100644
index 0000000..4b6259e
--- /dev/null
+++ b/examples/jewel/todomvc/asconfig.json
@@ -0,0 +1,31 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.
+//
+////////////////////////////////////////////////////////////////////////////////
+{
+ "config": "royale",
+ "compilerOptions": {
+ "debug": false,
+ "targets": ["JSRoyale","SWF"],
+ "source-map": true
+ },
+ "additionalOptions": "-remove-circulars
-js-output-optimization=skipAsCoercions",
+ "files":
+ [
+ "src/main/royale/App.mxml"
+ ]
+}
diff --git a/examples/jewel/todomvc/build.xml b/examples/jewel/todomvc/build.xml
new file mode 100644
index 0000000..36b2dd6
--- /dev/null
+++ b/examples/jewel/todomvc/build.xml
@@ -0,0 +1,56 @@
+<?xml version="1.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.
+
+-->
+
+
+<project name="todomvc" default="main" basedir=".">
+ <property name="ROYALE_HOME" location="../../.."/>
+ <property name="example" value="todomvc" />
+
+ <property file="${ROYALE_HOME}/env.properties"/>
+ <property environment="env"/>
+ <property file="${ROYALE_HOME}/build.properties"/>
+ <property name="ROYALE_HOME" value="${ROYALE_HOME}"/>
+
+ <include file="${basedir}/../../build_example.xml" />
+
+
+
+ <target name="main" depends="clean,build_example.compile-js-only"
description="Clean build of ${example}">
+ </target>
+
+ <target name="clean">
+ <delete dir="${basedir}/bin" failonerror="false" />
+ <delete dir="${basedir}/bin-debug" failonerror="false" />
+ <delete dir="${basedir}/bin-release" failonerror="false" />
+ <delete dir="${basedir}/target" failonerror="false" />
+ </target>
+
+ <target name="examine" depends="build_example.get.browser">
+ <property name="which" value="debug" />
+ <echo message="Make sure label appears."/>
+ <exec executable="${browser}" dir="${basedir}/bin-${which}"
failonerror="true">
+ <arg value="${basedir}/bin-${which}/${example}.html"/>
+ </exec>
+ <exec executable="${browser}" dir="${basedir}/bin/js-${which}"
failonerror="true">
+ <arg value="${basedir}/bin/js-${which}/index.html"/>
+ </exec>
+ </target>
+
+</project>
diff --git a/examples/jewel/todomvc/pom.xml b/examples/jewel/todomvc/pom.xml
new file mode 100644
index 0000000..7e1207b
--- /dev/null
+++ b/examples/jewel/todomvc/pom.xml
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.royale.examples</groupId>
+ <artifactId>examples-jewel</artifactId>
+ <version>0.9.7-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>todomvc</artifactId>
+ <version>0.9.7-SNAPSHOT</version>
+ <packaging>swf</packaging>
+
+ <name>Apache Royale: Examples: TodoMVC</name>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.royale.compiler</groupId>
+ <artifactId>royale-maven-plugin</artifactId>
+ <extensions>true</extensions>
+ <configuration>
+ <mainClass>App.mxml</mainClass>
+ <targets>${royale.targets}</targets>
+ <debug>false</debug>
+
<htmlTemplate>${basedir}/target/javascript/bin/js-debug/todomvc-index-template.html</htmlTemplate>
+ <additionalCompilerOptions>
+ -js-dynamic-access-unknown-members=true;
+ -source-map=true;
+ </additionalCompilerOptions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.royale.framework</groupId>
+ <artifactId>Icons</artifactId>
+ <version>0.9.7-SNAPSHOT</version>
+ <type>swc</type>
+ <classifier>js</classifier>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.royale.framework</groupId>
+ <artifactId>JewelTheme</artifactId>
+ <version>0.9.7-SNAPSHOT</version>
+ <type>swc</type>
+ <scope>theme</scope>
+ <classifier>js</classifier>
+ </dependency>
+ </dependencies>
+
+ <profiles>
+ <profile>
+ <id>option-with-swf</id>
+
+ <properties>
+ <!-- no point building the swf target -->
+ <royale.targets>JSRoyale</royale.targets>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.royale.framework</groupId>
+ <artifactId>Icons</artifactId>
+ <version>0.9.7-SNAPSHOT</version>
+ <type>swc</type>
+ <classifier>swf</classifier>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+
+</project>
diff --git a/examples/jewel/todomvc/src/main/config/compile-app-config.xml
b/examples/jewel/todomvc/src/main/config/compile-app-config.xml
new file mode 100644
index 0000000..a507639
--- /dev/null
+++ b/examples/jewel/todomvc/src/main/config/compile-app-config.xml
@@ -0,0 +1,46 @@
+<!--
+
+ 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.
+
+-->
+<royale-config>
+ <js-output-optimization>
+ <optimization>skipAsCoercions</optimization>
+ </js-output-optimization>
+ <js-dynamic-access-unknown-members>true</js-dynamic-access-unknown-members>
+
+ <compiler>
+ <targets>
+ <target>JSRoyale</target>
+ </targets>
+ <keep-as3-metadata>
+ <name>Bindable</name>
+ <name>Transient</name>
+ </keep-as3-metadata>
+
+ <js-library-path append="true">
+
<path-element>../../../../../../frameworks/js/libs/BasicJS.swc</path-element>
+
<path-element>../../../../../../frameworks/js/libs/IconsJS.swc</path-element>
+ </js-library-path>
+ <!--<library-path append="true">
+
<path-element>../../../../../../frameworks/libs/Basic.swc</path-element>
+
<path-element>../../../../../../frameworks/libs/Icons.swc</path-element>
+ </library-path>-->
+ <theme>
+
<filename>../../../../../../frameworks/libs/JewelTheme.swc</filename>
+ </theme>
+ </compiler>
+</royale-config>
diff --git
a/examples/jewel/todomvc/src/main/resources/todomvc-index-template.html
b/examples/jewel/todomvc/src/main/resources/todomvc-index-template.html
new file mode 100644
index 0000000..764fe53
--- /dev/null
+++ b/examples/jewel/todomvc/src/main/resources/todomvc-index-template.html
@@ -0,0 +1,30 @@
+<!--
+ 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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <meta name="Custom Template for injecting custom style CSS">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0,
maximum-scale=1.0, user-scalable=no" />
+ <link rel="stylesheet" type="text/css" href="${application}.css">
+ <link href="https://fonts.googleapis.com/css?family=Lato:400,700"
rel="stylesheet">
+${head}
+</head>
+<body>
+${body}
+</body>
+</html>
diff --git a/examples/jewel/todomvc/src/main/resources/todomvc-styles.css
b/examples/jewel/todomvc/src/main/resources/todomvc-styles.css
new file mode 100644
index 0000000..77f1cc6
--- /dev/null
+++ b/examples/jewel/todomvc/src/main/resources/todomvc-styles.css
@@ -0,0 +1,28 @@
+/*
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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.
+//
+////////////////////////////////////////////////////////////////////////////////
+*/
+
+@namespace "http://www.w3.org/1999/xhtml";
+@namespace j "library://ns.apache.org/royale/jewel";
+
+.todoItemRenderer
+{
+ IItemRenderer: ClassReference("jewel.todomvc.renderers.TodoItemRenderer");
+}
\ No newline at end of file
diff --git a/examples/jewel/todomvc/src/main/royale/App.mxml
b/examples/jewel/todomvc/src/main/royale/App.mxml
new file mode 100644
index 0000000..6e0b7ac
--- /dev/null
+++ b/examples/jewel/todomvc/src/main/royale/App.mxml
@@ -0,0 +1,33 @@
+<!--
+
+ 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.
+
+-->
+<j:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:j="library://ns.apache.org/royale/jewel"
+ xmlns:js="library://ns.apache.org/royale/basic"
+ xmlns:views="jewel.todomvc.views.*">
+
+ <fx:Style source="../../main/resources/todomvc-styles.css"/>
+
+ <j:valuesImpl>
+ <js:SimpleCSSValuesImpl />
+ </j:valuesImpl>
+
+ <j:initialView>
+ <views:MainContent/>
+ </j:initialView>
+</j:Application>
diff --git
a/examples/jewel/todomvc/src/main/royale/jewel/todomvc/renderers/TodoItemRenderer.mxml
b/examples/jewel/todomvc/src/main/royale/jewel/todomvc/renderers/TodoItemRenderer.mxml
new file mode 100644
index 0000000..d932755
--- /dev/null
+++
b/examples/jewel/todomvc/src/main/royale/jewel/todomvc/renderers/TodoItemRenderer.mxml
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+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.
+
+-->
+<j:ListItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:j="library://ns.apache.org/royale/jewel"
+ xmlns:js="library://ns.apache.org/royale/basic"
+ xmlns="http://www.w3.org/1999/xhtml">
+
+ <fx:Script>
+ <![CDATA[
+ import jewel.todomvc.vos.TodoVO;
+
+ import org.apache.royale.collections.ArrayListView;
+ import org.apache.royale.events.Event;
+ import org.apache.royale.jewel.List;
+ import org.apache.royale.jewel.beads.views.ListView;
+
+ public var host:List;
+
+ [Bindable("dataChange")]
+ public function get item():TodoVO
+ {
+ return data as TodoVO;
+ }
+
+ public function clickCloseButton():void
+ {
+ var view:ListView = this.itemRendererParent as ListView;
+ host = view.host as List;
+ (host.dataProvider as
ArrayListView).removeItemAt(index);
+ dispatchEvent(new Event("itemStateChanged", true));
+ }
+
+ public function edit(event:Event):void
+ {
+ item.label = event.target.text;
+ currentState = 'normal';
+ }
+
+ public function changeItemState(event:Event):void
+ {
+ item.done = event.target.selected;
+ dispatchEvent(new Event("itemStateChanged", true));
+ }
+ ]]>
+ </fx:Script>
+
+ <j:states>
+ <js:State name="normal"/>
+ <js:State name="editing"/>
+ </j:states>
+
+ <j:beads>
+ <js:SimpleStatesImpl/>
+ <js:ItemRendererDataBinding />
+ </j:beads>
+
+ <j:CheckBox selected="{item ? (item.done ? true : false) : false }"
click="changeItemState(event);"/>
+
+ <j:Label html="{item ? item.label : ''}" multiline="true"
visible.normal="true" visible.editing="false" click="currentState = 'editing'"/>
+
+ <j:TextInput localId="editfield" visible.normal="false"
visible.editing="true" enter="edit(event)"/>
+
+ <j:IconButton click="clickCloseButton()">
+ <j:icon>
+ <js:FontIcon text="{MaterialIconType.CLOSE}" material="true"/>
+ </j:icon>
+ </j:IconButton>
+
+</j:ListItemRenderer>
+
diff --git
a/examples/jewel/todomvc/src/main/royale/jewel/todomvc/views/MainContent.mxml
b/examples/jewel/todomvc/src/main/royale/jewel/todomvc/views/MainContent.mxml
new file mode 100644
index 0000000..5f369a5
--- /dev/null
+++
b/examples/jewel/todomvc/src/main/royale/jewel/todomvc/views/MainContent.mxml
@@ -0,0 +1,138 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+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.
+
+-->
+<j:View xmlns:fx="http://ns.adobe.com/mxml/2009"
+ xmlns:j="library://ns.apache.org/royale/jewel"
+ xmlns:js="library://ns.apache.org/royale/basic"
+ xmlns:html="library://ns.apache.org/royale/html"
+ xmlns:local="*"
+ initComplete="setUp()">
+
+ <fx:Script>
+ <![CDATA[
+ import jewel.todomvc.vos.TodoVO;
+
+ import org.apache.royale.collections.ArrayList;
+ import org.apache.royale.collections.ArrayListView;
+ import org.apache.royale.events.Event;
+
+ public function setUp():void
+ {
+ list.addEventListener("itemStateChanged", itemStateChangedHandler)
+ }
+
+ private function addItem(event:Event):void
+ {
+ var newItem:TodoVO = new TodoVO(event.target.text);
+ items.addItem(newItem);
+ event.target.text = "";
+ itemStateChangedHandler();
+ }
+
+ [Bindable]
+ public var items:ArrayList = new ArrayList();
+
+ public function itemsCompleted(listOfItems:ArrayList,
filterFunction:Function = null):ArrayListView
+ {
+ var alv:ArrayListView = new ArrayListView(listOfItems);
+ alv.filterFunction = filterFunction;
+ alv.refresh();
+ return alv;
+ }
+
+ public function allItems(item:TodoVO):Boolean {
+ return true;
+ }
+
+ public function isActive(item:TodoVO):Boolean {
+ return item && item.done == false;
+ }
+
+ public function isCompleted(item:TodoVO):Boolean {
+ return item && item.done == true;
+ }
+
+ public function markAllDone():void {
+ var l:uint = items.length;
+ var item:TodoVO;
+ while(l--) {
+ item = TodoVO(items.getItemAt(l));
+ item.done = true;
+ }
+ }
+
+ public function removeCompleted():void {
+ var l:uint = items.length;
+ var item:TodoVO;
+ while(l--) {
+ item = TodoVO(items.getItemAt(l));
+ if(item.done){
+ items.removeItemAt(l);
+ }
+ }
+ }
+
+ public function itemStateChangedHandler(event:Event = null):void
+ {
+ itemsLeft.text = itemsCompleted(items, isActive).length + " item
left";
+ }
+ ]]>
+ </fx:Script>
+
+ <j:beads>
+ <js:ContainerDataBinding/>
+ </j:beads>
+
+ <html:H1 text="todos"/>
+
+ <j:Card>
+
+ <j:HGroup>
+ <j:IconButton click="markAllDone()">
+ <j:icon>
+ <js:FontIcon text="{MaterialIconType.ARROW_DOWNWARD}"
material="true"/>
+ </j:icon>
+ </j:IconButton>
+ <j:TextInput localId="need" enter="addItem(event)">
+ <j:beads>
+ <j:TextPrompt prompt="What needs to be done?"/>
+ </j:beads>
+ </j:TextInput>
+ </j:HGroup>
+
+ <j:List localId="list" width="200" height="300" rowHeight="60"
+ labelField="label" className="todoItemRenderer"
+ initComplete="list.dataProvider = itemsCompleted(items, null)">
+ <j:beads>
+ <j:AddListItemRendererForArrayListData/>
+ <j:RemoveListItemRendererForArrayListData/>
+ <j:UpdateListItemRendererForArrayListData/>
+ <j:RemoveAllItemRendererForArrayListData/>
+ </j:beads>
+ </j:List>
+ <j:HGroup gap="3">
+ <j:Label localId="itemsLeft" text="0 items left"/>
+ <j:Button text="All" click="list.dataProvider =
itemsCompleted(items, null)"/>
+ <j:Button text="Active" click="list.dataProvider =
itemsCompleted(items, isActive)"/>
+ <j:Button text="Completed" click="list.dataProvider =
itemsCompleted(items, isCompleted)"/>
+ <j:Button text="Clear Completed" click="removeCompleted()"/>
+ </j:HGroup>
+ </j:Card>
+
+</j:View>
\ No newline at end of file
diff --git a/examples/jewel/todomvc/src/main/royale/jewel/todomvc/vos/TodoVO.as
b/examples/jewel/todomvc/src/main/royale/jewel/todomvc/vos/TodoVO.as
new file mode 100644
index 0000000..08f922e
--- /dev/null
+++ b/examples/jewel/todomvc/src/main/royale/jewel/todomvc/vos/TodoVO.as
@@ -0,0 +1,32 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 jewel.todomvc.vos
+{
+ [Bindable]
+ public class TodoVO
+ {
+ public var label:String;
+ public var done:Boolean;
+
+ public function TodoVO(label:String)
+ {
+ this.label = label;
+ }
+ }
+}
diff --git a/examples/jewel/todomvc/todomvc.as3proj
b/examples/jewel/todomvc/todomvc.as3proj
new file mode 100644
index 0000000..1d61005
--- /dev/null
+++ b/examples/jewel/todomvc/todomvc.as3proj
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+ 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.
+
+-->
+<project>
+ <output>
+ <movie fps="60"/>
+ <movie height="600"/>
+ <movie disabled="False"/>
+ <movie background="#FFFFFF"/>
+ <movie path="bin-debug/todomvc.swf"/>
+ <movie width="800"/>
+ <movie platform="Flash Player"/>
+ <movie version="11"/>
+ <movie input=""/>
+ </output>
+ <!-- Other classes to be compiled into your SWF -->
+ <jsOutput>
+ <option path=""/>
+ </jsOutput>
+ <classpaths>
+ <class path="src/main/royale"/>
+ </classpaths>
+ <moonshineResourcePaths></moonshineResourcePaths>
+ <moonshineNativeExtensionPaths></moonshineNativeExtensionPaths>
+ <build>
+ <option es="False"/>
+ <option verboseStackTraces="False"/>
+ <option customSDK=""/>
+ <option loadConfig=""/>
+ <option
additional="-theme=${royalelib}/themes/JewelTheme/src/main/resources/defaults.css
-html-template=src/main/resources/crux-jewel-example-index-template.html
+configname=flex"/>
+ <option optimize="False"/>
+ <option staticLinkRSL="False"/>
+ <option antBuildPath="build/build.xml"/>
+ <option showActionScriptWarnings="True"/>
+ <option compilerConstants=""/>
+ <option locale=""/>
+ <option linkReport=""/>
+ <option showDeprecationWarnings="True"/>
+ <option showUnusedTypeSelectorWarnings="True"/>
+ <option showBindingWarnings="True"/>
+ <option strict="True"/>
+ <option accessible="False"/>
+ <option useNetwork="True"/>
+ <option allowSourcePathOverlap="False"/>
+ <option useResourceBundleMetadata="True"/>
+ <option benchmark="False"/>
+ <option warnings="True"/>
+ </build>
+ <mavenBuild>
+ <option mavenBuildPath=""/>
+ <option settingsFilePath=""/>
+ <option commandLine=""/>
+ <actions>
+ <action action="install" actionName="Build"/>
+ <action action="clean package" actionName="Clean and package"/>
+ <action action="clean" actionName="Clean"/>
+ <action action="clean install" actionName="Clean and Build"/>
+ <action action="war:exploded" actionName="Exploded"/>
+ </actions>
+ </mavenBuild>
+ <includeLibraries></includeLibraries>
+ <libraryPaths></libraryPaths>
+ <externalLibraryPaths></externalLibraryPaths>
+ <rslPaths></rslPaths>
+ <intrinsics>
+ <element path="Library/AS3/frameworks/Flex4"/>
+ <element path="Library\AS3\frameworks\Flex4"/>
+ </intrinsics>
+ <library></library>
+ <compileTargets>
+ <compile path="src/main/royale/todomvc.mxml"/>
+ </compileTargets>
+ <hiddenPaths></hiddenPaths>
+ <preBuildCommand>null</preBuildCommand>
+ <postBuildCommand alwaysRun="False">null</postBuildCommand>
+ <trustSVNCertificate>False</trustSVNCertificate>
+ <options>
+ <option isPrimeFacesVisualEditor="False"/>
+ <option defaultBuildTargets=""/>
+ <option visualEditorExportPath=""/>
+ <option showHiddenPaths="False"/>
+ <option isRoyale="True"/>
+ <option testMovie=""/>
+ <option testMovieCommand=""/>
+ <option isExportedToExistingSource="False"/>
+ </options>
+ <moonshineRunCustomization>
+ <option customUrlToLaunch=""/>
+ <option deviceSimulator="null"/>
+ <option targetPlatform="2"/>
+ <option urlToLaunch=""/>
+ <option projectType="2"/>
+ <option launchMethod="Simulator"/>
+ <deviceSimulator>null</deviceSimulator>
+ <certAndroid>null</certAndroid>
+ <certIos>null</certIos>
+ <certIosProvisioning>null</certIosProvisioning>
+ </moonshineRunCustomization>
+</project>
\ No newline at end of file
diff --git a/examples/pom.xml b/examples/pom.xml
index d923f3b..60cbbbb 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -50,6 +50,7 @@
<module>node</module>
<module>amf</module>
<module>crux</module>
+ <module>jewel</module>
<module>examples-tests</module>
</modules>