http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/control/events/GetRulesetContentEvent.as ---------------------------------------------------------------------- diff --git a/FlexPMD/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/control/events/GetRulesetContentEvent.as b/FlexPMD/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/control/events/GetRulesetContentEvent.as deleted file mode 100644 index e9f20c1..0000000 --- a/FlexPMD/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/control/events/GetRulesetContentEvent.as +++ /dev/null @@ -1,56 +0,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. -// -//////////////////////////////////////////////////////////////////////////////// -package com.adobe.ac.pmd.control.events -{ - import com.adobe.ac.pmd.api.IGetRulesetContent; - import com.adobe.cairngorm.control.CairngormEvent; - - import flash.events.Event; - - public class GetRulesetContentEvent extends CairngormEvent - { - public static const EVENT_NAME : String = "ruleset.getContent"; - - private var _invoker : IGetRulesetContent; - private var _ref : String; - - public function GetRulesetContentEvent( invoker : IGetRulesetContent, ref : String ) - { - super( EVENT_NAME ); - - _ref = ref; - _invoker = invoker; - } - - public function get invoker() : IGetRulesetContent - { - return _invoker; - } - - public function get ref() : String - { - return _ref; - } - - override public function clone() : Event - { - return new GetRulesetContentEvent( _invoker, _ref ); - } - } -} \ No newline at end of file
http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/model/Property.as ---------------------------------------------------------------------- diff --git a/FlexPMD/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/model/Property.as b/FlexPMD/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/model/Property.as deleted file mode 100644 index 9e2f4d3..0000000 --- a/FlexPMD/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/model/Property.as +++ /dev/null @@ -1,35 +0,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. -// -//////////////////////////////////////////////////////////////////////////////// -package com.adobe.ac.pmd.model -{ - import com.adobe.ac.model.IDomainModel; - - import mx.collections.ArrayCollection; - import mx.collections.ListCollectionView; - - public class Property implements IDomainModel - { - public var name : String; - public var value : String; - - public function Property() - { - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/model/RootRuleset.as ---------------------------------------------------------------------- diff --git a/FlexPMD/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/model/RootRuleset.as b/FlexPMD/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/model/RootRuleset.as deleted file mode 100644 index cb41e7a..0000000 --- a/FlexPMD/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/model/RootRuleset.as +++ /dev/null @@ -1,103 +0,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. -// -//////////////////////////////////////////////////////////////////////////////// -package com.adobe.ac.pmd.model -{ - import com.adobe.ac.model.IDomainModel; - - import flash.events.Event; - import flash.events.EventDispatcher; - - import mx.collections.ArrayCollection; - import mx.collections.ListCollectionView; - import mx.events.CollectionEvent; - - public class RootRuleset extends EventDispatcher implements IDomainModel - { - public static const CUSTOM_RULESET_NAME : String = "Parameterized rules"; - private static const RULES_CHANGED : String = "rulesChange"; - public var name : String; - public var description : String; - [Bindable] - public var rulesets : ListCollectionView = new ArrayCollection(); - - private var _customRuleset : Ruleset = null; - - public function RootRuleset() - { - rulesets.addEventListener(CollectionEvent.COLLECTION_CHANGE, handleRulesetChange); - } - - - public function get customRuleset():Ruleset - { - return _customRuleset; - } - - public function addRegExpBasedRule( rule : Rule ) : void - { - if ( ! customRuleset ) - { - _customRuleset = new Ruleset(); - _customRuleset.name = CUSTOM_RULESET_NAME; - rulesets.addItem( _customRuleset ); - } - - rule.ruleset = _customRuleset; - _customRuleset.rules.addItem( rule ); - rulesChanged(); - } - - private function handleRulesetChange( event : CollectionEvent ) : void - { - for each ( var ruleset : Ruleset in rulesets ) - { - ruleset.rules.addEventListener(CollectionEvent.COLLECTION_CHANGE, handleRulesChange); - } - } - - private function handleRulesChange( event : CollectionEvent ) : void - { - rulesChanged(); - } - - public function rulesChanged() : void - { - dispatchEvent( new Event( RULES_CHANGED ) ); - } - - [Bindable("rulesChange")] - public function get rulesNb() : Number - { - var result : Number = 0; - - for each ( var ruleset : Ruleset in rulesets ) - { - for each ( var rule : Rule in ruleset.rules ) - { - if ( !rule.deleted ) - { - result++; - } - } - } - - return result; - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/model/Rule.as ---------------------------------------------------------------------- diff --git a/FlexPMD/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/model/Rule.as b/FlexPMD/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/model/Rule.as deleted file mode 100644 index 9fe5509..0000000 --- a/FlexPMD/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/model/Rule.as +++ /dev/null @@ -1,92 +0,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. -// -//////////////////////////////////////////////////////////////////////////////// -package com.adobe.ac.pmd.model -{ - import com.adobe.ac.model.IDomainModel; - - import flash.events.Event; - import flash.events.EventDispatcher; - - import mx.collections.ArrayCollection; - import mx.collections.ListCollectionView; - - public class Rule extends EventDispatcher implements IDomainModel // NO PMD BindableClass TooManyFields - { - public static const NAME_CHANGE : String = "nameChange"; - public static const DELETED_CHANGE : String = "deleteChange"; - - public var since : String; - [Bindable] - public var message : String; - [Bindable] - public var examples : String; - [Bindable] - public var description : String; - [Bindable] - public var properties : ListCollectionView = new ArrayCollection(); - [Bindable] - public var priority : ViolationPriority; - [Bindable] - public var ruleset : Ruleset; - - private var _deleted : Boolean = false; - private var _name : String; - - public function Rule() - { - ruleset = new Ruleset(); - } - - [Bindable( "nameChange" )] - public function get name() : String - { - return _name; - } - - public function set name( value : String ) : void - { - _name = value; - dispatchEvent( new Event( NAME_CHANGE ) ); - } - - [Bindable( "nameChange" )] - public function get shortName() : String - { - return name.substr( name.lastIndexOf( "." ) + 1 ); - } - - [Bindable( "deleteChange" )] - public function get deleted() : Boolean - { - return _deleted; - } - - public function remove() : void - { - _deleted = true; - dispatchEvent( new Event( DELETED_CHANGE ) ); - } - - public function unDelete() : void - { - _deleted = false; - dispatchEvent( new Event( DELETED_CHANGE ) ); - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/model/Ruleset.as ---------------------------------------------------------------------- diff --git a/FlexPMD/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/model/Ruleset.as b/FlexPMD/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/model/Ruleset.as deleted file mode 100644 index 45afcfa..0000000 --- a/FlexPMD/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/model/Ruleset.as +++ /dev/null @@ -1,63 +0,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. -// -//////////////////////////////////////////////////////////////////////////////// -package com.adobe.ac.pmd.model -{ - import com.adobe.ac.model.IDomainModel; - import com.adobe.ac.pmd.api.IGetRulesetContent; - import com.adobe.ac.pmd.control.events.GetRulesetContentEvent; - import com.adobe.ac.pmd.model.events.RulesetReceivedEvent; - - import flash.events.EventDispatcher; - - import mx.collections.ArrayCollection; - import mx.collections.ListCollectionView; - import mx.events.CollectionEvent; - - [Event( name="rulesetReceived",type="com.adobe.ac.pmd.model.events.RulesetReceivedEvent" )] - public class Ruleset extends EventDispatcher implements IDomainModel, IGetRulesetContent // NO PMD BindableClass - { - private static const RULES_CHANGED : String = "rulesChange"; - [Bindable] - public var isRef : Boolean; - [Bindable] - public var name : String; - [Bindable] - public var description : String; - [Bindable] - public var rules : ListCollectionView = new ArrayCollection(); - - public function Ruleset() - { - } - - public function getRulesetContent( ref : String ) : void - { - new GetRulesetContentEvent( this, ref ).dispatch(); - } - - public function onReceiveRulesetContent( ruleset : Ruleset ) : void - { - name = ruleset.name; - rules = ruleset.rules; - isRef = ruleset.isRef; - description = ruleset.description; - dispatchEvent( new RulesetReceivedEvent( this ) ); - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/model/ViolationPriority.as ---------------------------------------------------------------------- diff --git a/FlexPMD/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/model/ViolationPriority.as b/FlexPMD/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/model/ViolationPriority.as deleted file mode 100644 index 61fa224..0000000 --- a/FlexPMD/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/model/ViolationPriority.as +++ /dev/null @@ -1,82 +0,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. -// -//////////////////////////////////////////////////////////////////////////////// -package com.adobe.ac.pmd.model -{ - import flash.events.Event; - import flash.events.EventDispatcher; - - public class ViolationPriority extends EventDispatcher - { - public static const ERROR : ViolationPriority = new ViolationPriority( 1, "Error" ); - public static const WARNING : ViolationPriority = new ViolationPriority( 3, "Warning" ); - public static const INFO : ViolationPriority = new ViolationPriority( 5, "Info" ); - - private var _level : int; - private var _name : String; - - public function ViolationPriority( level : int, name : String ) - { - _level = level; - _name = name; - } - - public static function create( level : int ) : ViolationPriority - { - var result : ViolationPriority = null; - - switch( level ) - { - case 1: - result = ERROR; - break; - case 3: - result = WARNING; - break; - case 5: - result = INFO; - break; - default: - throw new Error( "Unknown violation level (" + level + ")" ); - } - return result; - } - - public static function get values() : Array - { - return[ ERROR, WARNING, INFO ]; - } - - [Bindable( "unused" )] - public function get level() : int - { - return _level; - } - - [Bindable( "initialized" )] - public function get name() : String - { - return _name; - } - - override public function toString() : String - { - return _name; - } - } -} http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/model/events/RulesetReceivedEvent.as ---------------------------------------------------------------------- diff --git a/FlexPMD/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/model/events/RulesetReceivedEvent.as b/FlexPMD/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/model/events/RulesetReceivedEvent.as deleted file mode 100644 index aeff332..0000000 --- a/FlexPMD/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/model/events/RulesetReceivedEvent.as +++ /dev/null @@ -1,48 +0,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. -// -//////////////////////////////////////////////////////////////////////////////// -package com.adobe.ac.pmd.model.events -{ - import com.adobe.ac.pmd.model.Ruleset; - - import flash.events.Event; - - public class RulesetReceivedEvent extends Event - { - public static const EVENT_NAME : String = "rulesetReceived"; - - private var _ruleset : Ruleset; - - public function RulesetReceivedEvent( ruleset : Ruleset ) - { - super( EVENT_NAME ); - - _ruleset = ruleset; - } - - public function get ruleset() : Ruleset - { - return _ruleset; - } - - override public function clone() : Event - { - return new RulesetReceivedEvent( ruleset ); - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/view/Title.mxml ---------------------------------------------------------------------- diff --git a/FlexPMD/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/view/Title.mxml b/FlexPMD/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/view/Title.mxml deleted file mode 100644 index caea7ad..0000000 --- a/FlexPMD/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/view/Title.mxml +++ /dev/null @@ -1,36 +0,0 @@ -<?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. - ---> -<mx:Label xmlns:mx="http://www.adobe.com/2006/mxml" - styleName="h1" - > - - <mx:filters> - - <flash.filters:DropShadowFilter xmlns:flash.filters="flash.filters.*" - color="0xffffff" - angle="90" - blurX="0" - blurY="0" - distance="1" - /> - - </mx:filters> - -</mx:Label> http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-flex-lib/src/main/resources/assets/cancelledIcon.png ---------------------------------------------------------------------- diff --git a/FlexPMD/flex-pmd-flex-lib/src/main/resources/assets/cancelledIcon.png b/FlexPMD/flex-pmd-flex-lib/src/main/resources/assets/cancelledIcon.png deleted file mode 100644 index 9bca099..0000000 Binary files a/FlexPMD/flex-pmd-flex-lib/src/main/resources/assets/cancelledIcon.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-flex-lib/src/main/resources/assets/export.png ---------------------------------------------------------------------- diff --git a/FlexPMD/flex-pmd-flex-lib/src/main/resources/assets/export.png b/FlexPMD/flex-pmd-flex-lib/src/main/resources/assets/export.png deleted file mode 100644 index fd4bfcd..0000000 Binary files a/FlexPMD/flex-pmd-flex-lib/src/main/resources/assets/export.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-flex-lib/src/main/resources/assets/icon_tool_trash.png ---------------------------------------------------------------------- diff --git a/FlexPMD/flex-pmd-flex-lib/src/main/resources/assets/icon_tool_trash.png b/FlexPMD/flex-pmd-flex-lib/src/main/resources/assets/icon_tool_trash.png deleted file mode 100644 index b4b470d..0000000 Binary files a/FlexPMD/flex-pmd-flex-lib/src/main/resources/assets/icon_tool_trash.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-flex-lib/src/main/resources/assets/icon_tool_trash2.png ---------------------------------------------------------------------- diff --git a/FlexPMD/flex-pmd-flex-lib/src/main/resources/assets/icon_tool_trash2.png b/FlexPMD/flex-pmd-flex-lib/src/main/resources/assets/icon_tool_trash2.png deleted file mode 100644 index 282a037..0000000 Binary files a/FlexPMD/flex-pmd-flex-lib/src/main/resources/assets/icon_tool_trash2.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-flex-lib/src/main/resources/assets/todoLogo.png ---------------------------------------------------------------------- diff --git a/FlexPMD/flex-pmd-flex-lib/src/main/resources/assets/todoLogo.png b/FlexPMD/flex-pmd-flex-lib/src/main/resources/assets/todoLogo.png deleted file mode 100644 index a314b8d..0000000 Binary files a/FlexPMD/flex-pmd-flex-lib/src/main/resources/assets/todoLogo.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-flex-lib/src/main/resources/assets/todoLogo_big.png ---------------------------------------------------------------------- diff --git a/FlexPMD/flex-pmd-flex-lib/src/main/resources/assets/todoLogo_big.png b/FlexPMD/flex-pmd-flex-lib/src/main/resources/assets/todoLogo_big.png deleted file mode 100644 index bb89f68..0000000 Binary files a/FlexPMD/flex-pmd-flex-lib/src/main/resources/assets/todoLogo_big.png and /dev/null differ http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-flex-lib/src/test/flex/AllTests.as ---------------------------------------------------------------------- diff --git a/FlexPMD/flex-pmd-flex-lib/src/test/flex/AllTests.as b/FlexPMD/flex-pmd-flex-lib/src/test/flex/AllTests.as deleted file mode 100644 index 681ca74..0000000 --- a/FlexPMD/flex-pmd-flex-lib/src/test/flex/AllTests.as +++ /dev/null @@ -1,36 +0,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. -// -//////////////////////////////////////////////////////////////////////////////// -package -{ - import com.adobe.ac.pmd.model.RuleTest; - import com.adobe.ac.pmd.model.RulesetTest; - - import flexunit.framework.TestSuite; - - public class AllTests extends TestSuite - { - public function AllTests() - { - super(); - - addTestSuite( RulesetTest ); - addTestSuite( RuleTest ); - } - } -} http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-flex-lib/src/test/flex/com/adobe/ac/pmd/model/RuleTest.as ---------------------------------------------------------------------- diff --git a/FlexPMD/flex-pmd-flex-lib/src/test/flex/com/adobe/ac/pmd/model/RuleTest.as b/FlexPMD/flex-pmd-flex-lib/src/test/flex/com/adobe/ac/pmd/model/RuleTest.as deleted file mode 100644 index d4d4a6b..0000000 --- a/FlexPMD/flex-pmd-flex-lib/src/test/flex/com/adobe/ac/pmd/model/RuleTest.as +++ /dev/null @@ -1,61 +0,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. -// -//////////////////////////////////////////////////////////////////////////////// - package com.adobe.ac.pmd.model -{ - import flexunit.framework.EventfulTestCase; - - public class RuleTest extends EventfulTestCase - { - private var rule : Rule; - - public function RuleTest() - { - } - - override public function setUp():void - { - rule = new Rule(); - } - - public function testName() : void - { - listenForEvent( rule, Rule.NAME_CHANGE ); - - rule.name = "com.adobe.ac.MyRule"; - - assertEvents(); - assertEquals( "MyRule", rule.shortName ); - - rule.name = "MyRule"; - assertEquals( "MyRule", rule.shortName ); - } - - public function testRemove() : void - { - var parentRuleset : Ruleset = new Ruleset(); - - rule.ruleset = parentRuleset; - parentRuleset.rules.addItem( rule ); - rule.remove(); - - assertEquals( 1, parentRuleset.rules.length ); - assertTrue( Rule( parentRuleset.rules.getItemAt( 0 ) ).deleted ); - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-flex-lib/src/test/flex/com/adobe/ac/pmd/model/RulesetTest.as ---------------------------------------------------------------------- diff --git a/FlexPMD/flex-pmd-flex-lib/src/test/flex/com/adobe/ac/pmd/model/RulesetTest.as b/FlexPMD/flex-pmd-flex-lib/src/test/flex/com/adobe/ac/pmd/model/RulesetTest.as deleted file mode 100644 index f70d229..0000000 --- a/FlexPMD/flex-pmd-flex-lib/src/test/flex/com/adobe/ac/pmd/model/RulesetTest.as +++ /dev/null @@ -1,72 +0,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. -// -//////////////////////////////////////////////////////////////////////////////// - package com.adobe.ac.pmd.model -{ - import com.adobe.ac.pmd.control.events.GetRulesetContentEvent; - import com.adobe.ac.pmd.model.events.RulesetReceivedEvent; - - import flexunit.framework.CairngormEventSource; - import flexunit.framework.EventfulTestCase; - - import mx.collections.ArrayCollection; - - public class RulesetTest extends EventfulTestCase - { - private var model : Ruleset; - - public function RulesetTest() - { - } - - override public function setUp():void - { - model = new Ruleset(); - } - - public function testGetRulesetContent() : void - { - listenForEvent( CairngormEventSource.instance, GetRulesetContentEvent.EVENT_NAME ); - - model.getRulesetContent( "ref" ); - - assertEvents(); - assertEquals( model, GetRulesetContentEvent( lastDispatchedExpectedEvent ).invoker ); - assertEquals( "ref", GetRulesetContentEvent( lastDispatchedExpectedEvent ).ref ); - } - - public function testOnReceiveRulesetContent() : void - { - var receivedRuleset : Ruleset = new Ruleset(); - - listenForEvent( model, RulesetReceivedEvent.EVENT_NAME ); - - receivedRuleset.name = "name"; - receivedRuleset.description = "description"; - receivedRuleset.rules = new ArrayCollection(); - - model.onReceiveRulesetContent( receivedRuleset ); - - assertEvents(); - assertEquals( model, RulesetReceivedEvent( lastDispatchedExpectedEvent ).ruleset ); - assertEquals( receivedRuleset.name, model.name ); - assertEquals( receivedRuleset.description, model.description ); - assertEquals( receivedRuleset.rules, model.rules ); - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-flex-parent/pom.xml ---------------------------------------------------------------------- diff --git a/FlexPMD/flex-pmd-flex-parent/pom.xml b/FlexPMD/flex-pmd-flex-parent/pom.xml deleted file mode 100644 index 6ff8aca..0000000 --- a/FlexPMD/flex-pmd-flex-parent/pom.xml +++ /dev/null @@ -1,125 +0,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 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> - <groupId>com.adobe.ac</groupId> - <artifactId>flex-pmd-flex-parent</artifactId> - <packaging>pom</packaging> - <name>Adobe Flex PMD Flex Parent</name> - - <parent> - <groupId>com.adobe.ac</groupId> - <artifactId>flex-pmd</artifactId> - <version>1.3-SNAPSHOT</version> - <relativePath>../flex-pmd-parent/pom.xml</relativePath> - </parent> - - <properties> - - <flex.version>3.2.0.3958</flex.version> - <flash-player.version>10</flash-player.version> - <flexunit.version>0.9</flexunit.version> - <event-source.version>1.1</event-source.version> - <flexunit-optional.version>0.85</flexunit-optional.version> - <event-source.version>1.1</event-source.version> - <cairngorm.version>2.2.1</cairngorm.version> - <flexunit-theme.version>1.0</flexunit-theme.version> - - </properties> - - <modules> - <module>../flex-pmd-ruleset-creator</module> - <module>../flex-pmd-violations-viewer</module> - <module>../flex-pmd-flex-lib</module> - <module>../flexunit-theme</module> - </modules> - - <build> - <sourceDirectory>.</sourceDirectory> - <plugins> - - <plugin> - <groupId>${project.groupId}</groupId> - <artifactId>flex-pmd-maven-plugin</artifactId> - <version>${project.version}</version> - <executions> - <execution> - <phase>package</phase> - <goals> - <goal>check</goal> - </goals> - </execution> - </executions> - </plugin> - - <plugin> - <groupId>${project.groupId}</groupId> - <artifactId>flex-pmd-cpd-maven-plugin</artifactId> - <version>${project.version}</version> - <executions> - <execution> - <phase>package</phase> - <goals> - <goal>check</goal> - </goals> - </execution> - </executions> - </plugin> - - <plugin> - <groupId>${project.groupId}</groupId> - <artifactId>flex-pmd-metrics-maven-plugin</artifactId> - <version>${project.version}</version> - <executions> - <execution> - <phase>package</phase> - <goals> - <goal>check</goal> - </goals> - </execution> - </executions> - </plugin> - - </plugins> - </build> - - <reporting> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-report-plugin</artifactId> - <version>2.4.3</version> - <configuration> - <reportsDirectory>surefire-reports</reportsDirectory> - </configuration> - </plugin> - - <plugin> - <groupId>${project.groupId}</groupId> - <artifactId>flex-pmd-maven-plugin</artifactId> - <version>${project.parent.version}</version> - <configuration> - <failOnError>true</failOnError> - </configuration> - </plugin> - - </plugins> - </reporting> - -</project> http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/.checkstyle ---------------------------------------------------------------------- diff --git a/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/.checkstyle b/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/.checkstyle new file mode 100644 index 0000000..a34f4bb --- /dev/null +++ b/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/.checkstyle @@ -0,0 +1,24 @@ +<?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. + +--> +<fileset-config file-format-version="1.2.0" simple-config="true"> + <fileset name="all" enabled="true" check-config-name="Ac" local="false"> + <file-match-pattern match-pattern="." include-pattern="true"/> + </fileset> +</fileset-config> http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/.externalToolBuilders/org.maven.ide.eclipse.maven2Builder.launch ---------------------------------------------------------------------- diff --git a/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/.externalToolBuilders/org.maven.ide.eclipse.maven2Builder.launch b/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/.externalToolBuilders/org.maven.ide.eclipse.maven2Builder.launch new file mode 100644 index 0000000..850ec2f --- /dev/null +++ b/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/.externalToolBuilders/org.maven.ide.eclipse.maven2Builder.launch @@ -0,0 +1,25 @@ +<?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. + +--> +<launchConfiguration type="org.maven.ide.eclipse.Maven2BuilderConfigurationType"> +<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_BUILDER_ENABLED" value="false"/> +<stringAttribute key="org.eclipse.ui.externaltools.ATTR_DISABLED_BUILDER" value="org.maven.ide.eclipse.maven2Builder"/> +<mapAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS"/> +<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/> +</launchConfiguration> http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/pom.xml ---------------------------------------------------------------------- diff --git a/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/pom.xml b/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/pom.xml new file mode 100644 index 0000000..d89e9b2 --- /dev/null +++ b/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/pom.xml @@ -0,0 +1,196 @@ +<!-- + +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> + <artifactId>flex-pmd-flex</artifactId> + <groupId>org.apache.flex.pmd</groupId> + <version>1.3-SNAPSHOT</version> + </parent> + + <artifactId>flex-pmd-flex-lib</artifactId> + <packaging>swc</packaging> + + <name>Adobe Flex PMD Flex lib</name> + <description>Adobe Flex PMD Flex library containing shared classes</description> + + <dependencies> + + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>flex-pmd-ruleset</artifactId> + <version>${project.version}</version> + </dependency> + + <dependency> + <groupId>com.adobe.cairngorm</groupId> + <artifactId>cairngorm</artifactId> + <version>${cairngorm.version}</version> + <type>swc</type> + </dependency> + + <dependency> + <groupId>com.adobe.cairngorm</groupId> + <artifactId>event-source</artifactId> + <version>${event-source.version}</version> + <type>swc</type> + <scope>test</scope> + </dependency> + + <!-- flex sdk dependencies --> + + <dependency> + <groupId>org.apache.flex</groupId> + <artifactId>framework</artifactId> + <version>${flex.version}</version> + <type>pom</type> + </dependency> + + <dependency> + <groupId>com.adobe.flash.framework</groupId> + <artifactId>playerglobal</artifactId> + <version>${flash-player.version}</version> + <type>swc</type> + </dependency> + + <dependency> + <groupId>org.apache.flex.framework.themes</groupId> + <artifactId>spark</artifactId> + <version>${flex.version}</version> + <type>swc</type> + <scope>theme</scope> + </dependency> + + <dependency> + <groupId>org.apache.flex.flexunit</groupId> + <artifactId>flexunit-flex</artifactId> + <version>${flexunit.version}</version> + <type>swc</type> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>com.adobe.flexunit</groupId> + <artifactId>flexunit</artifactId> + <version>1.0.0</version> + <type>swc</type> + <scope>test</scope> + </dependency> + + </dependencies> + + <build> + <sourceDirectory>src/main/flex</sourceDirectory> + <testSourceDirectory>src/test/flex</testSourceDirectory> + <resources> + <resource> + <directory>src/main/resources</directory> + </resource> + </resources> + <testResources> + <testResource> + <directory>src/test/resources</directory> + </testResource> + </testResources> + + <plugins> + + <plugin> + <artifactId>maven-antrun-plugin</artifactId> + <version>${ant-run-plugin.version}</version> + <executions> + <execution> + <id>copy-version-as</id> + <phase>process-resources</phase> + <configuration> + <tasks> + <tstamp> + <format property="last.updated.date" pattern="yyyy-MM-dd" /> + <format property="last.updated.time" pattern="HH:mm:ss" /> + </tstamp> + <echo message="Generating Version.as..." /> + <echo file="${basedir}/src/main/flex/Version.as" append="false" message="package" /> + <echo file="${basedir}/src/main/flex/Version.as" append="true" message="{" /> + <echo file="${basedir}/src/main/flex/Version.as" append="true" message=" public class Version" /> + <echo file="${basedir}/src/main/flex/Version.as" append="true" message=" {" /> + <echo file="${basedir}/src/main/flex/Version.as" append="true" message=" public static const BUILD_NUMBER : String = '${project.version}';" /> + <echo file="${basedir}/src/main/flex/Version.as" append="true" message=" public static const BUILD_TIME : String = '${last.updated.time}';" /> + <echo file="${basedir}/src/main/flex/Version.as" append="true" message=" public static const BUILD_DATE : String = '${last.updated.date}';" /> + <echo file="${basedir}/src/main/flex/Version.as" append="true" message=" }" /> + <echo file="${basedir}/src/main/flex/Version.as" append="true" message="}" /> + </tasks> + </configuration> + <goals> + <goal>run</goal> + </goals> + </execution> + </executions> + </plugin> + + <plugin> + <groupId>net.flexmojos.oss</groupId> + <artifactId>flexmojos-maven-plugin</artifactId> + <version>${flex-mojos-plugin.version}</version> + <extensions>true</extensions> + <configuration> + <targetPlayer>${flash-player.version}.0.0</targetPlayer> + </configuration> + <dependencies> + <!-- This handles a bug in maven which causes problems with flex resources --> + <dependency> + <groupId>net.flexmojos.oss</groupId> + <artifactId>flexmojos-threadlocaltoolkit-wrapper</artifactId> + <version>${flex-mojos-plugin.version}</version> + </dependency> + <!-- Without this FM will use the compiler configured in its + master pom, which will result in version conflicts --> + <dependency> + <groupId>org.apache.flex</groupId> + <artifactId>compiler</artifactId> + <version>${flex.version}</version> + <type>pom</type> + </dependency> + </dependencies> + </plugin> + </plugins> + </build> + + <reporting> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-report-plugin</artifactId> + <configuration> + <reportsDirectory>surefire-reports</reportsDirectory> + </configuration> + </plugin> + + <plugin> + <groupId>${project.groupId}</groupId> + <artifactId>flex-pmd-maven-plugin</artifactId> + <version>${project.parent.version}</version> + <configuration> + <failOnError>true</failOnError> + </configuration> + </plugin> + </plugins> + </reporting> + +</project> http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/flex/Version.as ---------------------------------------------------------------------- diff --git a/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/flex/Version.as b/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/flex/Version.as new file mode 100644 index 0000000..7b19419 --- /dev/null +++ b/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/flex/Version.as @@ -0,0 +1 @@ +package{ public class Version { public static const BUILD_NUMBER : String = '1.3-SNAPSHOT'; public static const BUILD_TIME : String = '00:38:25'; public static const BUILD_DATE : String = '2014-08-27'; }} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/model/IDomainModel.as ---------------------------------------------------------------------- diff --git a/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/model/IDomainModel.as b/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/model/IDomainModel.as new file mode 100644 index 0000000..3df7ae6 --- /dev/null +++ b/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/model/IDomainModel.as @@ -0,0 +1,26 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 com.adobe.ac.model +{ + + public interface IDomainModel + { + // Marker interface for Domain Model + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/model/IPresentationModel.as ---------------------------------------------------------------------- diff --git a/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/model/IPresentationModel.as b/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/model/IPresentationModel.as new file mode 100644 index 0000000..3f91f4e --- /dev/null +++ b/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/model/IPresentationModel.as @@ -0,0 +1,26 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 com.adobe.ac.model +{ + + public interface IPresentationModel + { + // Marker interface for Presentation Model + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/api/IGetRulesetContent.as ---------------------------------------------------------------------- diff --git a/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/api/IGetRulesetContent.as b/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/api/IGetRulesetContent.as new file mode 100644 index 0000000..1e2d5d1 --- /dev/null +++ b/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/api/IGetRulesetContent.as @@ -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. +// +//////////////////////////////////////////////////////////////////////////////// +package com.adobe.ac.pmd.api +{ + import com.adobe.ac.pmd.model.Ruleset; + + public interface IGetRulesetContent + { + function getRulesetContent( ref : String ) : void; + function onReceiveRulesetContent( ruleset : Ruleset ) : void; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/control/events/GetRulesetContentEvent.as ---------------------------------------------------------------------- diff --git a/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/control/events/GetRulesetContentEvent.as b/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/control/events/GetRulesetContentEvent.as new file mode 100644 index 0000000..e9f20c1 --- /dev/null +++ b/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/control/events/GetRulesetContentEvent.as @@ -0,0 +1,56 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 com.adobe.ac.pmd.control.events +{ + import com.adobe.ac.pmd.api.IGetRulesetContent; + import com.adobe.cairngorm.control.CairngormEvent; + + import flash.events.Event; + + public class GetRulesetContentEvent extends CairngormEvent + { + public static const EVENT_NAME : String = "ruleset.getContent"; + + private var _invoker : IGetRulesetContent; + private var _ref : String; + + public function GetRulesetContentEvent( invoker : IGetRulesetContent, ref : String ) + { + super( EVENT_NAME ); + + _ref = ref; + _invoker = invoker; + } + + public function get invoker() : IGetRulesetContent + { + return _invoker; + } + + public function get ref() : String + { + return _ref; + } + + override public function clone() : Event + { + return new GetRulesetContentEvent( _invoker, _ref ); + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/model/Property.as ---------------------------------------------------------------------- diff --git a/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/model/Property.as b/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/model/Property.as new file mode 100644 index 0000000..9e2f4d3 --- /dev/null +++ b/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/model/Property.as @@ -0,0 +1,35 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 com.adobe.ac.pmd.model +{ + import com.adobe.ac.model.IDomainModel; + + import mx.collections.ArrayCollection; + import mx.collections.ListCollectionView; + + public class Property implements IDomainModel + { + public var name : String; + public var value : String; + + public function Property() + { + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/model/RootRuleset.as ---------------------------------------------------------------------- diff --git a/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/model/RootRuleset.as b/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/model/RootRuleset.as new file mode 100644 index 0000000..cb41e7a --- /dev/null +++ b/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/model/RootRuleset.as @@ -0,0 +1,103 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 com.adobe.ac.pmd.model +{ + import com.adobe.ac.model.IDomainModel; + + import flash.events.Event; + import flash.events.EventDispatcher; + + import mx.collections.ArrayCollection; + import mx.collections.ListCollectionView; + import mx.events.CollectionEvent; + + public class RootRuleset extends EventDispatcher implements IDomainModel + { + public static const CUSTOM_RULESET_NAME : String = "Parameterized rules"; + private static const RULES_CHANGED : String = "rulesChange"; + public var name : String; + public var description : String; + [Bindable] + public var rulesets : ListCollectionView = new ArrayCollection(); + + private var _customRuleset : Ruleset = null; + + public function RootRuleset() + { + rulesets.addEventListener(CollectionEvent.COLLECTION_CHANGE, handleRulesetChange); + } + + + public function get customRuleset():Ruleset + { + return _customRuleset; + } + + public function addRegExpBasedRule( rule : Rule ) : void + { + if ( ! customRuleset ) + { + _customRuleset = new Ruleset(); + _customRuleset.name = CUSTOM_RULESET_NAME; + rulesets.addItem( _customRuleset ); + } + + rule.ruleset = _customRuleset; + _customRuleset.rules.addItem( rule ); + rulesChanged(); + } + + private function handleRulesetChange( event : CollectionEvent ) : void + { + for each ( var ruleset : Ruleset in rulesets ) + { + ruleset.rules.addEventListener(CollectionEvent.COLLECTION_CHANGE, handleRulesChange); + } + } + + private function handleRulesChange( event : CollectionEvent ) : void + { + rulesChanged(); + } + + public function rulesChanged() : void + { + dispatchEvent( new Event( RULES_CHANGED ) ); + } + + [Bindable("rulesChange")] + public function get rulesNb() : Number + { + var result : Number = 0; + + for each ( var ruleset : Ruleset in rulesets ) + { + for each ( var rule : Rule in ruleset.rules ) + { + if ( !rule.deleted ) + { + result++; + } + } + } + + return result; + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/model/Rule.as ---------------------------------------------------------------------- diff --git a/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/model/Rule.as b/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/model/Rule.as new file mode 100644 index 0000000..9fe5509 --- /dev/null +++ b/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/model/Rule.as @@ -0,0 +1,92 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 com.adobe.ac.pmd.model +{ + import com.adobe.ac.model.IDomainModel; + + import flash.events.Event; + import flash.events.EventDispatcher; + + import mx.collections.ArrayCollection; + import mx.collections.ListCollectionView; + + public class Rule extends EventDispatcher implements IDomainModel // NO PMD BindableClass TooManyFields + { + public static const NAME_CHANGE : String = "nameChange"; + public static const DELETED_CHANGE : String = "deleteChange"; + + public var since : String; + [Bindable] + public var message : String; + [Bindable] + public var examples : String; + [Bindable] + public var description : String; + [Bindable] + public var properties : ListCollectionView = new ArrayCollection(); + [Bindable] + public var priority : ViolationPriority; + [Bindable] + public var ruleset : Ruleset; + + private var _deleted : Boolean = false; + private var _name : String; + + public function Rule() + { + ruleset = new Ruleset(); + } + + [Bindable( "nameChange" )] + public function get name() : String + { + return _name; + } + + public function set name( value : String ) : void + { + _name = value; + dispatchEvent( new Event( NAME_CHANGE ) ); + } + + [Bindable( "nameChange" )] + public function get shortName() : String + { + return name.substr( name.lastIndexOf( "." ) + 1 ); + } + + [Bindable( "deleteChange" )] + public function get deleted() : Boolean + { + return _deleted; + } + + public function remove() : void + { + _deleted = true; + dispatchEvent( new Event( DELETED_CHANGE ) ); + } + + public function unDelete() : void + { + _deleted = false; + dispatchEvent( new Event( DELETED_CHANGE ) ); + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/model/Ruleset.as ---------------------------------------------------------------------- diff --git a/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/model/Ruleset.as b/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/model/Ruleset.as new file mode 100644 index 0000000..45afcfa --- /dev/null +++ b/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/model/Ruleset.as @@ -0,0 +1,63 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 com.adobe.ac.pmd.model +{ + import com.adobe.ac.model.IDomainModel; + import com.adobe.ac.pmd.api.IGetRulesetContent; + import com.adobe.ac.pmd.control.events.GetRulesetContentEvent; + import com.adobe.ac.pmd.model.events.RulesetReceivedEvent; + + import flash.events.EventDispatcher; + + import mx.collections.ArrayCollection; + import mx.collections.ListCollectionView; + import mx.events.CollectionEvent; + + [Event( name="rulesetReceived",type="com.adobe.ac.pmd.model.events.RulesetReceivedEvent" )] + public class Ruleset extends EventDispatcher implements IDomainModel, IGetRulesetContent // NO PMD BindableClass + { + private static const RULES_CHANGED : String = "rulesChange"; + [Bindable] + public var isRef : Boolean; + [Bindable] + public var name : String; + [Bindable] + public var description : String; + [Bindable] + public var rules : ListCollectionView = new ArrayCollection(); + + public function Ruleset() + { + } + + public function getRulesetContent( ref : String ) : void + { + new GetRulesetContentEvent( this, ref ).dispatch(); + } + + public function onReceiveRulesetContent( ruleset : Ruleset ) : void + { + name = ruleset.name; + rules = ruleset.rules; + isRef = ruleset.isRef; + description = ruleset.description; + dispatchEvent( new RulesetReceivedEvent( this ) ); + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/model/ViolationPriority.as ---------------------------------------------------------------------- diff --git a/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/model/ViolationPriority.as b/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/model/ViolationPriority.as new file mode 100644 index 0000000..61fa224 --- /dev/null +++ b/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/model/ViolationPriority.as @@ -0,0 +1,82 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 com.adobe.ac.pmd.model +{ + import flash.events.Event; + import flash.events.EventDispatcher; + + public class ViolationPriority extends EventDispatcher + { + public static const ERROR : ViolationPriority = new ViolationPriority( 1, "Error" ); + public static const WARNING : ViolationPriority = new ViolationPriority( 3, "Warning" ); + public static const INFO : ViolationPriority = new ViolationPriority( 5, "Info" ); + + private var _level : int; + private var _name : String; + + public function ViolationPriority( level : int, name : String ) + { + _level = level; + _name = name; + } + + public static function create( level : int ) : ViolationPriority + { + var result : ViolationPriority = null; + + switch( level ) + { + case 1: + result = ERROR; + break; + case 3: + result = WARNING; + break; + case 5: + result = INFO; + break; + default: + throw new Error( "Unknown violation level (" + level + ")" ); + } + return result; + } + + public static function get values() : Array + { + return[ ERROR, WARNING, INFO ]; + } + + [Bindable( "unused" )] + public function get level() : int + { + return _level; + } + + [Bindable( "initialized" )] + public function get name() : String + { + return _name; + } + + override public function toString() : String + { + return _name; + } + } +} http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/model/events/RulesetReceivedEvent.as ---------------------------------------------------------------------- diff --git a/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/model/events/RulesetReceivedEvent.as b/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/model/events/RulesetReceivedEvent.as new file mode 100644 index 0000000..aeff332 --- /dev/null +++ b/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/model/events/RulesetReceivedEvent.as @@ -0,0 +1,48 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 com.adobe.ac.pmd.model.events +{ + import com.adobe.ac.pmd.model.Ruleset; + + import flash.events.Event; + + public class RulesetReceivedEvent extends Event + { + public static const EVENT_NAME : String = "rulesetReceived"; + + private var _ruleset : Ruleset; + + public function RulesetReceivedEvent( ruleset : Ruleset ) + { + super( EVENT_NAME ); + + _ruleset = ruleset; + } + + public function get ruleset() : Ruleset + { + return _ruleset; + } + + override public function clone() : Event + { + return new RulesetReceivedEvent( ruleset ); + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/view/Title.mxml ---------------------------------------------------------------------- diff --git a/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/view/Title.mxml b/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/view/Title.mxml new file mode 100644 index 0000000..0bf1899 --- /dev/null +++ b/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/flex/com/adobe/ac/pmd/view/Title.mxml @@ -0,0 +1,36 @@ +<?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. + +--> +<mx:Label xmlns:mx="http://www.adobe.com/2006/mxml" + styleName="h1" + > + + <mx:filters> + + <flash.filters:DropShadowFilter xmlns:flash.filters="flash.filters.*" + color="0xffffff" + angle="90" + blurX="0" + blurY="0" + distance="1" + /> + + </mx:filters> + +</mx:Label> http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/resources/assets/cancelledIcon.png ---------------------------------------------------------------------- diff --git a/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/resources/assets/cancelledIcon.png b/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/resources/assets/cancelledIcon.png new file mode 100644 index 0000000..9bca099 Binary files /dev/null and b/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/resources/assets/cancelledIcon.png differ http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/resources/assets/export.png ---------------------------------------------------------------------- diff --git a/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/resources/assets/export.png b/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/resources/assets/export.png new file mode 100644 index 0000000..fd4bfcd Binary files /dev/null and b/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/resources/assets/export.png differ http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/resources/assets/icon_tool_trash.png ---------------------------------------------------------------------- diff --git a/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/resources/assets/icon_tool_trash.png b/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/resources/assets/icon_tool_trash.png new file mode 100644 index 0000000..b4b470d Binary files /dev/null and b/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/resources/assets/icon_tool_trash.png differ http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/resources/assets/icon_tool_trash2.png ---------------------------------------------------------------------- diff --git a/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/resources/assets/icon_tool_trash2.png b/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/resources/assets/icon_tool_trash2.png new file mode 100644 index 0000000..282a037 Binary files /dev/null and b/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/resources/assets/icon_tool_trash2.png differ http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/resources/assets/todoLogo.png ---------------------------------------------------------------------- diff --git a/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/resources/assets/todoLogo.png b/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/resources/assets/todoLogo.png new file mode 100644 index 0000000..a314b8d Binary files /dev/null and b/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/resources/assets/todoLogo.png differ http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/resources/assets/todoLogo_big.png ---------------------------------------------------------------------- diff --git a/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/resources/assets/todoLogo_big.png b/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/resources/assets/todoLogo_big.png new file mode 100644 index 0000000..bb89f68 Binary files /dev/null and b/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/main/resources/assets/todoLogo_big.png differ http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/test/flex/AllTests.as ---------------------------------------------------------------------- diff --git a/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/test/flex/AllTests.as b/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/test/flex/AllTests.as new file mode 100644 index 0000000..65391b7 --- /dev/null +++ b/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/test/flex/AllTests.as @@ -0,0 +1,36 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 flex - pmd - flex - lib.src.test.flex +{ + import com.adobe.ac.pmd.model.RuleTest; + import com.adobe.ac.pmd.model.RulesetTest; + + import flexunit.framework.TestSuite; + + public class AllTests extends TestSuite + { + public function AllTests() + { + super(); + + addTestSuite( RulesetTest ); + addTestSuite( RuleTest ); + } + } +} http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/test/flex/com/adobe/ac/pmd/model/RuleTest.as ---------------------------------------------------------------------- diff --git a/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/test/flex/com/adobe/ac/pmd/model/RuleTest.as b/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/test/flex/com/adobe/ac/pmd/model/RuleTest.as new file mode 100644 index 0000000..d4d4a6b --- /dev/null +++ b/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/test/flex/com/adobe/ac/pmd/model/RuleTest.as @@ -0,0 +1,61 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 com.adobe.ac.pmd.model +{ + import flexunit.framework.EventfulTestCase; + + public class RuleTest extends EventfulTestCase + { + private var rule : Rule; + + public function RuleTest() + { + } + + override public function setUp():void + { + rule = new Rule(); + } + + public function testName() : void + { + listenForEvent( rule, Rule.NAME_CHANGE ); + + rule.name = "com.adobe.ac.MyRule"; + + assertEvents(); + assertEquals( "MyRule", rule.shortName ); + + rule.name = "MyRule"; + assertEquals( "MyRule", rule.shortName ); + } + + public function testRemove() : void + { + var parentRuleset : Ruleset = new Ruleset(); + + rule.ruleset = parentRuleset; + parentRuleset.rules.addItem( rule ); + rule.remove(); + + assertEquals( 1, parentRuleset.rules.length ); + assertTrue( Rule( parentRuleset.rules.getItemAt( 0 ) ).deleted ); + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/test/flex/com/adobe/ac/pmd/model/RulesetTest.as ---------------------------------------------------------------------- diff --git a/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/test/flex/com/adobe/ac/pmd/model/RulesetTest.as b/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/test/flex/com/adobe/ac/pmd/model/RulesetTest.as new file mode 100644 index 0000000..f70d229 --- /dev/null +++ b/FlexPMD/flex-pmd-flex/flex-pmd-flex-lib/src/test/flex/com/adobe/ac/pmd/model/RulesetTest.as @@ -0,0 +1,72 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 com.adobe.ac.pmd.model +{ + import com.adobe.ac.pmd.control.events.GetRulesetContentEvent; + import com.adobe.ac.pmd.model.events.RulesetReceivedEvent; + + import flexunit.framework.CairngormEventSource; + import flexunit.framework.EventfulTestCase; + + import mx.collections.ArrayCollection; + + public class RulesetTest extends EventfulTestCase + { + private var model : Ruleset; + + public function RulesetTest() + { + } + + override public function setUp():void + { + model = new Ruleset(); + } + + public function testGetRulesetContent() : void + { + listenForEvent( CairngormEventSource.instance, GetRulesetContentEvent.EVENT_NAME ); + + model.getRulesetContent( "ref" ); + + assertEvents(); + assertEquals( model, GetRulesetContentEvent( lastDispatchedExpectedEvent ).invoker ); + assertEquals( "ref", GetRulesetContentEvent( lastDispatchedExpectedEvent ).ref ); + } + + public function testOnReceiveRulesetContent() : void + { + var receivedRuleset : Ruleset = new Ruleset(); + + listenForEvent( model, RulesetReceivedEvent.EVENT_NAME ); + + receivedRuleset.name = "name"; + receivedRuleset.description = "description"; + receivedRuleset.rules = new ArrayCollection(); + + model.onReceiveRulesetContent( receivedRuleset ); + + assertEvents(); + assertEquals( model, RulesetReceivedEvent( lastDispatchedExpectedEvent ).ruleset ); + assertEquals( receivedRuleset.name, model.name ); + assertEquals( receivedRuleset.description, model.description ); + assertEquals( receivedRuleset.rules, model.rules ); + } + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/e43b7a87/FlexPMD/flex-pmd-flex/flex-pmd-ruleset-creator/build.properties ---------------------------------------------------------------------- diff --git a/FlexPMD/flex-pmd-flex/flex-pmd-ruleset-creator/build.properties b/FlexPMD/flex-pmd-flex/flex-pmd-ruleset-creator/build.properties new file mode 100644 index 0000000..7c7944d --- /dev/null +++ b/FlexPMD/flex-pmd-flex/flex-pmd-ruleset-creator/build.properties @@ -0,0 +1,41 @@ +################################################################################ +## +## 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. +## +################################################################################ + +# +################################### +## detail your environment settings +################################### +#env.MAVEN_HOME will be used by the ant file +MAVEN.EXE = mvn.bat +# for windows +#MAVEN.EXE = mvn +# for Mac + +# Location of flex SDK +flexcover.sdk=C:\\apps\\flex\\instrumented-sdk-adobe-3.2.0.3958 +flex.sdk.version=3.2.0.3958 + +################################### +## common parameters section +################################### +temp=${basedir}/temp +path.maven.repo=http://fna-v2.googlecode.com/svn/trunk/fna/fna_m2_repository/ + + +