aboutsummaryrefslogtreecommitdiffstats
path: root/eclipse/plugins/com.android.ide.eclipse.adt
diff options
context:
space:
mode:
Diffstat (limited to 'eclipse/plugins/com.android.ide.eclipse.adt')
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtUtils.java116
-rwxr-xr-xeclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/actions/DexDumpAction.java4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/formatting/XmlPrettyPrinter.java8
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ImageUtils.java2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/properties/ResourceValueCompleter.java4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/properties/ValueCompleter.java8
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/pages/ApplicationToggle.java4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/uimodel/UiElementNode.java4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/EclipseLintClient.java7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintFixGenerator.java3
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintJob.java3
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/ResourcePreviewHelper.java2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/ProjectNamePage.java2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newxmlfile/NewXmlFileCreationPage.java3
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/TemplateHandler.java3
15 files changed, 31 insertions, 142 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtUtils.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtUtils.java
index cf79c90f9..d5fa567b8 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtUtils.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtUtils.java
@@ -53,7 +53,6 @@ import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.TextUtilities;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.widgets.Display;
@@ -90,98 +89,6 @@ import java.util.Locale;
@SuppressWarnings("restriction") // WST API
public class AdtUtils {
/**
- * Returns true if the given string ends with the given suffix, using a
- * case-insensitive comparison.
- *
- * @param string the full string to be checked
- * @param suffix the suffix to be checked for
- * @return true if the string case-insensitively ends with the given suffix
- */
- public static boolean endsWithIgnoreCase(String string, String suffix) {
- return string.regionMatches(true /* ignoreCase */, string.length() - suffix.length(),
- suffix, 0, suffix.length());
- }
-
- /**
- * Returns true if the given sequence ends with the given suffix (case
- * sensitive).
- *
- * @param sequence the character sequence to be checked
- * @param suffix the suffix to look for
- * @return true if the given sequence ends with the given suffix
- */
- public static boolean endsWith(CharSequence sequence, CharSequence suffix) {
- return endsWith(sequence, sequence.length(), suffix);
- }
-
- /**
- * Returns true if the given sequence ends at the given offset with the given suffix (case
- * sensitive)
- *
- * @param sequence the character sequence to be checked
- * @param endOffset the offset at which the sequence is considered to end
- * @param suffix the suffix to look for
- * @return true if the given sequence ends with the given suffix
- */
- public static boolean endsWith(CharSequence sequence, int endOffset, CharSequence suffix) {
- if (endOffset < suffix.length()) {
- return false;
- }
-
- for (int i = endOffset - 1, j = suffix.length() - 1; j >= 0; i--, j--) {
- if (sequence.charAt(i) != suffix.charAt(j)) {
- return false;
- }
- }
-
- return true;
- }
-
- /**
- * Returns true if the given string starts with the given prefix, using a
- * case-insensitive comparison.
- *
- * @param string the full string to be checked
- * @param prefix the prefix to be checked for
- * @return true if the string case-insensitively starts with the given prefix
- */
- public static boolean startsWithIgnoreCase(String string, String prefix) {
- return string.regionMatches(true /* ignoreCase */, 0, prefix, 0, prefix.length());
- }
-
- /**
- * Returns true if the given string starts at the given offset with the
- * given prefix, case insensitively.
- *
- * @param string the full string to be checked
- * @param offset the offset in the string to start looking
- * @param prefix the prefix to be checked for
- * @return true if the string case-insensitively starts at the given offset
- * with the given prefix
- */
- public static boolean startsWith(String string, int offset, String prefix) {
- return string.regionMatches(true /* ignoreCase */, offset, prefix, 0, prefix.length());
- }
-
- /**
- * Strips the whitespace from the given string
- *
- * @param string the string to be cleaned up
- * @return the string, without whitespace
- */
- public static String stripWhitespace(String string) {
- StringBuilder sb = new StringBuilder(string.length());
- for (int i = 0, n = string.length(); i < n; i++) {
- char c = string.charAt(i);
- if (!Character.isWhitespace(c)) {
- sb.append(c);
- }
- }
-
- return sb.toString();
- }
-
- /**
* Creates a Java class name out of the given string, if possible. For
* example, "My Project" becomes "MyProject", "hello" becomes "Hello",
* "Java's" becomes "Java", and so on.
@@ -344,29 +251,6 @@ public class AdtUtils {
return sb.toString();
}
- /** For use by {@link #getLineSeparator()} */
- private static String sLineSeparator;
-
- /**
- * Returns the default line separator to use.
- * <p>
- * NOTE: If you have an associated {@link IDocument}, it is better to call
- * {@link TextUtilities#getDefaultLineDelimiter(IDocument)} since that will
- * allow (for example) editing a \r\n-delimited document on a \n-delimited
- * platform and keep a consistent usage of delimiters in the file.
- *
- * @return the delimiter string to use
- */
- @NonNull
- public static String getLineSeparator() {
- if (sLineSeparator == null) {
- // This is guaranteed to exist:
- sLineSeparator = System.getProperty("line.separator"); //$NON-NLS-1$
- }
-
- return sLineSeparator;
- }
-
/**
* Returns the current editor (the currently visible and active editor), or null if
* not found
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/actions/DexDumpAction.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/actions/DexDumpAction.java
index 98d931f03..a483e9bbe 100755
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/actions/DexDumpAction.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/actions/DexDumpAction.java
@@ -19,12 +19,12 @@ package com.android.ide.eclipse.adt.internal.actions;
import com.android.SdkConstants;
import com.android.annotations.Nullable;
import com.android.ide.eclipse.adt.AdtPlugin;
-import com.android.ide.eclipse.adt.AdtUtils;
import com.android.ide.eclipse.adt.internal.preferences.AdtPrefs.BuildVerbosity;
import com.android.ide.eclipse.adt.internal.sdk.Sdk;
import com.android.sdklib.util.GrabProcessOutput;
import com.android.sdklib.util.GrabProcessOutput.IProcessOutput;
import com.android.sdklib.util.GrabProcessOutput.Wait;
+import com.android.utils.SdkUtils;
import org.eclipse.core.filesystem.EFS;
import org.eclipse.core.filesystem.IFileStore;
@@ -166,7 +166,7 @@ public class DexDumpAction implements IObjectActionDelegate {
final BufferedWriter writer = new BufferedWriter(new FileWriter(dstFile));
try {
- final String lineSep = AdtUtils.getLineSeparator();
+ final String lineSep = SdkUtils.getLineSeparator();
int err = GrabProcessOutput.grabProcessOutput(
process,
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/formatting/XmlPrettyPrinter.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/formatting/XmlPrettyPrinter.java
index 6f15d833f..1dd32c772 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/formatting/XmlPrettyPrinter.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/formatting/XmlPrettyPrinter.java
@@ -24,8 +24,8 @@ import static com.android.SdkConstants.XMLNS;
import com.android.annotations.NonNull;
import com.android.annotations.Nullable;
-import com.android.ide.eclipse.adt.AdtUtils;
import com.android.ide.eclipse.adt.internal.editors.layout.gle2.DomUtilities;
+import com.android.utils.SdkUtils;
import com.android.utils.XmlUtils;
import org.eclipse.wst.xml.core.internal.document.DocumentTypeImpl;
@@ -86,7 +86,7 @@ public class XmlPrettyPrinter {
mPrefs = prefs;
mStyle = style;
if (lineSeparator == null) {
- lineSeparator = AdtUtils.getLineSeparator();
+ lineSeparator = SdkUtils.getLineSeparator();
}
mLineSeparator = lineSeparator;
}
@@ -877,8 +877,8 @@ public class XmlPrettyPrinter {
return false;
}
- return AdtUtils.endsWith(mOut, mLineSeparator) &&
- AdtUtils.endsWith(mOut, mOut.length() - mLineSeparator.length(), mLineSeparator);
+ return SdkUtils.endsWith(mOut, mLineSeparator) &&
+ SdkUtils.endsWith(mOut, mOut.length() - mLineSeparator.length(), mLineSeparator);
}
private boolean newlineAfterElementClose(Element element, int depth) {
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ImageUtils.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ImageUtils.java
index 0178173c0..c55d0d8c0 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ImageUtils.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ImageUtils.java
@@ -20,7 +20,7 @@ import static com.android.SdkConstants.DOT_BMP;
import static com.android.SdkConstants.DOT_GIF;
import static com.android.SdkConstants.DOT_JPG;
import static com.android.SdkConstants.DOT_PNG;
-import static com.android.ide.eclipse.adt.AdtUtils.endsWithIgnoreCase;
+import static com.android.utils.SdkUtils.endsWithIgnoreCase;
import com.android.annotations.NonNull;
import com.android.annotations.Nullable;
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/properties/ResourceValueCompleter.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/properties/ResourceValueCompleter.java
index f6b80d7a1..081ec8069 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/properties/ResourceValueCompleter.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/properties/ResourceValueCompleter.java
@@ -24,7 +24,6 @@ import static com.android.SdkConstants.PREFIX_THEME_REF;
import com.android.ide.common.resources.ResourceItem;
import com.android.ide.common.resources.ResourceRepository;
-import com.android.ide.eclipse.adt.AdtUtils;
import com.android.ide.eclipse.adt.internal.editors.AndroidXmlEditor;
import com.android.ide.eclipse.adt.internal.editors.common.CommonXmlEditor;
import com.android.ide.eclipse.adt.internal.editors.descriptors.AttributeDescriptor;
@@ -32,6 +31,7 @@ import com.android.ide.eclipse.adt.internal.editors.uimodel.UiResourceAttributeN
import com.android.ide.eclipse.adt.internal.resources.manager.ResourceManager;
import com.android.ide.eclipse.adt.internal.sdk.AndroidTargetData;
import com.android.resources.ResourceType;
+import com.android.utils.SdkUtils;
import org.eclipse.core.resources.IProject;
import org.eclipse.jface.fieldassist.ContentProposal;
@@ -172,7 +172,7 @@ class ResourceValueCompleter implements IContentProposalProvider {
prefix.length() <= nameStart ? "" : prefix.substring(nameStart);
for (ResourceItem item : repository.getResourceItemsOfType(type)) {
String name = item.getName();
- if (AdtUtils.startsWithIgnoreCase(name, namePrefix)) {
+ if (SdkUtils.startsWithIgnoreCase(name, namePrefix)) {
results.add(base + name);
}
}
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/properties/ValueCompleter.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/properties/ValueCompleter.java
index 132855d0f..5559349fc 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/properties/ValueCompleter.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/properties/ValueCompleter.java
@@ -35,9 +35,9 @@ import com.android.annotations.NonNull;
import com.android.annotations.Nullable;
import com.android.ide.common.api.IAttributeInfo;
import com.android.ide.common.api.IAttributeInfo.Format;
-import com.android.ide.eclipse.adt.AdtUtils;
import com.android.ide.eclipse.adt.internal.editors.common.CommonXmlEditor;
import com.android.ide.eclipse.adt.internal.editors.descriptors.AttributeDescriptor;
+import com.android.utils.SdkUtils;
import org.eclipse.jface.fieldassist.ContentProposal;
import org.eclipse.jface.fieldassist.IContentProposal;
@@ -147,7 +147,7 @@ abstract class ValueCompleter implements IContentProposalProvider {
}
for (String value : values) {
- if (AdtUtils.startsWithIgnoreCase(value, prefix)) {
+ if (SdkUtils.startsWithIgnoreCase(value, prefix)) {
if (prepend != null && prepend.contains(value)) {
continue;
}
@@ -165,13 +165,13 @@ abstract class ValueCompleter implements IContentProposalProvider {
String[] values = info.getEnumValues();
if (values != null) {
for (String value : values) {
- if (AdtUtils.startsWithIgnoreCase(value, prefix)) {
+ if (SdkUtils.startsWithIgnoreCase(value, prefix)) {
proposals.add(new ContentProposal(value));
}
}
for (String value : values) {
- if (!AdtUtils.startsWithIgnoreCase(value, prefix)) {
+ if (!SdkUtils.startsWithIgnoreCase(value, prefix)) {
proposals.add(new ContentProposal(value));
}
}
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/pages/ApplicationToggle.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/pages/ApplicationToggle.java
index 16519fe53..159f08959 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/pages/ApplicationToggle.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/pages/ApplicationToggle.java
@@ -17,7 +17,6 @@
package com.android.ide.eclipse.adt.internal.editors.manifest.pages;
import com.android.ide.eclipse.adt.AdtPlugin;
-import com.android.ide.eclipse.adt.AdtUtils;
import com.android.ide.eclipse.adt.internal.editors.descriptors.DescriptorsUtils;
import com.android.ide.eclipse.adt.internal.editors.manifest.ManifestEditor;
import com.android.ide.eclipse.adt.internal.editors.ui.UiElementPart;
@@ -25,6 +24,7 @@ import com.android.ide.eclipse.adt.internal.editors.uimodel.IUiUpdateListener;
import com.android.ide.eclipse.adt.internal.editors.uimodel.IUiUpdateListener.UiUpdateState;
import com.android.ide.eclipse.adt.internal.editors.uimodel.UiElementNode;
import com.android.ide.eclipse.adt.internal.sdk.Sdk;
+import com.android.utils.SdkUtils;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
@@ -220,7 +220,7 @@ final class ApplicationToggle extends UiElementPart {
}
mUndoXmlParent.insertBefore(mUndoXmlNode, next);
if (next == null) {
- Text sep = mUndoXmlDocument.createTextNode(AdtUtils.getLineSeparator());
+ Text sep = mUndoXmlDocument.createTextNode(SdkUtils.getLineSeparator());
mUndoXmlParent.insertBefore(sep, null); // insert separator before end tag
}
success = true;
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/uimodel/UiElementNode.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/uimodel/UiElementNode.java
index b521d78fc..f905c73cc 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/uimodel/UiElementNode.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/uimodel/UiElementNode.java
@@ -27,7 +27,6 @@ import com.android.annotations.VisibleForTesting;
import com.android.ide.common.api.IAttributeInfo.Format;
import com.android.ide.common.resources.platform.AttributeInfo;
import com.android.ide.eclipse.adt.AdtPlugin;
-import com.android.ide.eclipse.adt.AdtUtils;
import com.android.ide.eclipse.adt.internal.editors.AndroidXmlEditor;
import com.android.ide.eclipse.adt.internal.editors.descriptors.AttributeDescriptor;
import com.android.ide.eclipse.adt.internal.editors.descriptors.ElementDescriptor;
@@ -42,6 +41,7 @@ import com.android.ide.eclipse.adt.internal.editors.otherxml.descriptors.OtherXm
import com.android.ide.eclipse.adt.internal.editors.uimodel.IUiUpdateListener.UiUpdateState;
import com.android.ide.eclipse.adt.internal.preferences.AdtPrefs;
import com.android.ide.eclipse.adt.internal.sdk.AndroidTargetData;
+import com.android.utils.SdkUtils;
import com.android.utils.XmlUtils;
import org.eclipse.jface.text.TextUtilities;
@@ -1035,7 +1035,7 @@ public class UiElementNode implements IPropertySource {
if (document != null) {
newLine = TextUtilities.getDefaultLineDelimiter(document);
} else {
- newLine = AdtUtils.getLineSeparator();
+ newLine = SdkUtils.getLineSeparator();
}
Text indentNode = doc.createTextNode(newLine + indent);
parentXmlNode.insertBefore(indentNode, xmlNextSibling);
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/EclipseLintClient.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/EclipseLintClient.java
index 1937a9411..b3303b350 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/EclipseLintClient.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/EclipseLintClient.java
@@ -15,9 +15,9 @@
*/
package com.android.ide.eclipse.adt.internal.lint;
-import static com.android.SdkConstants.FD_NATIVE_LIBS;
import static com.android.SdkConstants.DOT_JAR;
import static com.android.SdkConstants.DOT_XML;
+import static com.android.SdkConstants.FD_NATIVE_LIBS;
import static com.android.ide.eclipse.adt.AdtConstants.MARKER_LINT;
import static com.android.ide.eclipse.adt.AdtUtils.workspacePathToFile;
@@ -50,6 +50,7 @@ import com.android.tools.lint.detector.api.Project;
import com.android.tools.lint.detector.api.Severity;
import com.android.tools.lint.detector.api.XmlContext;
import com.android.utils.Pair;
+import com.android.utils.SdkUtils;
import com.google.common.collect.Maps;
import org.eclipse.core.resources.IFile;
@@ -673,7 +674,7 @@ public class EclipseLintClient extends LintClient implements IDomParser {
return readPlainFile(f);
}
- if (AdtUtils.endsWithIgnoreCase(file.getName(), DOT_XML)) {
+ if (SdkUtils.endsWithIgnoreCase(file.getName(), DOT_XML)) {
IStructuredModel model = null;
try {
IModelManager modelManager = StructuredModelManager.getModelManager();
@@ -813,7 +814,7 @@ public class EclipseLintClient extends LintClient implements IDomParser {
File[] jars = libs.listFiles();
if (jars != null) {
for (File jar : jars) {
- if (AdtUtils.endsWith(jar.getPath(), DOT_JAR)) {
+ if (SdkUtils.endsWith(jar.getPath(), DOT_JAR)) {
libraries.add(jar);
}
}
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintFixGenerator.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintFixGenerator.java
index 47aac0c86..5d2a2bbd9 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintFixGenerator.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintFixGenerator.java
@@ -29,6 +29,7 @@ import com.android.tools.lint.client.api.IssueRegistry;
import com.android.tools.lint.detector.api.Issue;
import com.android.tools.lint.detector.api.Project;
import com.android.tools.lint.detector.api.Severity;
+import com.android.utils.SdkUtils;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IMarker;
@@ -258,7 +259,7 @@ public class LintFixGenerator implements IMarkerResolutionGenerator2, IQuickAssi
}
IFile file = (IFile) resource;
boolean isJava = file.getName().endsWith(DOT_JAVA);
- boolean isXml = AdtUtils.endsWith(file.getName(), DOT_XML);
+ boolean isXml = SdkUtils.endsWith(file.getName(), DOT_XML);
if (!isJava && !isXml) {
return;
}
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintJob.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintJob.java
index 0442f1831..2851c47fe 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintJob.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/lint/LintJob.java
@@ -28,6 +28,7 @@ import com.android.tools.lint.client.api.IssueRegistry;
import com.android.tools.lint.client.api.LintDriver;
import com.android.tools.lint.detector.api.Issue;
import com.android.tools.lint.detector.api.Scope;
+import com.android.utils.SdkUtils;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IMarker;
@@ -93,7 +94,7 @@ final class LintJob extends Job {
scope = Scope.ALL;
} else {
String name = resource.getName();
- if (AdtUtils.endsWithIgnoreCase(name, DOT_XML)) {
+ if (SdkUtils.endsWithIgnoreCase(name, DOT_XML)) {
if (name.equals(SdkConstants.FN_ANDROID_MANIFEST_XML)) {
scope = EnumSet.of(Scope.MANIFEST);
} else {
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/ResourcePreviewHelper.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/ResourcePreviewHelper.java
index d97d17642..eeaca0cf4 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/ResourcePreviewHelper.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/ui/ResourcePreviewHelper.java
@@ -16,7 +16,7 @@
package com.android.ide.eclipse.adt.internal.ui;
import static com.android.SdkConstants.DOT_9PNG;
-import static com.android.ide.eclipse.adt.AdtUtils.endsWithIgnoreCase;
+import static com.android.utils.SdkUtils.endsWithIgnoreCase;
import com.android.ide.common.rendering.api.ResourceValue;
import com.android.ide.common.resources.ResourceResolver;
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/ProjectNamePage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/ProjectNamePage.java
index 31c722595..6bf5e28e9 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/ProjectNamePage.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newproject/ProjectNamePage.java
@@ -18,8 +18,8 @@ package com.android.ide.eclipse.adt.internal.wizards.newproject;
import static com.android.SdkConstants.FN_PROJECT_PROGUARD_FILE;
import static com.android.SdkConstants.OS_SDK_TOOLS_LIB_FOLDER;
import static com.android.ide.eclipse.adt.AdtUtils.capitalize;
-import static com.android.ide.eclipse.adt.AdtUtils.stripWhitespace;
import static com.android.ide.eclipse.adt.internal.wizards.newproject.ApplicationInfoPage.ACTIVITY_NAME_SUFFIX;
+import static com.android.utils.SdkUtils.stripWhitespace;
import com.android.SdkConstants;
import com.android.ide.common.xml.ManifestData;
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newxmlfile/NewXmlFileCreationPage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newxmlfile/NewXmlFileCreationPage.java
index e2d061b7c..68c7f4cf4 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newxmlfile/NewXmlFileCreationPage.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/newxmlfile/NewXmlFileCreationPage.java
@@ -46,6 +46,7 @@ import com.android.ide.eclipse.adt.internal.sdk.Sdk.TargetChangeListener;
import com.android.resources.ResourceFolderType;
import com.android.sdklib.IAndroidTarget;
import com.android.utils.Pair;
+import com.android.utils.SdkUtils;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
@@ -648,7 +649,7 @@ class NewXmlFileCreationPage extends WizardPage {
if (res.getType() == IResource.FOLDER) {
wsFolderPath = res.getProjectRelativePath();
} else if (res.getType() == IResource.FILE) {
- if (AdtUtils.endsWithIgnoreCase(res.getName(), DOT_XML)) {
+ if (SdkUtils.endsWithIgnoreCase(res.getName(), DOT_XML)) {
fileName = res.getName();
}
wsFolderPath = res.getParent().getProjectRelativePath();
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/TemplateHandler.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/TemplateHandler.java
index cb45522d9..f1bd84000 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/TemplateHandler.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/templates/TemplateHandler.java
@@ -42,6 +42,7 @@ import com.android.ide.eclipse.adt.internal.sdk.AdtManifestMergeCallback;
import com.android.manifmerger.ManifestMerger;
import com.android.manifmerger.MergerLog;
import com.android.resources.ResourceFolderType;
+import com.android.utils.SdkUtils;
import com.google.common.base.Charsets;
import com.google.common.collect.Lists;
import com.google.common.io.Files;
@@ -688,7 +689,7 @@ class TemplateHandler {
} else {
// Just insert into file along with comment, using the "standard" conflict
// syntax that many tools and editors recognize.
- String sep = AdtUtils.getLineSeparator();
+ String sep = SdkUtils.getLineSeparator();
contents =
"<<<<<<< Original" + sep
+ currentXml + sep