You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by er...@apache.org on 2013/02/28 10:12:27 UTC
svn commit: r1451146 - in
/flex/falcon/trunk/compiler.jx.tests/test-files/flexjs/projects/FlexJSTest/src:
controllers/ controllers/MyController.as models/ models/MyModel.as
Author: erikdebruin
Date: Thu Feb 28 09:12:27 2013
New Revision: 1451146
URL: http://svn.apache.org/r1451146
Log:
Some files that got 'left behind' during my last commit.
Added:
flex/falcon/trunk/compiler.jx.tests/test-files/flexjs/projects/FlexJSTest/src/controllers/
flex/falcon/trunk/compiler.jx.tests/test-files/flexjs/projects/FlexJSTest/src/controllers/MyController.as (with props)
flex/falcon/trunk/compiler.jx.tests/test-files/flexjs/projects/FlexJSTest/src/models/
flex/falcon/trunk/compiler.jx.tests/test-files/flexjs/projects/FlexJSTest/src/models/MyModel.as (with props)
Added: flex/falcon/trunk/compiler.jx.tests/test-files/flexjs/projects/FlexJSTest/src/controllers/MyController.as
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx.tests/test-files/flexjs/projects/FlexJSTest/src/controllers/MyController.as?rev=1451146&view=auto
==============================================================================
--- flex/falcon/trunk/compiler.jx.tests/test-files/flexjs/projects/FlexJSTest/src/controllers/MyController.as (added)
+++ flex/falcon/trunk/compiler.jx.tests/test-files/flexjs/projects/FlexJSTest/src/controllers/MyController.as Thu Feb 28 09:12:27 2013
@@ -0,0 +1,80 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 controllers
+{
+ import flash.events.Event;
+
+ import org.apache.flex.core.Application;
+ import org.apache.flex.core.IDocument;
+
+ import models.MyModel;
+
+ public class MyController implements IDocument
+ {
+ public function MyController(app:Application = null)
+ {
+ if (app)
+ {
+ this.app = app as FlexJSTest;
+ app.addEventListener("viewChanged", viewChangeHandler);
+ }
+ }
+
+ private var queryBegin:String = "http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.quotes%20where%20symbol%20in%20(%22";
+ private var queryEnd:String = "%22)%0A%09%09&env=http%3A%2F%2Fdatatables.org%2Falltables.env&format=json";
+ private var app:FlexJSTest;
+
+ private function viewChangeHandler(event:Event):void
+ {
+ app.initialView.addEventListener("buttonClicked", buttonClickHandler);
+ app.initialView.addEventListener("listChanged", listChangedHandler);
+ app.initialView.addEventListener("transferClicked", transferClickHandler);
+ }
+
+ private function buttonClickHandler(event:Event):void
+ {
+ var sym:String = MyInitialView(app.initialView).symbol;
+ app.service.url = queryBegin + sym + queryEnd;
+ app.service.send();
+ app.service.addEventListener("complete", completeHandler);
+ }
+
+ private function completeHandler(event:Event):void
+ {
+ MyModel(app.model).labelText = app.collection.getItemAt(0) as String;
+ }
+
+ private function listChangedHandler(event:Event):void
+ {
+ MyModel(app.model).labelText = MyInitialView(app.initialView).symbol;
+ }
+
+ private function transferClickHandler(event:Event):void
+ {
+ MyModel(app.model).labelText = MyInitialView(app.initialView).inputText;
+ }
+
+ public function setDocument(document:Object, id:String = null):void
+ {
+ this.app = document as FlexJSTest;
+ app.addEventListener("viewChanged", viewChangeHandler);
+ }
+
+ }
+}
\ No newline at end of file
Propchange: flex/falcon/trunk/compiler.jx.tests/test-files/flexjs/projects/FlexJSTest/src/controllers/MyController.as
------------------------------------------------------------------------------
svn:eol-style = native
Added: flex/falcon/trunk/compiler.jx.tests/test-files/flexjs/projects/FlexJSTest/src/models/MyModel.as
URL: http://svn.apache.org/viewvc/flex/falcon/trunk/compiler.jx.tests/test-files/flexjs/projects/FlexJSTest/src/models/MyModel.as?rev=1451146&view=auto
==============================================================================
--- flex/falcon/trunk/compiler.jx.tests/test-files/flexjs/projects/FlexJSTest/src/models/MyModel.as (added)
+++ flex/falcon/trunk/compiler.jx.tests/test-files/flexjs/projects/FlexJSTest/src/models/MyModel.as Thu Feb 28 09:12:27 2013
@@ -0,0 +1,53 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// 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 models
+{
+ import flash.events.Event;
+ import flash.events.EventDispatcher;
+
+ public class MyModel extends EventDispatcher
+ {
+ public function MyModel()
+ {
+ }
+
+ private var _labelText:String;
+
+ public function get labelText():String
+ {
+ return _labelText;
+ }
+
+ public function set labelText(value:String):void
+ {
+ if (value != _labelText)
+ {
+ _labelText = value;
+ dispatchEvent(new Event("labelTextChanged"));
+ }
+ }
+
+ private var _strings:Array = ["AAPL", "ADBE", "GOOG", "MSFT", "YHOO"];
+ public function get strings():Array
+ {
+ return _strings;
+ }
+
+ }
+}
\ No newline at end of file
Propchange: flex/falcon/trunk/compiler.jx.tests/test-files/flexjs/projects/FlexJSTest/src/models/MyModel.as
------------------------------------------------------------------------------
svn:eol-style = native