You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ca...@apache.org on 2014/02/27 00:31:42 UTC

git commit: [flex-asjs] [refs/heads/develop] - formatting code with intellij

Repository: flex-asjs
Updated Branches:
  refs/heads/develop 5c53ff889 -> 4c84ed33d


formatting code with intellij


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/4c84ed33
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/4c84ed33
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/4c84ed33

Branch: refs/heads/develop
Commit: 4c84ed33dec7bb6cb2dd22055afb01ebd71615f9
Parents: 5c53ff8
Author: Carlos Rovira <ca...@apache.org>
Authored: Thu Feb 27 00:31:16 2014 +0100
Committer: Carlos Rovira <ca...@apache.org>
Committed: Thu Feb 27 00:31:16 2014 +0100

----------------------------------------------------------------------
 .../src/controller/TodoListController.as        | 46 +++++-----
 .../src/model/TodoListModel.as                  | 40 ++++-----
 .../src/renderer/TodoItemRenderer.as            | 92 +++++++++++---------
 .../src/view/TodoListView.mxml                  | 84 +++++++++---------
 4 files changed, 134 insertions(+), 128 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/4c84ed33/examples/TodoListSampleApp/src/controller/TodoListController.as
----------------------------------------------------------------------
diff --git a/examples/TodoListSampleApp/src/controller/TodoListController.as b/examples/TodoListSampleApp/src/controller/TodoListController.as
index a8550fc..9065224 100644
--- a/examples/TodoListSampleApp/src/controller/TodoListController.as
+++ b/examples/TodoListSampleApp/src/controller/TodoListController.as
@@ -17,29 +17,27 @@
 //
 ////////////////////////////////////////////////////////////////////////////////
 package controller {
+    import model.TodoListModel;
 
-	import org.apache.flex.core.Application;
-	import org.apache.flex.core.IDocument;
-	import org.apache.flex.events.Event;
-	
-	import model.TodoListModel;
-    	
-	public class TodoListController implements IDocument {
-		private var app:TodoListSampleApp;
-		private var model:TodoListModel;
-		
-		public function TodoListController(app:Application = null) {
-			if (app != null) {
-				app = app as TodoListSampleApp;
-			}
-		}
-		
-		/**
-		 * 
-		 */
-		public function setDocument(document:Object, id:String = null):void {
-			this.app = document as TodoListSampleApp;
-		}
-		
-	}
+    import org.apache.flex.core.Application;
+    import org.apache.flex.core.IDocument;
+
+    public class TodoListController implements IDocument {
+        private var app:TodoListSampleApp;
+        private var todoListModel:TodoListModel;
+
+        public function TodoListController(app:Application = null) {
+            if (app != null) {
+                app = app as TodoListSampleApp;
+            }
+        }
+
+        /**
+         *
+         */
+        public function setDocument(document:Object, id:String = null):void {
+            app = document as TodoListSampleApp;
+        }
+
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/4c84ed33/examples/TodoListSampleApp/src/model/TodoListModel.as
----------------------------------------------------------------------
diff --git a/examples/TodoListSampleApp/src/model/TodoListModel.as b/examples/TodoListSampleApp/src/model/TodoListModel.as
index 1b78a5e..04fb870 100644
--- a/examples/TodoListSampleApp/src/model/TodoListModel.as
+++ b/examples/TodoListSampleApp/src/model/TodoListModel.as
@@ -17,24 +17,24 @@
 //
 ////////////////////////////////////////////////////////////////////////////////
 package model {
-	import org.apache.flex.events.Event;
-	import org.apache.flex.events.EventDispatcher;
-	
-	public class TodoListModel extends EventDispatcher {
-		public function TodoListModel() {
-			super();
-		}
-		
-		private var _todos:Array = [
-			{title:"Get something", selected:true},
-			{title:"Do this", selected:true},
-			{title:"Do that", selected:false}
-		];
-		public function get todos():Array {
-			return _todos;
-		}
-		public function set todos(value:Array):void {
-			_todos = value;
-		}
-	}
+    import org.apache.flex.events.EventDispatcher;
+
+    public class TodoListModel extends EventDispatcher {
+        public function TodoListModel() {
+            super();
+        }
+
+        private var _todos:Array = [
+            {title: "Get something", selected: true},
+            {title: "Do this", selected: true},
+            {title: "Do that", selected: false}
+        ];
+        public function get todos():Array {
+            return _todos;
+        }
+
+        public function set todos(value:Array):void {
+            _todos = value;
+        }
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/4c84ed33/examples/TodoListSampleApp/src/renderer/TodoItemRenderer.as
----------------------------------------------------------------------
diff --git a/examples/TodoListSampleApp/src/renderer/TodoItemRenderer.as b/examples/TodoListSampleApp/src/renderer/TodoItemRenderer.as
index 82a0bfb..e60b830 100644
--- a/examples/TodoListSampleApp/src/renderer/TodoItemRenderer.as
+++ b/examples/TodoListSampleApp/src/renderer/TodoItemRenderer.as
@@ -16,46 +16,54 @@
 //  limitations under the License.
 //
 ////////////////////////////////////////////////////////////////////////////////
-package renderer {	
-	import org.apache.flex.html.staticControls.Label;
-	import org.apache.flex.html.staticControls.CheckBox;
-	import org.apache.flex.html.staticControls.supportClasses.DataItemRenderer;
-
-	public class TodoItemRenderer extends DataItemRenderer {
-		public function TodoItemRenderer() {
-			super();
-		}
-		
-		private var checkbox:CheckBox;
-		private var title:Label;
-		
-		override public function addedToParent():void {
-			super.addedToParent();
-			
-			checkbox = new CheckBox();
-			addElement(checkbox);
-			
-			title = new Label();
-			addElement(title);
-		}
-		
-		override public function set data(value:Object):void {
-			super.data = value;
-			
-			checkbox.selected = data.selected;
-			title.text = data.title;
-		}
-		
-		override public function adjustSize():void {
-			var cy:Number = this.height/2;
-			
-			checkbox.x = 10;
-			checkbox.y = cy;
-			
-			title.x = 60;
-			title.y = cy;
-			
-			updateRenderer();
-		}
-	}
+package renderer {
+    import org.apache.flex.html.staticControls.Button;
+    import org.apache.flex.html.staticControls.CheckBox;
+    import org.apache.flex.html.staticControls.Label;
+    import org.apache.flex.html.staticControls.supportClasses.DataItemRenderer;
+
+    public class TodoItemRenderer extends DataItemRenderer {
+        public function TodoItemRenderer() {
+            super();
+        }
+
+        private var checkbox:CheckBox;
+        private var title:Label;
+        private var removeButton:Button;
+
+        override public function addedToParent():void {
+            super.addedToParent();
+
+            checkbox = new CheckBox();
+            addElement(checkbox);
+
+            title = new Label();
+            addElement(title);
+
+            removeButton = new Button();
+            addElement(removeButton);
+        }
+
+        override public function set data(value:Object):void {
+            super.data = value;
+
+            checkbox.selected = data.selected;
+            title.text = data.title;
+        }
+
+        override public function adjustSize():void {
+            var cy:Number = this.height / 2;
+
+            checkbox.x = 10;
+            checkbox.y = cy;
+
+            title.x = 60;
+            title.y = cy;
+
+            removeButton.x = 300;
+            removeButton.y = cy
+
+            updateRenderer();
+        }
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/4c84ed33/examples/TodoListSampleApp/src/view/TodoListView.mxml
----------------------------------------------------------------------
diff --git a/examples/TodoListSampleApp/src/view/TodoListView.mxml b/examples/TodoListSampleApp/src/view/TodoListView.mxml
index e68c233..9d30b74 100644
--- a/examples/TodoListSampleApp/src/view/TodoListView.mxml
+++ b/examples/TodoListSampleApp/src/view/TodoListView.mxml
@@ -18,48 +18,48 @@ limitations under the License.
 
 -->
 <basic:ViewBase xmlns:fx="http://ns.adobe.com/mxml/2009"
-				xmlns:basic="library://ns.apache.org/flexjs/basic" >
-	<fx:Script>
+                xmlns:basic="library://ns.apache.org/flexjs/basic">
+    <fx:Script>
 		<![CDATA[
-			
-		]]>
+
+        ]]>
 	</fx:Script>
-	
-	<basic:Panel title="FlexJS TODO List" width="600">
-		<basic:beads>
-			<basic:NonVirtualVerticalLayout />
-		</basic:beads>
-		
-		<basic:TextInput width="300"/>
-		
-		<basic:List id="todoList" 
-					itemRenderer="renderer.TodoItemRenderer"
-					width="300" height="400">
-			<basic:beads>
-				<basic:ConstantBinding sourceID="applicationModel"
-				  					   sourcePropertyName="todos"
-									   destinationPropertyName="dataProvider"/>
-			</basic:beads>
-		</basic:List>
-		
-	</basic:Panel>
-	
-	<fx:Style>
-		@namespace basic "library://ns.apache.org/flexjs/basic";
-		@namespace renderer "renderer.*";
-		
-		/* use className="todoList" on the List element in place of itemRenderer if you want to specify
-		 * the itemRenderer in a style definition along with other settings.
-		 */
-		.todoList {
-			IDataProviderItemRendererMapper: ClassReference("org.apache.flex.html.staticControls.beads.DataItemRendererFactoryForArrayData");
-			IItemRenderer: ClassReference("renderer.TodoItemRenderer");
-		}
-		
-		renderer|TodoItemRenderer {
-			height: 40;
-			IBeadController: ClassReference("org.apache.flex.html.staticControls.beads.controllers.ItemRendererMouseController");
-		}		
-	</fx:Style>
-	
+
+    <basic:Panel title="FlexJS TODO List" width="600">
+        <basic:beads>
+            <basic:NonVirtualVerticalLayout/>
+        </basic:beads>
+
+        <basic:TextInput width="300"/>
+
+        <basic:List id="todoList"
+                    itemRenderer="renderer.TodoItemRenderer"
+                    width="300" height="400">
+            <basic:beads>
+                <basic:ConstantBinding sourceID="applicationModel"
+                                       sourcePropertyName="todos"
+                                       destinationPropertyName="dataProvider"/>
+            </basic:beads>
+        </basic:List>
+
+    </basic:Panel>
+
+    <fx:Style>
+        @namespace basic "library://ns.apache.org/flexjs/basic";
+        @namespace renderer "renderer.*";
+
+        /* use className="todoList" on the List element in place of itemRenderer if you want to specify
+         * the itemRenderer in a style definition along with other settings.
+         */
+        .todoList {
+            IDataProviderItemRendererMapper: ClassReference("org.apache.flex.html.staticControls.beads.DataItemRendererFactoryForArrayData");
+            IItemRenderer: ClassReference("renderer.TodoItemRenderer");
+        }
+
+        renderer|TodoItemRenderer {
+            height: 40;
+            IBeadController: ClassReference("org.apache.flex.html.staticControls.beads.controllers.ItemRendererMouseController");
+        }
+    </fx:Style>
+
 </basic:ViewBase>