aboutsummaryrefslogtreecommitdiffstats
path: root/eclipse/plugins/com.android.ide.eclipse.adt
diff options
context:
space:
mode:
authorXavier Ducrohet <xav@android.com>2010-06-22 17:55:45 -0700
committerXavier Ducrohet <xav@android.com>2010-06-24 12:45:23 -0700
commite312b2800018fcfe7fad0b1c883127f1364a17d0 (patch)
tree96387c7e4c71e7ffa79d08223da9cc512fd3371f /eclipse/plugins/com.android.ide.eclipse.adt
parent44bee48407df99d758a36b24ae68077006de0c63 (diff)
downloadsdk-e312b2800018fcfe7fad0b1c883127f1364a17d0.zip
sdk-e312b2800018fcfe7fad0b1c883127f1364a17d0.tar.gz
sdk-e312b2800018fcfe7fad0b1c883127f1364a17d0.tar.bz2
Make ddmlib/ddmuilib jar files inside the ddms plug-in instead of symlinks.
Also cleaned up the abstraction layer to load images from ddmuilib since its image are now always located inside ddmuilib jar. Change-Id: Id9d283df18a05b7b5593e4593e90dac6e5548b94
Diffstat (limited to 'eclipse/plugins/com.android.ide.eclipse.adt')
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/.classpath22
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/META-INF/MANIFEST.MF22
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/build.properties14
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/libs/.gitignore1
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtPlugin.java15
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/DeviceChooserDialog.java40
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/EmulatorConfigTab.java5
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/MainLaunchConfigTab.java7
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/junit/AndroidJUnitLaunchConfigurationTab.java4
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/export/ProjectCheckPage.java6
10 files changed, 53 insertions, 83 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/.classpath b/eclipse/plugins/com.android.ide.eclipse.adt/.classpath
index e4e1d37..72ca4ed 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/.classpath
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/.classpath
@@ -3,15 +3,17 @@
<classpathentry excluding="Makefile|resources/" kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="lib" path="androidprefs.jar" sourcepath="/AndroidPrefs"/>
- <classpathentry kind="lib" path="sdkstats.jar" sourcepath="/SdkStatsService"/>
- <classpathentry kind="lib" path="kxml2-2.3.0.jar"/>
- <classpathentry kind="lib" path="layoutlib_api.jar"/>
- <classpathentry kind="lib" path="layoutlib_utils.jar"/>
- <classpathentry kind="lib" path="ninepatch.jar"/>
- <classpathentry kind="lib" path="sdklib.jar" sourcepath="/SdkLib"/>
- <classpathentry kind="lib" path="sdkuilib.jar" sourcepath="/SdkUiLib"/>
- <classpathentry kind="lib" path="commons-compress-1.0.jar"/>
- <classpathentry kind="lib" path="groovy-all-1.7.0.jar" sourcepath="/GroovySrc/groovy-src-1.7.0.zip"/>
+ <classpathentry kind="lib" path="libs/androidprefs.jar" sourcepath="/AndroidPrefs"/>
+ <classpathentry kind="lib" path="libs/commons-compress-1.0.jar"/>
+ <classpathentry kind="lib" path="libs/groovy-all-1.7.0.jar" sourcepath="/GroovySrc/groovy-src-1.7.0.zip"/>
+ <classpathentry kind="lib" path="libs/kxml2-2.3.0.jar"/>
+ <classpathentry kind="lib" path="libs/layoutlib_api.jar"/>
+ <classpathentry kind="lib" path="libs/layoutlib_utils.jar"/>
+ <classpathentry kind="lib" path="libs/ninepatch.jar"/>
+ <classpathentry kind="lib" path="libs/sdklib.jar" sourcepath="/SdkLib"/>
+ <classpathentry kind="lib" path="libs/sdkstats.jar" sourcepath="/SdkStatsService"/>
+ <classpathentry kind="lib" path="libs/sdkuilib.jar" sourcepath="/SdkUiLib"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/ddmlib"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/ddmuilib"/>
<classpathentry kind="output" path="bin"/>
</classpath>
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 729a997..25e8d3d 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
@@ -4,16 +4,16 @@ Bundle-Name: Android Development Toolkit
Bundle-SymbolicName: com.android.ide.eclipse.adt;singleton:=true
Bundle-Version: 0.9.8.qualifier
Bundle-ClassPath: .,
- androidprefs.jar,
- sdkstats.jar,
- kxml2-2.3.0.jar,
- layoutlib_api.jar,
- ninepatch.jar,
- layoutlib_utils.jar,
- sdklib.jar,
- sdkuilib.jar,
- commons-compress-1.0.jar,
- groovy-all-1.7.0.jar
+ libs/androidprefs.jar,
+ libs/sdklib.jar,
+ libs/sdkuilib.jar,
+ libs/ninepatch.jar,
+ libs/sdkstats.jar,
+ libs/commons-compress-1.0.jar,
+ libs/groovy-all-1.7.0.jar,
+ libs/kxml2-2.3.0.jar,
+ libs/layoutlib_api.jar,
+ libs/layoutlib_utils.jar
Bundle-Activator: com.android.ide.eclipse.adt.AdtPlugin
Bundle-Vendor: The Android Open Source Project
Require-Bundle: com.android.ide.eclipse.ddms,
@@ -54,6 +54,7 @@ Export-Package: com.android.ide.eclipse.adt;x-friends:="com.android.ide.eclipse.
com.android.ide.eclipse.adt.internal.build;x-friends:="com.android.ide.eclipse.tests",
com.android.ide.eclipse.adt.internal.editors;x-friends:="com.android.ide.eclipse.tests",
com.android.ide.eclipse.adt.internal.editors.descriptors;x-friends:="com.android.ide.eclipse.tests",
+ com.android.ide.eclipse.adt.internal.editors.export;x-friends:="com.android.ide.eclipse.tests",
com.android.ide.eclipse.adt.internal.editors.layout;x-friends:="com.android.ide.eclipse.tests",
com.android.ide.eclipse.adt.internal.editors.layout.configuration;x-friends:="com.android.ide.eclipse.tests",
com.android.ide.eclipse.adt.internal.editors.layout.descriptors;x-friends:="com.android.ide.eclipse.tests",
@@ -98,6 +99,7 @@ Export-Package: com.android.ide.eclipse.adt;x-friends:="com.android.ide.eclipse.
com.android.ninepatch;x-friends:="com.android.ide.eclipse.tests",
com.android.prefs;x-friends:="com.android.ide.eclipse.tests",
com.android.sdklib;x-friends:="com.android.ide.eclipse.tests",
+ com.android.sdklib.build;x-friends:="com.android.ide.eclipse.tests",
com.android.sdklib.internal.avd;x-friends:="com.android.ide.eclipse.tests",
com.android.sdklib.internal.build;x-friends:="com.android.ide.eclipse.tests",
com.android.sdklib.internal.export;x-friends:="com.android.ide.eclipse.tests",
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/build.properties b/eclipse/plugins/com.android.ide.eclipse.adt/build.properties
index 6fd3a05..12ba0bb 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/build.properties
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/build.properties
@@ -4,16 +4,8 @@ bin.includes = plugin.xml,\
.,\
templates/,\
about.ini,\
- androidprefs.jar,\
- sdkstats.jar,\
- kxml2-2.3.0.jar,\
- layoutlib_api.jar,\
- layoutlib_utils.jar,\
- ninepatch.jar,\
- sdklib.jar,\
- sdkuilib.jar,\
- commons-compress-1.0.jar,\
- groovy-all-1.7.0.jar,\
- gscripts/
+ gscripts/,\
+ libs/
source.. = src/
output.. = bin/
+bin.excludes = libs/.gitignore
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/libs/.gitignore b/eclipse/plugins/com.android.ide.eclipse.adt/libs/.gitignore
new file mode 100644
index 0000000..d392f0e
--- /dev/null
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/libs/.gitignore
@@ -0,0 +1 @@
+*.jar
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtPlugin.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtPlugin.java
index a9336b2..c6fda52 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtPlugin.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/AdtPlugin.java
@@ -46,7 +46,6 @@ import com.android.ide.eclipse.adt.internal.sdk.Sdk.ITargetChangeListener;
import com.android.ide.eclipse.adt.internal.ui.EclipseUiHelper;
import com.android.ide.eclipse.adt.internal.wizards.export.ExportWizard;
import com.android.ide.eclipse.ddms.DdmsPlugin;
-import com.android.ide.eclipse.ddms.ImageLoader;
import com.android.sdklib.IAndroidTarget;
import com.android.sdklib.SdkConstants;
import com.android.sdkstats.SdkStatsService;
@@ -136,9 +135,6 @@ public class AdtPlugin extends AbstractUIPlugin {
/** Stream to write error messages to the android console */
private MessageConsoleStream mAndroidConsoleErrorStream;
- /** Image loader object */
- private ImageLoader mLoader;
-
/** Color used in the error console */
private Color mRed;
@@ -297,9 +293,6 @@ public class AdtPlugin extends AbstractUIPlugin {
// check the location of SDK
final boolean isSdkLocationValid = checkSdkLocationAndId();
- // create the loader that's able to load the images
- mLoader = new ImageLoader(this);
-
// start the DdmsPlugin by setting the adb location, only if it is set already.
String osSdkLocation = AdtPrefs.getPrefs().getOsSdkFolder();
if (osSdkLocation.length() > 0) {
@@ -385,14 +378,6 @@ public class AdtPlugin extends AbstractUIPlugin {
}
}
- /** Return the image loader for the plugin */
- public static synchronized ImageLoader getImageLoader() {
- if (sPlugin != null) {
- return sPlugin.mLoader;
- }
- return null;
- }
-
/**
* Returns the shared instance
*
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/DeviceChooserDialog.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/DeviceChooserDialog.java
index d6c9cd8..a9c8af8 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/DeviceChooserDialog.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/DeviceChooserDialog.java
@@ -21,10 +21,9 @@ import com.android.ddmlib.Client;
import com.android.ddmlib.IDevice;
import com.android.ddmlib.AndroidDebugBridge.IDeviceChangeListener;
import com.android.ddmlib.IDevice.DeviceState;
-import com.android.ddmuilib.IImageLoader;
-import com.android.ddmuilib.ImageHelper;
+import com.android.ddmuilib.ImageLoader;
import com.android.ddmuilib.TableHelper;
-import com.android.ide.eclipse.adt.AdtPlugin;
+import com.android.ide.eclipse.adt.internal.editors.IconFactory;
import com.android.ide.eclipse.adt.internal.sdk.AdtConsoleSdkLog;
import com.android.ide.eclipse.adt.internal.sdk.Sdk;
import com.android.ide.eclipse.ddms.DdmsPlugin;
@@ -254,12 +253,6 @@ public class DeviceChooserDialog extends Dialog implements IDeviceChangeListener
private void cleanup() {
// done listening.
AndroidDebugBridge.removeDeviceChangeListener(this);
-
- mEmulatorImage.dispose();
- mDeviceImage.dispose();
- mMatchImage.dispose();
- mNoMatchImage.dispose();
- mWarningImage.dispose();
}
@Override
@@ -440,41 +433,38 @@ public class DeviceChooserDialog extends Dialog implements IDeviceChangeListener
}
private void loadImages() {
- IImageLoader ddmsLoader = DdmsPlugin.getImageLoader();
+ ImageLoader ddmUiLibLoader = ImageLoader.getDdmUiLibLoader();
Display display = DdmsPlugin.getDisplay();
- IImageLoader adtLoader = AdtPlugin.getImageLoader();
+ IconFactory factory = IconFactory.getInstance();
if (mDeviceImage == null) {
- mDeviceImage = ImageHelper.loadImage(ddmsLoader, display,
+ mDeviceImage = ddmUiLibLoader.loadImage(display,
"device.png", //$NON-NLS-1$
ICON_WIDTH, ICON_WIDTH,
display.getSystemColor(SWT.COLOR_RED));
}
if (mEmulatorImage == null) {
- mEmulatorImage = ImageHelper.loadImage(ddmsLoader, display,
+ mEmulatorImage = ddmUiLibLoader.loadImage(display,
"emulator.png", ICON_WIDTH, ICON_WIDTH, //$NON-NLS-1$
display.getSystemColor(SWT.COLOR_BLUE));
}
if (mMatchImage == null) {
- mMatchImage = ImageHelper.loadImage(adtLoader, display,
- "match.png", //$NON-NLS-1$
- ICON_WIDTH, ICON_WIDTH,
- display.getSystemColor(SWT.COLOR_GREEN));
+ mMatchImage = factory.getIcon("match", //$NON-NLS-1$
+ IconFactory.COLOR_GREEN,
+ IconFactory.SHAPE_DEFAULT);
}
if (mNoMatchImage == null) {
- mNoMatchImage = ImageHelper.loadImage(adtLoader, display,
- "error.png", //$NON-NLS-1$
- ICON_WIDTH, ICON_WIDTH,
- display.getSystemColor(SWT.COLOR_RED));
+ mNoMatchImage = factory.getIcon("error", //$NON-NLS-1$
+ IconFactory.COLOR_RED,
+ IconFactory.SHAPE_DEFAULT);
}
if (mWarningImage == null) {
- mWarningImage = ImageHelper.loadImage(adtLoader, display,
- "warning.png", //$NON-NLS-1$
- ICON_WIDTH, ICON_WIDTH,
- display.getSystemColor(SWT.COLOR_YELLOW));
+ mNoMatchImage = factory.getIcon("warning", //$NON-NLS-1$
+ SWT.COLOR_YELLOW,
+ IconFactory.SHAPE_DEFAULT);
}
}
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/EmulatorConfigTab.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/EmulatorConfigTab.java
index a4c7c1f..3705cc2 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/EmulatorConfigTab.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/EmulatorConfigTab.java
@@ -16,13 +16,13 @@
package com.android.ide.eclipse.adt.internal.launch;
+import com.android.ddmuilib.ImageLoader;
import com.android.ide.eclipse.adt.AdtPlugin;
import com.android.ide.eclipse.adt.internal.launch.AndroidLaunchConfiguration.TargetMode;
import com.android.ide.eclipse.adt.internal.preferences.AdtPrefs;
import com.android.ide.eclipse.adt.internal.project.BaseProjectHelper;
import com.android.ide.eclipse.adt.internal.sdk.AdtConsoleSdkLog;
import com.android.ide.eclipse.adt.internal.sdk.Sdk;
-import com.android.ide.eclipse.ddms.DdmsPlugin;
import com.android.prefs.AndroidLocation.AndroidLocationException;
import com.android.sdklib.IAndroidTarget;
import com.android.sdklib.NullSdkLog;
@@ -306,10 +306,9 @@ public class EmulatorConfigTab extends AbstractLaunchConfigurationTab {
@Override
public Image getImage() {
- return DdmsPlugin.getImageLoader().loadImage("emulator.png", null); //$NON-NLS-1$
+ return ImageLoader.getDdmUiLibLoader().loadImage("emulator.png", null); //$NON-NLS-1$
}
-
private void updateAvdList(AvdManager avdManager) {
if (avdManager == null) {
avdManager = Sdk.getCurrent().getAvdManager();
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/MainLaunchConfigTab.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/MainLaunchConfigTab.java
index 6ef204c..7f49bc6 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/MainLaunchConfigTab.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/MainLaunchConfigTab.java
@@ -16,7 +16,7 @@
package com.android.ide.eclipse.adt.internal.launch;
-import com.android.ide.eclipse.adt.AdtPlugin;
+import com.android.ide.eclipse.adt.internal.editors.IconFactory;
import com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper;
import com.android.ide.eclipse.adt.internal.project.ProjectChooserHelper;
import com.android.ide.eclipse.adt.internal.project.ProjectChooserHelper.NonLibraryProjectOnlyFilter;
@@ -62,7 +62,7 @@ public class MainLaunchConfigTab extends AbstractLaunchConfigurationTab {
/**
*
*/
- public static final String LAUNCH_TAB_IMAGE = "mainLaunchTab.png"; //$NON-NLS-1$
+ public static final String LAUNCH_TAB_IMAGE = "mainLaunchTab"; //$NON-NLS-1$
protected static final String EMPTY_STRING = ""; //$NON-NLS-1$
@@ -204,10 +204,9 @@ public class MainLaunchConfigTab extends AbstractLaunchConfigurationTab {
@Override
public Image getImage() {
- return AdtPlugin.getImageLoader().loadImage(LAUNCH_TAB_IMAGE, null);
+ return IconFactory.getInstance().getIcon(LAUNCH_TAB_IMAGE);
}
-
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
configuration.setAttribute(
IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, mProjText.getText());
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/junit/AndroidJUnitLaunchConfigurationTab.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/junit/AndroidJUnitLaunchConfigurationTab.java
index 4aacf5c..cd22110 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/junit/AndroidJUnitLaunchConfigurationTab.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/launch/junit/AndroidJUnitLaunchConfigurationTab.java
@@ -17,6 +17,7 @@ package com.android.ide.eclipse.adt.internal.launch.junit;
import com.android.ide.eclipse.adt.AdtPlugin;
import com.android.ide.eclipse.adt.AndroidConstants;
+import com.android.ide.eclipse.adt.internal.editors.IconFactory;
import com.android.ide.eclipse.adt.internal.launch.LaunchMessages;
import com.android.ide.eclipse.adt.internal.launch.MainLaunchConfigTab;
import com.android.ide.eclipse.adt.internal.project.BaseProjectHelper;
@@ -491,8 +492,7 @@ public class AndroidJUnitLaunchConfigurationTab extends AbstractLaunchConfigurat
public Image getImage() {
// reuse icon from the Android App Launch config tab
if (mTabIcon == null) {
- mTabIcon = AdtPlugin.getImageLoader().loadImage(MainLaunchConfigTab.LAUNCH_TAB_IMAGE,
- null);
+ mTabIcon = IconFactory.getInstance().getIcon(MainLaunchConfigTab.LAUNCH_TAB_IMAGE);
}
return mTabIcon;
}
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/export/ProjectCheckPage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/export/ProjectCheckPage.java
index 631bb5f..d91113d 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/export/ProjectCheckPage.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/wizards/export/ProjectCheckPage.java
@@ -16,8 +16,8 @@
package com.android.ide.eclipse.adt.internal.wizards.export;
-import com.android.ide.eclipse.adt.AdtPlugin;
import com.android.ide.eclipse.adt.AndroidConstants;
+import com.android.ide.eclipse.adt.internal.editors.IconFactory;
import com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper;
import com.android.ide.eclipse.adt.internal.project.BaseProjectHelper;
import com.android.ide.eclipse.adt.internal.project.ProjectChooserHelper;
@@ -227,7 +227,7 @@ final class ProjectCheckPage extends ExportWizardPage {
*/
private void addError(Composite parent, String message) {
if (mError == null) {
- mError = AdtPlugin.getImageLoader().loadImage(IMG_ERROR, mDisplay);
+ mError = IconFactory.getInstance().getIcon(IMG_ERROR);
}
new Label(parent, SWT.NONE).setImage(mError);
@@ -247,7 +247,7 @@ final class ProjectCheckPage extends ExportWizardPage {
*/
private void addWarning(Composite parent, String message) {
if (mWarning == null) {
- mWarning = AdtPlugin.getImageLoader().loadImage(IMG_WARNING, mDisplay);
+ mWarning = IconFactory.getInstance().getIcon(IMG_WARNING);
}
new Label(parent, SWT.NONE).setImage(mWarning);