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 2018/05/02 14:42:58 UTC

[royale-asjs] branch develop updated: new blog example : BE0005_Creating_a_group_of_Jewel_RadioButtons

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 90d6b2a  new blog example : BE0005_Creating_a_group_of_Jewel_RadioButtons
90d6b2a is described below

commit 90d6b2a84b2464df9dfa9e66741897836323a521
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Wed May 2 16:42:53 2018 +0200

    new blog example : BE0005_Creating_a_group_of_Jewel_RadioButtons
---
 .../README.txt                                     |  29 ++++++
 .../asconfig.json                                  |  31 ++++++
 .../build.xml                                      |  63 ++++++++++++
 .../pom.xml                                        | 112 +++++++++++++++++++++
 .../resources/jewel-example-index-template.html    |  31 ++++++
 .../src/main/resources/styles.css                  |  29 ++++++
 ...005_Creating_a_group_of_Jewel_RadioButtons.mxml |  61 +++++++++++
 examples/blog/pom.xml                              |   1 +
 8 files changed, 357 insertions(+)

diff --git a/examples/blog/BE0005_Creating_a_group_of_Jewel_RadioButtons/README.txt b/examples/blog/BE0005_Creating_a_group_of_Jewel_RadioButtons/README.txt
new file mode 100644
index 0000000..a9223ec
--- /dev/null
+++ b/examples/blog/BE0005_Creating_a_group_of_Jewel_RadioButtons/README.txt
@@ -0,0 +1,29 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+DESCRIPTION
+
+Adding an item to a Jewel List
+
+In this example we'll Learn how to configure a group of Jewel RadioButton controls in a Royale application.
+---
+
+
+http://royale.apache.org/creating-a-group-of-jewel-radiobuttons/
+
diff --git a/examples/blog/BE0005_Creating_a_group_of_Jewel_RadioButtons/asconfig.json b/examples/blog/BE0005_Creating_a_group_of_Jewel_RadioButtons/asconfig.json
new file mode 100644
index 0000000..4b6259e
--- /dev/null
+++ b/examples/blog/BE0005_Creating_a_group_of_Jewel_RadioButtons/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/blog/BE0005_Creating_a_group_of_Jewel_RadioButtons/build.xml b/examples/blog/BE0005_Creating_a_group_of_Jewel_RadioButtons/build.xml
new file mode 100644
index 0000000..095fef3
--- /dev/null
+++ b/examples/blog/BE0005_Creating_a_group_of_Jewel_RadioButtons/build.xml
@@ -0,0 +1,63 @@
+<?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="BE0005_Creating_a_group_of_Jewel_RadioButtons" default="main" basedir=".">
+    <property name="ROYALE_HOME" location="../../.."/>
+    <property name="example" value="App" />
+    
+    <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" description="Clean build of ${example}">
+        <mkdir dir="${basedir}/bin/js-debug/assets" />
+        <copy todir="${basedir}/bin/js-debug/assets" failonerror="false">
+            <fileset dir="${basedir}/src/main/resources/assets">
+                <include name="**" />
+            </fileset>
+        </copy>
+        <mkdir dir="${basedir}/bin/js-release/assets" />
+        <copy todir="${basedir}/bin/js-release/assets" failonerror="false">
+            <fileset dir="${basedir}/src/main/resources/assets">
+                <include name="**" />
+            </fileset>
+        </copy>
+    </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="See various team members."/>
+        <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/blog/BE0005_Creating_a_group_of_Jewel_RadioButtons/pom.xml b/examples/blog/BE0005_Creating_a_group_of_Jewel_RadioButtons/pom.xml
new file mode 100644
index 0000000..c5b70d1
--- /dev/null
+++ b/examples/blog/BE0005_Creating_a_group_of_Jewel_RadioButtons/pom.xml
@@ -0,0 +1,112 @@
+<?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/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.apache.royale.examples</groupId>
+    <artifactId>examples-blog</artifactId>
+    <version>0.9.3-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>BE0005_Creating_a_group_of_Jewel_RadioButtons</artifactId>
+  <version>0.9.3-SNAPSHOT</version>
+  <packaging>swf</packaging>
+
+  <name>Apache Royale: Examples: Blog: 0005: Creating a group of Jewel RadioButtons</name>
+
+  <build>
+    <sourceDirectory>src/main/royale</sourceDirectory>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.royale.compiler</groupId>
+        <artifactId>royale-maven-plugin</artifactId>
+        <extensions>true</extensions>
+        <configuration>
+          <mainClass>BE0005_Creating_a_group_of_Jewel_RadioButtons.mxml</mainClass>
+          <targets>JSRoyale,SWF</targets>
+          <debug>false</debug>
+          <htmlTemplate>${basedir}/target/javascript/bin/js-debug/jewel-example-index-template.html</htmlTemplate>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+
+  <dependencies>
+    <dependency>
+      <groupId>com.adobe.flash.framework</groupId>
+      <artifactId>playerglobal</artifactId>
+      <version>${flash.version}</version>
+      <type>swc</type>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.royale.framework</groupId>
+      <artifactId>Jewel</artifactId>
+      <version>0.9.3-SNAPSHOT</version>
+      <type>swc</type>
+      <classifier>swf</classifier>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.royale.framework</groupId>
+      <artifactId>Jewel</artifactId>
+      <version>0.9.3-SNAPSHOT</version>
+      <type>swc</type>
+      <classifier>js</classifier>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.royale.framework</groupId>
+      <artifactId>Basic</artifactId>
+      <version>0.9.3-SNAPSHOT</version>
+      <type>swc</type>
+      <classifier>swf</classifier>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.royale.framework</groupId>
+      <artifactId>Basic</artifactId>
+      <version>0.9.3-SNAPSHOT</version>
+      <type>swc</type>
+      <classifier>js</classifier>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.royale.framework</groupId>
+      <artifactId>HTML</artifactId>
+      <version>0.9.3-SNAPSHOT</version>
+      <type>swc</type>
+      <classifier>swf</classifier>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.royale.framework</groupId>
+      <artifactId>HTML</artifactId>
+      <version>0.9.3-SNAPSHOT</version>
+      <type>swc</type>
+      <classifier>js</classifier>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.royale.framework</groupId>
+      <artifactId>Jewel-Light-NoFlat-Primary-Blue-Theme</artifactId>
+      <version>0.9.3-SNAPSHOT</version>
+      <type>swc</type>
+      <scope>theme</scope>
+      <classifier>js</classifier>
+    </dependency>
+  </dependencies>
+
+</project>
diff --git a/examples/blog/BE0005_Creating_a_group_of_Jewel_RadioButtons/src/main/resources/jewel-example-index-template.html b/examples/blog/BE0005_Creating_a_group_of_Jewel_RadioButtons/src/main/resources/jewel-example-index-template.html
new file mode 100644
index 0000000..d98e4cf
--- /dev/null
+++ b/examples/blog/BE0005_Creating_a_group_of_Jewel_RadioButtons/src/main/resources/jewel-example-index-template.html
@@ -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.
+-->
+<!DOCTYPE html>
+<html>
+<head>
+	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+	<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, minimum-scale=1.0">
+    <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/blog/BE0005_Creating_a_group_of_Jewel_RadioButtons/src/main/resources/styles.css b/examples/blog/BE0005_Creating_a_group_of_Jewel_RadioButtons/src/main/resources/styles.css
new file mode 100644
index 0000000..75d1f7d
--- /dev/null
+++ b/examples/blog/BE0005_Creating_a_group_of_Jewel_RadioButtons/src/main/resources/styles.css
@@ -0,0 +1,29 @@
+/*
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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";
+
+.Application
+{
+    padding: 10px;
+	margin: 10px;
+}
+	
\ No newline at end of file
diff --git a/examples/blog/BE0005_Creating_a_group_of_Jewel_RadioButtons/src/main/royale/BE0005_Creating_a_group_of_Jewel_RadioButtons.mxml b/examples/blog/BE0005_Creating_a_group_of_Jewel_RadioButtons/src/main/royale/BE0005_Creating_a_group_of_Jewel_RadioButtons.mxml
new file mode 100644
index 0000000..ccaff6f
--- /dev/null
+++ b/examples/blog/BE0005_Creating_a_group_of_Jewel_RadioButtons/src/main/royale/BE0005_Creating_a_group_of_Jewel_RadioButtons.mxml
@@ -0,0 +1,61 @@
+<?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:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
+               xmlns:j="library://ns.apache.org/royale/jewel"
+               xmlns:html="library://ns.apache.org/royale/html"
+               xmlns:js="library://ns.apache.org/royale/basic">
+    
+    <fx:Style source="../../main/resources/styles.css"/>
+
+    <fx:Script>
+		<![CDATA[
+            private function radioChanged(event:Event):void
+			{
+				result.text = "The radio button selected has the value: " + RadioButton(event.target).value;
+			}
+		]]>
+	</fx:Script>
+
+    <js:initialView>
+        <js:View>
+
+            <js:beads>
+                <j:VerticalLayoutWithPaddingAndGap gap="10"/>
+            </js:beads>
+
+            <html:H2 text="Creating a group of Jewel RadioButtons"/>
+            
+            <j:Label text="Which option do you prefer?"/>
+	
+            <j:RadioButton text="Option 1" groupName="radios" value="1" change="radioChanged(event)"/>
+            <j:RadioButton text="Option 2" groupName="radios" value="2" change="radioChanged(event)"/>
+            <j:RadioButton text="Option 3" groupName="radios" value="3" change="radioChanged(event)">
+                <j:beads>
+                    <j:Disabled id="opt3disable" disabled="false"/>
+                </j:beads>
+            </j:RadioButton>
+
+            <j:Label id="result" text="The radio button selected has the value:"/>
+
+            <j:Button text="disable/enable option 3" primary="true" click="opt3disable.disabled = !opt3disable.disabled"/>
+        </js:View>
+    </js:initialView>
+
+</j:Application>
\ No newline at end of file
diff --git a/examples/blog/pom.xml b/examples/blog/pom.xml
index 7806127..a6d6269 100644
--- a/examples/blog/pom.xml
+++ b/examples/blog/pom.xml
@@ -37,6 +37,7 @@
     <module>BE0002_Using_Jewel_Alert_Control</module>
     <module>BE0003_Using_Jewel_Slider_Control</module>
     <module>BE0004_Adding_an_item_to_a_Jewel_List</module>
+    <module>BE0005_Creating_a_group_of_Jewel_RadioButtons</module>
   </modules>
 
   <build>

-- 
To stop receiving notification emails like this one, please contact
carlosrovira@apache.org.