diff options
Diffstat (limited to 'eclipse')
11 files changed, 27 insertions, 16 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/ContextPullParser.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/ContextPullParser.java index c77c853..f304065 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/ContextPullParser.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/ContextPullParser.java @@ -34,7 +34,7 @@ import static com.android.ide.eclipse.adt.internal.editors.layout.gle2.LayoutMet import com.android.SdkConstants; import com.android.ide.common.rendering.api.ILayoutPullParser; import com.android.ide.common.rendering.api.IProjectCallback; -import com.android.ide.common.resources.ValueResourceParser; +import com.android.ide.common.res2.ValueXmlHelper; import com.android.ide.eclipse.adt.internal.editors.layout.gle2.LayoutMetadata; import com.google.common.collect.Maps; @@ -159,7 +159,7 @@ public class ContextPullParser extends KXmlParser implements ILayoutPullParser { } // Handle unicode escapes etc - value = ValueResourceParser.unescapeResourceString(value, false, false); + value = ValueXmlHelper.unescapeResourceString(value, false, false); return value; } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/UiElementPullParser.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/UiElementPullParser.java index e8e0d79..8581568 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/UiElementPullParser.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/UiElementPullParser.java @@ -36,7 +36,7 @@ import static com.android.SdkConstants.VIEW_INCLUDE; import com.android.ide.common.rendering.api.ILayoutPullParser; import com.android.ide.common.rendering.api.ViewInfo; -import com.android.ide.common.resources.ValueResourceParser; +import com.android.ide.common.res2.ValueXmlHelper; import com.android.ide.eclipse.adt.internal.editors.layout.descriptors.LayoutDescriptors; import com.android.ide.eclipse.adt.internal.editors.layout.descriptors.ViewElementDescriptor; import com.android.ide.eclipse.adt.internal.editors.layout.gle2.FragmentMenu; @@ -399,7 +399,7 @@ public class UiElementPullParser extends BasePullParser { } // Handle unicode escapes etc - value = ValueResourceParser.unescapeResourceString(value, false, false); + value = ValueXmlHelper.unescapeResourceString(value, false, false); return value; } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/ManifestInfo.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/ManifestInfo.java index 55cad2b..e43b04c 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/ManifestInfo.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/ManifestInfo.java @@ -225,9 +225,9 @@ public class ManifestInfo { String theme = activity.getAttributeNS(NS_RESOURCES, ATTRIBUTE_THEME); if (theme != null && theme.length() > 0) { String name = activity.getAttributeNS(NS_RESOURCES, ATTRIBUTE_NAME); - if (name.startsWith(".") //$NON-NLS-1$ - && mPackage != null && mPackage.length() > 0) { - name = mPackage + name; + int index = name.indexOf('.'); + if (index <= 0 && mPackage != null && !mPackage.isEmpty()) { + name = mPackage + (index == -1 ? "." : "") + name; } mActivityThemes.put(name, theme); } diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/extractstring/ExtractStringRefactoring.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/extractstring/ExtractStringRefactoring.java index 7d0f926..db0b096 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/extractstring/ExtractStringRefactoring.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/refactorings/extractstring/ExtractStringRefactoring.java @@ -20,7 +20,7 @@ import static com.android.SdkConstants.QUOT_ENTITY; import static com.android.SdkConstants.STRING_PREFIX; import com.android.SdkConstants; -import com.android.ide.common.resources.ValueResourceParser; +import com.android.ide.common.res2.ValueXmlHelper; import com.android.ide.common.xml.ManifestData; import com.android.ide.eclipse.adt.AdtConstants; import com.android.ide.eclipse.adt.internal.editors.AndroidXmlEditor; @@ -1217,7 +1217,7 @@ public class ExtractStringRefactoring extends Refactoring { IStructuredModel smodel = null; // Single and double quotes must be escaped in the <string>value</string> declaration - tokenString = ValueResourceParser.escapeResourceString(tokenString); + tokenString = ValueXmlHelper.escapeResourceString(tokenString); try { IStructuredDocument sdoc = null; diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/manager/ProjectResources.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/manager/ProjectResources.java index 68c2257..7c3fd4c 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/manager/ProjectResources.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/resources/manager/ProjectResources.java @@ -65,7 +65,7 @@ public class ProjectResources extends ResourceRepository { private Map<IntArrayWrapper, String> mStyleableValueToNameMap; private final DynamicIdMap mDynamicIdMap = new DynamicIdMap(DYNAMIC_ID_SEED_START); - + private final IntArrayWrapper mWrapper = new IntArrayWrapper(null); private final IProject mProject; public static ProjectResources create(IProject project) { diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/Sdk.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/Sdk.java index 74f08c2..ad2648f 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/Sdk.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/sdk/Sdk.java @@ -384,7 +384,7 @@ public final class Sdk { @Nullable public BuildToolInfo getLatestBuildTool() { - return mManager.getLatestBuildTool(false /*isPreview*/); + return mManager.getLatestBuildTool(); } /** diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/NewProjectCreator.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/NewProjectCreator.java index eea9d36..8c8fa29 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/NewProjectCreator.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/NewProjectCreator.java @@ -18,12 +18,13 @@ package com.android.ide.eclipse.adt.internal.wizards.newproject; import static com.android.SdkConstants.FN_PROJECT_PROPERTIES; import static com.android.sdklib.internal.project.ProjectProperties.PROPERTY_LIBRARY; + import static org.eclipse.core.resources.IResource.DEPTH_ZERO; import com.android.SdkConstants; import com.android.annotations.NonNull; import com.android.annotations.Nullable; -import com.android.ide.common.resources.ValueResourceParser; +import com.android.ide.common.res2.ValueXmlHelper; import com.android.ide.common.xml.ManifestData; import com.android.ide.common.xml.XmlFormatStyle; import com.android.ide.eclipse.adt.AdtConstants; @@ -1058,7 +1059,7 @@ public class NewProjectCreator { String value = strings.get(key); // Escape values if necessary - value = ValueResourceParser.escapeResourceString(value); + value = ValueXmlHelper.escapeResourceString(value); // place them in the template String stringDef = stringTemplate.replace(PARAM_STRING_NAME, key); diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newxmlfile/AddTranslationDialog.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newxmlfile/AddTranslationDialog.java index ce7e936..0be37cf 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newxmlfile/AddTranslationDialog.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newxmlfile/AddTranslationDialog.java @@ -20,6 +20,7 @@ import static com.android.SdkConstants.FD_RES_VALUES; import static com.android.SdkConstants.RES_QUALIFIER_SEP; import com.android.ide.common.rendering.api.ResourceValue; +import com.android.ide.common.res2.ValueXmlHelper; import com.android.ide.common.resources.ResourceItem; import com.android.ide.common.resources.configuration.FolderConfiguration; import com.android.ide.eclipse.adt.AdtPlugin; @@ -384,7 +385,7 @@ public class AddTranslationDialog extends Dialog implements ControlListener, Sel sb.append(" <string name=\""); //$NON-NLS-1$ sb.append(key); sb.append("\">"); //$NON-NLS-1$ - sb.append(value); + sb.append(ValueXmlHelper.escapeResourceString(value)); sb.append("</string>\n"); //$NON-NLS-1$ } sb.append("\n</resources>"); //$NON-NLS-1$ diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/FmEscapeXmlStringMethod.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/FmEscapeXmlStringMethod.java index ffcfa3e..2255653 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/FmEscapeXmlStringMethod.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/FmEscapeXmlStringMethod.java @@ -15,7 +15,7 @@ */ package com.android.ide.eclipse.adt.internal.wizards.templates; -import com.android.ide.common.resources.ValueResourceParser; +import com.android.ide.common.res2.ValueXmlHelper; import freemarker.template.SimpleScalar; import freemarker.template.TemplateMethodModel; @@ -38,6 +38,6 @@ public class FmEscapeXmlStringMethod implements TemplateMethodModel { throw new TemplateModelException("Wrong arguments"); } String string = args.get(0).toString(); - return new SimpleScalar(ValueResourceParser.escapeResourceString(string)); + return new SimpleScalar(ValueXmlHelper.escapeResourceString(string)); } }
\ No newline at end of file diff --git a/eclipse/plugins/com.android.ide.eclipse.base/META-INF/MANIFEST.MF b/eclipse/plugins/com.android.ide.eclipse.base/META-INF/MANIFEST.MF index 4d42a1a..fc7fd5c 100644 --- a/eclipse/plugins/com.android.ide.eclipse.base/META-INF/MANIFEST.MF +++ b/eclipse/plugins/com.android.ide.eclipse.base/META-INF/MANIFEST.MF @@ -28,9 +28,12 @@ Export-Package: com.android, com.android.annotations, com.android.annotations.concurrency, com.android.dvlib, + com.android.ide.common.internal, + com.android.ide.common.packaging, com.android.ide.common.rendering, com.android.ide.common.rendering.api, com.android.ide.common.rendering.legacy, + com.android.ide.common.res2, com.android.ide.common.resources, com.android.ide.common.resources.configuration, com.android.ide.common.sdk, diff --git a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/manifest/ManifestInfoTest.java b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/manifest/ManifestInfoTest.java index f4b8cee..e9010c4 100644 --- a/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/manifest/ManifestInfoTest.java +++ b/eclipse/plugins/com.android.ide.eclipse.tests/src/com/android/ide/eclipse/adt/internal/editors/manifest/ManifestInfoTest.java @@ -22,6 +22,7 @@ import static com.android.resources.ScreenSize.XLARGE; import com.android.ide.eclipse.adt.internal.editors.layout.refactoring.AdtProjectTest; import com.android.ide.eclipse.adt.internal.resources.ResourceHelper; import com.android.sdklib.AndroidVersion; +import com.android.sdklib.BuildToolInfo; import com.android.sdklib.IAndroidTarget; import com.android.sdklib.ISystemImage; @@ -403,5 +404,10 @@ public class ManifestInfoTest extends AdtProjectTest { public List<String> getBootClasspath() { return new ArrayList<String>(); } + + @Override + public BuildToolInfo getBuildToolInfo() { + return null; + } } } |