added istrue and isfalse
Project: http://git-wip-us.apache.org/repos/asf/flex-utilities/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-utilities/commit/861b586f Tree: http://git-wip-us.apache.org/repos/asf/flex-utilities/tree/861b586f Diff: http://git-wip-us.apache.org/repos/asf/flex-utilities/diff/861b586f Branch: refs/heads/develop Commit: 861b586fe839fd23088c6f72b180c56745d246f9 Parents: cdc7e98 Author: Justin Mclean <jmcl...@apache.org> Authored: Sun Jul 27 15:06:33 2014 +1000 Committer: Justin Mclean <jmcl...@apache.org> Committed: Sun Jul 27 15:06:33 2014 +1000 ---------------------------------------------------------------------- ant_on_air/src/AntClasses.as | 2 + .../src/org/apache/flex/ant/tags/IsFalse.as | 53 ++++++++++++++++++++ .../src/org/apache/flex/ant/tags/IsTrue.as | 53 ++++++++++++++++++++ 3 files changed, 108 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/861b586f/ant_on_air/src/AntClasses.as ---------------------------------------------------------------------- diff --git a/ant_on_air/src/AntClasses.as b/ant_on_air/src/AntClasses.as index e9ab7de..aa60c73 100644 --- a/ant_on_air/src/AntClasses.as +++ b/ant_on_air/src/AntClasses.as @@ -43,8 +43,10 @@ package import org.apache.flex.ant.tags.Get; Get; import org.apache.flex.ant.tags.HasFreeSpace; HasFreeSpace; import org.apache.flex.ant.tags.Input; Input; + import org.apache.flex.ant.tags.IsFalse; IsFalse; import org.apache.flex.ant.tags.IsReference; IsReference; import org.apache.flex.ant.tags.IsSet; IsSet; + import org.apache.flex.ant.tags.IsTrue; IsTrue; import org.apache.flex.ant.tags.LoadProperties; LoadProperties; import org.apache.flex.ant.tags.Matches; Matches; import org.apache.flex.ant.tags.Mkdir; Mkdir; http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/861b586f/ant_on_air/src/org/apache/flex/ant/tags/IsFalse.as ---------------------------------------------------------------------- diff --git a/ant_on_air/src/org/apache/flex/ant/tags/IsFalse.as b/ant_on_air/src/org/apache/flex/ant/tags/IsFalse.as new file mode 100644 index 0000000..7019d35 --- /dev/null +++ b/ant_on_air/src/org/apache/flex/ant/tags/IsFalse.as @@ -0,0 +1,53 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//////////////////////////////////////////////////////////////////////////////// +package org.apache.flex.ant.tags +{ + import mx.core.IFlexModuleFactory; + + import org.apache.flex.ant.Ant; + import org.apache.flex.ant.tags.supportClasses.IValueTagHandler; + import org.apache.flex.ant.tags.supportClasses.TagHandler; + + [Mixin] + public class IsFalse extends TagHandler implements IValueTagHandler + { + public static function init(mf:IFlexModuleFactory):void + { + Ant.antTagProcessors["isfalse"] = IsFalse; + } + + public function IsFalse() + { + super(); + } + + private function get value():String + { + return getAttributeValue("@value"); + } + + public function getValue(context:Object):Object + { + this.context = context; + + return !(value == "true" || value == "on" || value == "yes"); + } + + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/861b586f/ant_on_air/src/org/apache/flex/ant/tags/IsTrue.as ---------------------------------------------------------------------- diff --git a/ant_on_air/src/org/apache/flex/ant/tags/IsTrue.as b/ant_on_air/src/org/apache/flex/ant/tags/IsTrue.as new file mode 100644 index 0000000..9234be4 --- /dev/null +++ b/ant_on_air/src/org/apache/flex/ant/tags/IsTrue.as @@ -0,0 +1,53 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// Licensed to the Apache Software Foundation (ASF) under one or more +// contributor license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright ownership. +// The ASF licenses this file to You under the Apache License, Version 2.0 +// (the "License"); you may not use this file except in compliance with +// the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//////////////////////////////////////////////////////////////////////////////// +package org.apache.flex.ant.tags +{ + import mx.core.IFlexModuleFactory; + + import org.apache.flex.ant.Ant; + import org.apache.flex.ant.tags.supportClasses.IValueTagHandler; + import org.apache.flex.ant.tags.supportClasses.TagHandler; + + [Mixin] + public class IsTrue extends TagHandler implements IValueTagHandler + { + public static function init(mf:IFlexModuleFactory):void + { + Ant.antTagProcessors["istrue"] = IsTrue; + } + + public function IsTrue() + { + super(); + } + + private function get value():String + { + return getAttributeValue("@value"); + } + + public function getValue(context:Object):Object + { + this.context = context; + + return (value == "true" || value == "on" || value == "yes"); + } + + } +} \ No newline at end of file