diff options
-rw-r--r-- | eclipse/plugins/com.android.ide.eclipse.adt/.classpath | 1 | ||||
-rw-r--r-- | eclipse/plugins/com.android.ide.eclipse.adt/META-INF/MANIFEST.MF | 2 | ||||
-rw-r--r-- | eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/BaseLayoutRule.java | 6 | ||||
-rw-r--r-- | eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/relative/GuidelineHandler.java | 6 | ||||
-rw-r--r-- | eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/relative/MoveHandler.java | 2 | ||||
-rw-r--r-- | eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/relative/ResizeHandler.java | 2 | ||||
-rw-r--r-- | eclipse/plugins/com.android.ide.eclipse.tests/.classpath | 1 | ||||
-rwxr-xr-x | eclipse/scripts/create_adt_symlinks.sh | 2 | ||||
-rw-r--r-- | rule_api/.classpath | 7 | ||||
-rw-r--r-- | rule_api/.gitignore | 1 | ||||
-rw-r--r-- | rule_api/.project | 17 | ||||
-rw-r--r-- | rule_api/.settings/org.eclipse.jdt.core.prefs | 71 | ||||
-rw-r--r-- | rule_api/Android.mk | 28 | ||||
-rw-r--r-- | rule_api/NOTICE | 190 | ||||
-rw-r--r-- | rule_api/README.txt | 10 | ||||
-rw-r--r-- | rule_api/src/com/android/ide/common/api/DrawingStyle.java (renamed from eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/DrawingStyle.java) | 0 | ||||
-rwxr-xr-x | rule_api/src/com/android/ide/common/api/DropFeedback.java (renamed from eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/DropFeedback.java) | 0 | ||||
-rwxr-xr-x | rule_api/src/com/android/ide/common/api/IAttributeInfo.java (renamed from eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/IAttributeInfo.java) | 0 | ||||
-rwxr-xr-x | rule_api/src/com/android/ide/common/api/IClientRulesEngine.java (renamed from eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/IClientRulesEngine.java) | 0 | ||||
-rwxr-xr-x | rule_api/src/com/android/ide/common/api/IColor.java (renamed from eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/IColor.java) | 0 | ||||
-rwxr-xr-x | rule_api/src/com/android/ide/common/api/IDragElement.java (renamed from eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/IDragElement.java) | 0 | ||||
-rw-r--r-- | rule_api/src/com/android/ide/common/api/IFeedbackPainter.java (renamed from eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/IFeedbackPainter.java) | 0 | ||||
-rwxr-xr-x | rule_api/src/com/android/ide/common/api/IGraphics.java (renamed from eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/IGraphics.java) | 0 | ||||
-rw-r--r-- | rule_api/src/com/android/ide/common/api/IMenuCallback.java (renamed from eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/IMenuCallback.java) | 0 | ||||
-rwxr-xr-x | rule_api/src/com/android/ide/common/api/INode.java (renamed from eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/INode.java) | 0 | ||||
-rw-r--r-- | rule_api/src/com/android/ide/common/api/INodeHandler.java (renamed from eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/INodeHandler.java) | 0 | ||||
-rw-r--r-- | rule_api/src/com/android/ide/common/api/IValidator.java (renamed from eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/IValidator.java) | 0 | ||||
-rw-r--r-- | rule_api/src/com/android/ide/common/api/IViewMetadata.java (renamed from eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/IViewMetadata.java) | 0 | ||||
-rwxr-xr-x | rule_api/src/com/android/ide/common/api/IViewRule.java (renamed from eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/IViewRule.java) | 0 | ||||
-rw-r--r-- | rule_api/src/com/android/ide/common/api/InsertType.java (renamed from eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/InsertType.java) | 0 | ||||
-rw-r--r-- | rule_api/src/com/android/ide/common/api/MarginType.java (renamed from eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/relative/MarginType.java) | 3 | ||||
-rw-r--r-- | rule_api/src/com/android/ide/common/api/Margins.java (renamed from eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/Margins.java) | 0 | ||||
-rwxr-xr-x | rule_api/src/com/android/ide/common/api/Point.java (renamed from eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/Point.java) | 0 | ||||
-rwxr-xr-x | rule_api/src/com/android/ide/common/api/Rect.java (renamed from eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/Rect.java) | 0 | ||||
-rw-r--r-- | rule_api/src/com/android/ide/common/api/ResizePolicy.java (renamed from eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/ResizePolicy.java) | 0 | ||||
-rwxr-xr-x | rule_api/src/com/android/ide/common/api/RuleAction.java (renamed from eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/RuleAction.java) | 0 | ||||
-rw-r--r-- | rule_api/src/com/android/ide/common/api/Segment.java (renamed from eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/Segment.java) | 2 | ||||
-rw-r--r-- | rule_api/src/com/android/ide/common/api/SegmentType.java (renamed from eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/SegmentType.java) | 0 |
38 files changed, 337 insertions, 14 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/.classpath b/eclipse/plugins/com.android.ide.eclipse.adt/.classpath index 72a5c8b..82159df 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/.classpath +++ b/eclipse/plugins/com.android.ide.eclipse.adt/.classpath @@ -18,6 +18,7 @@ <classpathentry kind="lib" path="libs/sdkstats.jar" sourcepath="/SdkStatsService"/> <classpathentry kind="lib" path="libs/sdkuilib.jar" sourcepath="/SdkUiLib"/> <classpathentry kind="lib" path="libs/common.jar" sourcepath="/common"/> + <classpathentry kind="lib" path="libs/rule_api.jar" sourcepath="/rule_api"/> <classpathentry kind="lib" path="libs/assetstudio.jar" sourcepath="/assetstudio"/> <classpathentry combineaccessrules="false" kind="src" path="/ddmlib"/> <classpathentry combineaccessrules="false" kind="src" path="/ddmuilib"/> diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/META-INF/MANIFEST.MF b/eclipse/plugins/com.android.ide.eclipse.adt/META-INF/MANIFEST.MF index ebcf44f..4ab4f58 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/META-INF/MANIFEST.MF +++ b/eclipse/plugins/com.android.ide.eclipse.adt/META-INF/MANIFEST.MF @@ -14,6 +14,7 @@ Bundle-ClassPath: ., libs/layoutlib_api.jar, libs/ide_common.jar, libs/common.jar, + libs/rule_api.jar, libs/assetstudio.jar, libs/httpclient-4.1.1.jar, libs/httpcore-4.1.jar, @@ -56,7 +57,6 @@ Require-Bundle: com.android.ide.eclipse.ddms, Eclipse-LazyStart: true Export-Package: com.android, com.android.annotations;x-friends:="com.android.ide.eclipse.tests", - com.android.ide.common.api;x-friends:="com.android.ide.eclipse.tests", com.android.ide.common.layout;x-friends:="com.android.ide.eclipse.tests", com.android.ide.common.log;x-friends:="com.android.ide.eclipse.tests", com.android.ide.common.rendering;x-friends:="com.android.ide.eclipse.tests", diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/BaseLayoutRule.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/BaseLayoutRule.java index 5191d25..ab64ef1 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/BaseLayoutRule.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/BaseLayoutRule.java @@ -67,13 +67,13 @@ import com.android.ide.common.api.IMenuCallback; import com.android.ide.common.api.INode; import com.android.ide.common.api.INodeHandler; import com.android.ide.common.api.IViewRule; -import com.android.ide.common.api.RuleAction; -import com.android.ide.common.api.RuleAction.ChoiceProvider; +import com.android.ide.common.api.MarginType; import com.android.ide.common.api.Point; import com.android.ide.common.api.Rect; +import com.android.ide.common.api.RuleAction; +import com.android.ide.common.api.RuleAction.ChoiceProvider; import com.android.ide.common.api.Segment; import com.android.ide.common.api.SegmentType; -import com.android.ide.common.layout.relative.MarginType; import com.android.sdklib.SdkConstants; import com.android.util.Pair; diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/relative/GuidelineHandler.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/relative/GuidelineHandler.java index 7c6e1d2..45f3008 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/relative/GuidelineHandler.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/relative/GuidelineHandler.java @@ -15,6 +15,9 @@ */ package com.android.ide.common.layout.relative; +import static com.android.ide.common.api.MarginType.NO_MARGIN; +import static com.android.ide.common.api.MarginType.WITHOUT_MARGIN; +import static com.android.ide.common.api.MarginType.WITH_MARGIN; import static com.android.ide.common.api.SegmentType.BASELINE; import static com.android.ide.common.api.SegmentType.BOTTOM; import static com.android.ide.common.api.SegmentType.CENTER_HORIZONTAL; @@ -48,9 +51,6 @@ import static com.android.ide.common.layout.LayoutConstants.ATTR_LAYOUT_TO_RIGHT import static com.android.ide.common.layout.LayoutConstants.VALUE_N_DP; import static com.android.ide.common.layout.LayoutConstants.VALUE_TRUE; import static com.android.ide.common.layout.relative.ConstraintType.ALIGN_BASELINE; -import static com.android.ide.common.layout.relative.MarginType.NO_MARGIN; -import static com.android.ide.common.layout.relative.MarginType.WITHOUT_MARGIN; -import static com.android.ide.common.layout.relative.MarginType.WITH_MARGIN; import static java.lang.Math.abs; import com.android.ide.common.api.DropFeedback; diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/relative/MoveHandler.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/relative/MoveHandler.java index a2f9ac2..3b066b7 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/relative/MoveHandler.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/relative/MoveHandler.java @@ -15,6 +15,7 @@ */ package com.android.ide.common.layout.relative; +import static com.android.ide.common.api.MarginType.NO_MARGIN; import static com.android.ide.common.api.SegmentType.BASELINE; import static com.android.ide.common.api.SegmentType.BOTTOM; import static com.android.ide.common.api.SegmentType.CENTER_HORIZONTAL; @@ -24,7 +25,6 @@ import static com.android.ide.common.api.SegmentType.RIGHT; import static com.android.ide.common.api.SegmentType.TOP; import static com.android.ide.common.layout.LayoutConstants.ANDROID_URI; import static com.android.ide.common.layout.LayoutConstants.ATTR_ID; -import static com.android.ide.common.layout.relative.MarginType.NO_MARGIN; import static java.lang.Math.abs; import com.android.ide.common.api.DropFeedback; diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/relative/ResizeHandler.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/relative/ResizeHandler.java index 6cf421a..2e5b4b1 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/relative/ResizeHandler.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/relative/ResizeHandler.java @@ -15,6 +15,7 @@ */ package com.android.ide.common.layout.relative; +import static com.android.ide.common.api.MarginType.NO_MARGIN; import static com.android.ide.common.api.SegmentType.BASELINE; import static com.android.ide.common.api.SegmentType.BOTTOM; import static com.android.ide.common.api.SegmentType.CENTER_HORIZONTAL; @@ -24,7 +25,6 @@ import static com.android.ide.common.api.SegmentType.RIGHT; import static com.android.ide.common.api.SegmentType.TOP; import static com.android.ide.common.layout.LayoutConstants.ANDROID_URI; import static com.android.ide.common.layout.LayoutConstants.ATTR_ID; -import static com.android.ide.common.layout.relative.MarginType.NO_MARGIN; import static java.lang.Math.abs; import com.android.ide.common.api.DropFeedback; diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/.classpath b/eclipse/plugins/com.android.ide.eclipse.tests/.classpath index 28377f7..7bfdfc4 100644 --- a/eclipse/plugins/com.android.ide.eclipse.tests/.classpath +++ b/eclipse/plugins/com.android.ide.eclipse.tests/.classpath @@ -13,6 +13,7 @@ <classpathentry kind="lib" path="/adt/libs/ninepatch.jar" sourcepath="/ninepatch"/> <classpathentry kind="lib" path="/adt/libs/sdklib.jar" sourcepath="/SdkLib"/> <classpathentry kind="lib" path="/adt/libs/sdkuilib.jar" sourcepath="/SdkUiLib"/> + <classpathentry kind="lib" path="/adt/libs/rule_api.jar" sourcepath="/rule_api"/> <classpathentry kind="lib" path="/adt/libs/common.jar"/> <classpathentry kind="output" path="bin"/> </classpath> diff --git a/eclipse/scripts/create_adt_symlinks.sh b/eclipse/scripts/create_adt_symlinks.sh index 72b5f6c..9298ac0 100755 --- a/eclipse/scripts/create_adt_symlinks.sh +++ b/eclipse/scripts/create_adt_symlinks.sh @@ -16,7 +16,7 @@ BACK=`echo $DEST | sed 's@[^/]*@..@g'` mkdir -p $DEST -LIBS="sdkstats androidprefs common layoutlib_api ide_common ninepatch sdklib sdkuilib assetstudio" +LIBS="sdkstats androidprefs common layoutlib_api ide_common rule_api ninepatch sdklib sdkuilib assetstudio" echo "make java libs ..." make -j3 showcommands $LIBS || die "ADT: Fail to build one of $LIBS." diff --git a/rule_api/.classpath b/rule_api/.classpath new file mode 100644 index 0000000..f9c91e7 --- /dev/null +++ b/rule_api/.classpath @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry combineaccessrules="false" kind="src" path="/common"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/rule_api/.gitignore b/rule_api/.gitignore new file mode 100644 index 0000000..ba077a4 --- /dev/null +++ b/rule_api/.gitignore @@ -0,0 +1 @@ +bin diff --git a/rule_api/.project b/rule_api/.project new file mode 100644 index 0000000..2e2a12e --- /dev/null +++ b/rule_api/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>rule_api</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/rule_api/.settings/org.eclipse.jdt.core.prefs b/rule_api/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..e755df2 --- /dev/null +++ b/rule_api/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,71 @@ +#Thu Jun 09 12:26:44 PDT 2011 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning +org.eclipse.jdt.core.compiler.problem.autoboxing=ignore +org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning +org.eclipse.jdt.core.compiler.problem.deadCode=warning +org.eclipse.jdt.core.compiler.problem.deprecation=warning +org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled +org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled +org.eclipse.jdt.core.compiler.problem.discouragedReference=warning +org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore +org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning +org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled +org.eclipse.jdt.core.compiler.problem.fieldHiding=warning +org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning +org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning +org.eclipse.jdt.core.compiler.problem.forbiddenReference=error +org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning +org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=enabled +org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning +org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore +org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore +org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning +org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning +org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning +org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=error +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled +org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning +org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore +org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning +org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore +org.eclipse.jdt.core.compiler.problem.nullReference=error +org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning +org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore +org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning +org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning +org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning +org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore +org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning +org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore +org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore +org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled +org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning +org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled +org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled +org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore +org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning +org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled +org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning +org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore +org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning +org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore +org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled +org.eclipse.jdt.core.compiler.problem.unusedImport=warning +org.eclipse.jdt.core.compiler.problem.unusedLabel=warning +org.eclipse.jdt.core.compiler.problem.unusedLocal=warning +org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning +org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore +org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled +org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled +org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning +org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning +org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning diff --git a/rule_api/Android.mk b/rule_api/Android.mk new file mode 100644 index 0000000..6f5d034 --- /dev/null +++ b/rule_api/Android.mk @@ -0,0 +1,28 @@ +# +# Copyright (C) 2008 The Android Open Source Project +# +# Licensed 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. +# +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(call all-java-files-under,src) +LOCAL_JAVA_RESOURCE_DIRS := src + +LOCAL_JAVA_LIBRARIES := \ + common + +LOCAL_MODULE := rule_api +LOCAL_MODULE_TAGS := optional + +include $(BUILD_HOST_JAVA_LIBRARY) diff --git a/rule_api/NOTICE b/rule_api/NOTICE new file mode 100644 index 0000000..becc120 --- /dev/null +++ b/rule_api/NOTICE @@ -0,0 +1,190 @@ + + Copyright (c) 2011, The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + + 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. + + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + diff --git a/rule_api/README.txt b/rule_api/README.txt new file mode 100644 index 0000000..b094e60 --- /dev/null +++ b/rule_api/README.txt @@ -0,0 +1,10 @@ +The Rule API is a library intended for view authors to add designtime +support for their custom views in Android layout editors. + +NOTE: The API is *not* final and will very likely continue to change +incompatibly until we finish it and incorporate feedback. + +The rule API attempts to be IDE agnostic, so it should not have +specific dependencies on any tools. IDE vendors building layout +editors should provide IDE-side implementations of the rule interfaces +such that they can interact with view rules. diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/DrawingStyle.java b/rule_api/src/com/android/ide/common/api/DrawingStyle.java index 199608e..199608e 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/DrawingStyle.java +++ b/rule_api/src/com/android/ide/common/api/DrawingStyle.java diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/DropFeedback.java b/rule_api/src/com/android/ide/common/api/DropFeedback.java index 4be9c9e..4be9c9e 100755 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/DropFeedback.java +++ b/rule_api/src/com/android/ide/common/api/DropFeedback.java diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/IAttributeInfo.java b/rule_api/src/com/android/ide/common/api/IAttributeInfo.java index 2a6ecd8..2a6ecd8 100755 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/IAttributeInfo.java +++ b/rule_api/src/com/android/ide/common/api/IAttributeInfo.java diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/IClientRulesEngine.java b/rule_api/src/com/android/ide/common/api/IClientRulesEngine.java index 0853378..0853378 100755 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/IClientRulesEngine.java +++ b/rule_api/src/com/android/ide/common/api/IClientRulesEngine.java diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/IColor.java b/rule_api/src/com/android/ide/common/api/IColor.java index f75d30a..f75d30a 100755 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/IColor.java +++ b/rule_api/src/com/android/ide/common/api/IColor.java diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/IDragElement.java b/rule_api/src/com/android/ide/common/api/IDragElement.java index a5e339a..a5e339a 100755 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/IDragElement.java +++ b/rule_api/src/com/android/ide/common/api/IDragElement.java diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/IFeedbackPainter.java b/rule_api/src/com/android/ide/common/api/IFeedbackPainter.java index 7478f6b..7478f6b 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/IFeedbackPainter.java +++ b/rule_api/src/com/android/ide/common/api/IFeedbackPainter.java diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/IGraphics.java b/rule_api/src/com/android/ide/common/api/IGraphics.java index 0ee2ef2..0ee2ef2 100755 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/IGraphics.java +++ b/rule_api/src/com/android/ide/common/api/IGraphics.java diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/IMenuCallback.java b/rule_api/src/com/android/ide/common/api/IMenuCallback.java index 80f77b8..80f77b8 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/IMenuCallback.java +++ b/rule_api/src/com/android/ide/common/api/IMenuCallback.java diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/INode.java b/rule_api/src/com/android/ide/common/api/INode.java index e3f34a9..e3f34a9 100755 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/INode.java +++ b/rule_api/src/com/android/ide/common/api/INode.java diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/INodeHandler.java b/rule_api/src/com/android/ide/common/api/INodeHandler.java index e261395..e261395 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/INodeHandler.java +++ b/rule_api/src/com/android/ide/common/api/INodeHandler.java diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/IValidator.java b/rule_api/src/com/android/ide/common/api/IValidator.java index 6ef44cd..6ef44cd 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/IValidator.java +++ b/rule_api/src/com/android/ide/common/api/IValidator.java diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/IViewMetadata.java b/rule_api/src/com/android/ide/common/api/IViewMetadata.java index 0687f30..0687f30 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/IViewMetadata.java +++ b/rule_api/src/com/android/ide/common/api/IViewMetadata.java diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/IViewRule.java b/rule_api/src/com/android/ide/common/api/IViewRule.java index d29ef71..d29ef71 100755 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/IViewRule.java +++ b/rule_api/src/com/android/ide/common/api/IViewRule.java diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/InsertType.java b/rule_api/src/com/android/ide/common/api/InsertType.java index 806b2bb..806b2bb 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/InsertType.java +++ b/rule_api/src/com/android/ide/common/api/InsertType.java diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/relative/MarginType.java b/rule_api/src/com/android/ide/common/api/MarginType.java index 7705958..d3a27a4 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/relative/MarginType.java +++ b/rule_api/src/com/android/ide/common/api/MarginType.java @@ -14,9 +14,8 @@ * limitations under the License. */ -package com.android.ide.common.layout.relative; +package com.android.ide.common.api; -import com.android.ide.common.api.Segment; /** * A {@link MarginType} indicates whether a {@link Segment} corresponds to the visual edge diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/Margins.java b/rule_api/src/com/android/ide/common/api/Margins.java index 40f44ce..40f44ce 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/Margins.java +++ b/rule_api/src/com/android/ide/common/api/Margins.java diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/Point.java b/rule_api/src/com/android/ide/common/api/Point.java index 67c41d3..67c41d3 100755 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/Point.java +++ b/rule_api/src/com/android/ide/common/api/Point.java diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/Rect.java b/rule_api/src/com/android/ide/common/api/Rect.java index f3922e2..f3922e2 100755 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/Rect.java +++ b/rule_api/src/com/android/ide/common/api/Rect.java diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/ResizePolicy.java b/rule_api/src/com/android/ide/common/api/ResizePolicy.java index 05ad81c..05ad81c 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/ResizePolicy.java +++ b/rule_api/src/com/android/ide/common/api/ResizePolicy.java diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/RuleAction.java b/rule_api/src/com/android/ide/common/api/RuleAction.java index 2ebab36..2ebab36 100755 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/RuleAction.java +++ b/rule_api/src/com/android/ide/common/api/RuleAction.java diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/Segment.java b/rule_api/src/com/android/ide/common/api/Segment.java index 0fb961a..9668b54 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/Segment.java +++ b/rule_api/src/com/android/ide/common/api/Segment.java @@ -16,8 +16,6 @@ package com.android.ide.common.api; -import com.android.ide.common.layout.relative.MarginType; - /** * A segment is a straight horizontal or vertical line between two points, typically an * edge of a node but also possibly some internal segment like a baseline or a center diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/SegmentType.java b/rule_api/src/com/android/ide/common/api/SegmentType.java index a21247d..a21247d 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/api/SegmentType.java +++ b/rule_api/src/com/android/ide/common/api/SegmentType.java |