Adding TableExample.
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/525d9a8d Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/525d9a8d Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/525d9a8d Branch: refs/heads/develop Commit: 525d9a8d6d9c5791e4e1b3205107346a57930886 Parents: b0d78b3 Author: Peter Ent <[email protected]> Authored: Tue Apr 25 15:15:20 2017 -0400 Committer: Peter Ent <[email protected]> Committed: Tue Apr 25 15:15:20 2017 -0400 ---------------------------------------------------------------------- examples/build.xml | 2 + examples/flexjs/TableExample/README.txt | 33 +++++ examples/flexjs/TableExample/build.xml | 55 +++++++++ examples/flexjs/TableExample/pom.xml | 64 ++++++++++ .../src/main/flex/MyInitialView.mxml | 121 +++++++++++++++++++ .../src/main/flex/TableExample.mxml | 33 +++++ 6 files changed, 308 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/525d9a8d/examples/build.xml ---------------------------------------------------------------------- diff --git a/examples/build.xml b/examples/build.xml index 77f4ab0..b4fac50 100644 --- a/examples/build.xml +++ b/examples/build.xml @@ -97,6 +97,7 @@ <ant dir="${basedir}/flexjs/ChartExample"/> <ant dir="${basedir}/flexjs/StorageExample"/> <ant dir="${basedir}/flexjs/StyleExample"/> + <ant dir="${basedir}/flexjs/TableExample"/> <ant dir="${basedir}/flexjs/TodoListSampleApp"/> <ant dir="${basedir}/flexjs/TeamPage"/> <ant dir="${basedir}/flexjs/TreeExample"/> @@ -138,6 +139,7 @@ <ant dir="${basedir}/flexjs/ChartExample" target="clean"/> <ant dir="${basedir}/flexjs/StorageExample" target="clean"/> <ant dir="${basedir}/flexjs/StyleExample" target="clean"/> + <ant dir="${basedir}/flexjs/TableExample" target="clean"/> <ant dir="${basedir}/flexjs/TodoListSampleApp" target="clean"/> <ant dir="${basedir}/flexjs/TeamPage" target="clean"/> <ant dir="${basedir}/flexjs/TreeExample" target="clean"/> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/525d9a8d/examples/flexjs/TableExample/README.txt ---------------------------------------------------------------------- diff --git a/examples/flexjs/TableExample/README.txt b/examples/flexjs/TableExample/README.txt new file mode 100644 index 0000000..1faac9c --- /dev/null +++ b/examples/flexjs/TableExample/README.txt @@ -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. +// +//////////////////////////////////////////////////////////////////////////////// + +DESCRIPTION + +The TableExample demonstrates the use of the Table component. Using Table, you +can build column by row structured grids. When cross compiled to JavaScript, the +Table component produces an HTML <table> structure. + +This Flex application may be run as a Flash SWF or cross-compiled (using Falcon JX) +into JavaScript and HTML and run without Flash. + +COMPONENTS and BEADS + +- Table +- TableRow +- TableHeader and TableCell http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/525d9a8d/examples/flexjs/TableExample/build.xml ---------------------------------------------------------------------- diff --git a/examples/flexjs/TableExample/build.xml b/examples/flexjs/TableExample/build.xml new file mode 100644 index 0000000..6a3df12 --- /dev/null +++ b/examples/flexjs/TableExample/build.xml @@ -0,0 +1,55 @@ +<?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="tableexample" default="main" basedir="."> + <property name="FLEXJS_HOME" location="../../.."/> + <property name="example" value="TableExample" /> + + <property file="${FLEXJS_HOME}/env.properties"/> + <property environment="env"/> + <property file="${FLEXJS_HOME}/build.properties"/> + <property name="FLEX_HOME" value="${FLEXJS_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" > + <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" > + <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> + +</project> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/525d9a8d/examples/flexjs/TableExample/pom.xml ---------------------------------------------------------------------- diff --git a/examples/flexjs/TableExample/pom.xml b/examples/flexjs/TableExample/pom.xml new file mode 100644 index 0000000..c0affb7 --- /dev/null +++ b/examples/flexjs/TableExample/pom.xml @@ -0,0 +1,64 @@ +<?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> + + <!-- + Flash Version: CSS problems + --> + + <parent> + <groupId>org.apache.flex.flexjs.examples</groupId> + <artifactId>examples-flexjs</artifactId> + <version>0.8.0-SNAPSHOT</version> + </parent> + + <artifactId>TableExample</artifactId> + <version>0.8.0-SNAPSHOT</version> + <packaging>swf</packaging> + + <name>Apache Flex - FlexJS: Examples: FlexJS: TableExample</name> + + <build> + <plugins> + <plugin> + <groupId>org.apache.flex.flexjs.compiler</groupId> + <artifactId>flexjs-maven-plugin</artifactId> + <extensions>true</extensions> + <configuration> + <mainClass>TableExample.mxml</mainClass> + </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> + </dependencies> + +</project> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/525d9a8d/examples/flexjs/TableExample/src/main/flex/MyInitialView.mxml ---------------------------------------------------------------------- diff --git a/examples/flexjs/TableExample/src/main/flex/MyInitialView.mxml b/examples/flexjs/TableExample/src/main/flex/MyInitialView.mxml new file mode 100644 index 0000000..c2f81dd --- /dev/null +++ b/examples/flexjs/TableExample/src/main/flex/MyInitialView.mxml @@ -0,0 +1,121 @@ +<?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. + +--> +<js:View xmlns:fx="http://ns.adobe.com/mxml/2009" + xmlns:js="library://ns.apache.org/flexjs/basic"> + + <fx:Style> + @namespace js "library://ns.apache.org/flexjs/basic"; + + + .Table { + backgroundColor: orange; + padding: 4px; + } + + .TableHeader { + backgroundColor: aliceblue; + border: 1px solid orange; + } + + .TableCell { + backgroundColor: lightblue; + border: 1px solid orange; + } + + .CellGroup { + backgroundColor: aliceblue; + padding: 6px; + } + + </fx:Style> + + <js:beads> + <js:ViewDataBinding /> + </js:beads> + + <js:Table width="500" height="400" > + <!-- By placing the width on the cell of the first row, you effectively set the + width for the rest of the cells in each column. Here, the widths are set to + percentage values but you can use pixel values as well. + --> + <js:TableRow> + <js:TableHeader width="25%"> + <js:Label text="Apples" /> + </js:TableHeader> + <js:TableHeader width="50%"> + <js:Label text="Oranges" /> + </js:TableHeader> + <js:TableHeader width="25%"> + <js:Label text="Grapes" /> + </js:TableHeader> + </js:TableRow> + <js:TableRow> + <js:TableCell> + <js:Label text="Row 1, Col 1" /> + </js:TableCell> + <js:TableCell> + <js:Label text="Row 1, Col 2" /> + </js:TableCell> + <js:TableCell> + <js:Label text="Row 1, Col 3" /> + </js:TableCell> + </js:TableRow> + <js:TableRow> + <js:TableCell> + <js:Label text="Row 2, Col 1" /> + </js:TableCell> + <js:TableCell> + <js:Label text="Row 2, Col 2" /> + </js:TableCell> + <js:TableCell> + <js:Label text="Row 2, Col 3" /> + </js:TableCell> + </js:TableRow> + <js:TableRow> + <js:TableCell> + <js:Label text="Row 3, Col 1" /> + </js:TableCell> + <js:TableCell> + <!-- By using a Group within a cell you have better control of the + layout. + --> + <js:Group className="CellGroup"> + <js:beads> + <js:VerticalLayout /> + </js:beads> + <js:Label text="Row 3" /> + <js:Label text="+" /> + <js:Label text="Col 2" /> + </js:Group> + </js:TableCell> + <js:TableCell> + <js:Group className="CellGroup"> + <js:beads> + <js:HorizontalLayout /> + </js:beads> + <js:Label text="Row 3" /> + <js:Label text="+" /> + <js:Label text="Col 3" /> + </js:Group> + </js:TableCell> + </js:TableRow> + </js:Table> + +</js:View> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/525d9a8d/examples/flexjs/TableExample/src/main/flex/TableExample.mxml ---------------------------------------------------------------------- diff --git a/examples/flexjs/TableExample/src/main/flex/TableExample.mxml b/examples/flexjs/TableExample/src/main/flex/TableExample.mxml new file mode 100644 index 0000000..2d5c972 --- /dev/null +++ b/examples/flexjs/TableExample/src/main/flex/TableExample.mxml @@ -0,0 +1,33 @@ +<?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. +// +//////////////////////////////////////////////////////////////////////////////// +--> +<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009" + xmlns:local="*" + xmlns:models="models.*" + xmlns:js="library://ns.apache.org/flexjs/basic" + > + + <js:valuesImpl> + <js:SimpleCSSValuesImpl /> + </js:valuesImpl> + <js:initialView> + <local:MyInitialView /> + </js:initialView> +</js:Application>
