diff --git a/andmore-swt/org.eclipse.andmore.hierarchyviewer2lib/src/main/java/com/android/hierarchyviewerlib/HierarchyViewerDirector.java b/andmore-swt/org.eclipse.andmore.hierarchyviewer2lib/src/main/java/com/android/hierarchyviewerlib/HierarchyViewerDirector.java index 1a299ece..1f8f2e6e 100644 --- a/andmore-swt/org.eclipse.andmore.hierarchyviewer2lib/src/main/java/com/android/hierarchyviewerlib/HierarchyViewerDirector.java +++ b/andmore-swt/org.eclipse.andmore.hierarchyviewer2lib/src/main/java/com/android/hierarchyviewerlib/HierarchyViewerDirector.java @@ -39,7 +39,6 @@ import com.android.hierarchyviewerlib.ui.util.PsdFile; import org.eclipse.andmore.base.resources.ImageFactory; -import org.eclipse.andmore.base.resources.JFaceImageLoader; import org.eclipse.swt.SWT; import org.eclipse.swt.SWTException; import org.eclipse.swt.graphics.Image; diff --git a/android-core/plugins/org.eclipse.andmore.base/build.properties b/android-core/plugins/org.eclipse.andmore.base/build.properties index 6ffb5552..3a71c2a3 100644 --- a/android-core/plugins/org.eclipse.andmore.base/build.properties +++ b/android-core/plugins/org.eclipse.andmore.base/build.properties @@ -1,9 +1,8 @@ -output.. = bin/ -bin.includes = .,\ - libs/,\ - META-INF/,\ - plugin.xml,\ - plugin.properties,\ - about.html -jars.compile.order = . -source.. = src/ +output.. = bin/ +bin.includes = .,\ + META-INF/,\ + plugin.xml,\ + plugin.properties,\ + about.html +jars.compile.order = . +source.. = src/ diff --git a/android-core/plugins/org.eclipse.andmore.ddms/build.properties b/android-core/plugins/org.eclipse.andmore.ddms/build.properties index 8d833d5e..0122c63c 100644 --- a/android-core/plugins/org.eclipse.andmore.ddms/build.properties +++ b/android-core/plugins/org.eclipse.andmore.ddms/build.properties @@ -4,8 +4,7 @@ bin.includes = META-INF/,\ icons/,\ plugin.xml,\ .,\ - libs/,\ - schema/,\ + schema/,\ about.html,\ about.ini,\ about.properties,\ diff --git a/android-core/plugins/org.eclipse.andmore.hierarchyviewer/build.properties b/android-core/plugins/org.eclipse.andmore.hierarchyviewer/build.properties index 7e5f633d..7a8922c6 100644 --- a/android-core/plugins/org.eclipse.andmore.hierarchyviewer/build.properties +++ b/android-core/plugins/org.eclipse.andmore.hierarchyviewer/build.properties @@ -4,7 +4,6 @@ bin.includes = META-INF/,\ icons/,\ plugin.xml,\ .,\ - libs/,\ about.html,\ about.ini,\ about.properties,\ diff --git a/android-core/plugins/org.eclipse.andmore.hierarchyviewer/src/org/eclipse/andmore/hierarchyviewer/HierarchyViewerPlugin.java b/android-core/plugins/org.eclipse.andmore.hierarchyviewer/src/org/eclipse/andmore/hierarchyviewer/HierarchyViewerPlugin.java index b26adc1b..5e737cc7 100644 --- a/android-core/plugins/org.eclipse.andmore.hierarchyviewer/src/org/eclipse/andmore/hierarchyviewer/HierarchyViewerPlugin.java +++ b/android-core/plugins/org.eclipse.andmore.hierarchyviewer/src/org/eclipse/andmore/hierarchyviewer/HierarchyViewerPlugin.java @@ -23,6 +23,7 @@ import com.android.ddmlib.Log.LogLevel; import com.android.hierarchyviewerlib.HierarchyViewerDirector; +import org.eclipse.andmore.base.resources.ImageFactory; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.swt.graphics.Color; @@ -48,6 +49,7 @@ public class HierarchyViewerPlugin extends AbstractUIPlugin { // The shared instance private static HierarchyViewerPlugin sPlugin; + private HierarchyViewerDirector director; private Color mRedColor; @@ -113,7 +115,7 @@ public void run() { }); - final HierarchyViewerDirector director = HierarchyViewerPluginDirector.createDirector(); + director = HierarchyViewerPluginDirector.createDirector(); director.startListenForDevices(); // make the director receive change in ADB. @@ -150,7 +152,6 @@ public void stop(BundleContext context) throws Exception { mRedColor.dispose(); - HierarchyViewerDirector director = HierarchyViewerDirector.getDirector(); director.stopListenForDevices(); director.stopDebugBridge(); director.terminate(); @@ -205,4 +206,9 @@ private static String getMessageTag(String tag) { return String.format("[%1$tF %1$tT - %2$s]", c, tag); //$NON-NLS-1$ } + + public ImageFactory getImageFactory() { + // Director is not expected to be null because of plugin lifecycle + return director != null ? director.getImageFactory() : null; + } } diff --git a/android-core/plugins/org.eclipse.andmore.hierarchyviewer/src/org/eclipse/andmore/hierarchyviewer/views/LayoutView.java b/android-core/plugins/org.eclipse.andmore.hierarchyviewer/src/org/eclipse/andmore/hierarchyviewer/views/LayoutView.java index f19276bd..55a620d4 100644 --- a/android-core/plugins/org.eclipse.andmore.hierarchyviewer/src/org/eclipse/andmore/hierarchyviewer/views/LayoutView.java +++ b/android-core/plugins/org.eclipse.andmore.hierarchyviewer/src/org/eclipse/andmore/hierarchyviewer/views/LayoutView.java @@ -22,6 +22,7 @@ import com.android.hierarchyviewerlib.ui.LayoutViewer; import org.eclipse.andmore.base.resources.ImageFactory; +import org.eclipse.andmore.hierarchyviewer.HierarchyViewerPlugin; import org.eclipse.jface.action.Action; import org.eclipse.jface.action.IMenuManager; import org.eclipse.jface.action.IToolBarManager; @@ -76,7 +77,7 @@ public void run() { @Override public void createPartControl(Composite parent) { mShowExtrasAction.setAccelerator(SWT.MOD1 + 'E'); - ImageFactory imageFactory = HierarchyViewerDirector.getDirector().getImageFactory(); + ImageFactory imageFactory = HierarchyViewerPlugin.getPlugin().getImageFactory(); Image image = imageFactory.getImageByName("show-extras.png"); //$NON-NLS-1$ mShowExtrasAction.setImageDescriptor(ImageDescriptor.createFromImage(image)); mShowExtrasAction.setToolTipText("Show images"); diff --git a/android-core/plugins/org.eclipse.andmore.hierarchyviewer/src/org/eclipse/andmore/hierarchyviewer/views/PixelPerfectLoupeView.java b/android-core/plugins/org.eclipse.andmore.hierarchyviewer/src/org/eclipse/andmore/hierarchyviewer/views/PixelPerfectLoupeView.java index a0d74a58..b687e490 100644 --- a/android-core/plugins/org.eclipse.andmore.hierarchyviewer/src/org/eclipse/andmore/hierarchyviewer/views/PixelPerfectLoupeView.java +++ b/android-core/plugins/org.eclipse.andmore.hierarchyviewer/src/org/eclipse/andmore/hierarchyviewer/views/PixelPerfectLoupeView.java @@ -16,7 +16,6 @@ package org.eclipse.andmore.hierarchyviewer.views; -import com.android.hierarchyviewerlib.HierarchyViewerDirector; import com.android.hierarchyviewerlib.actions.PixelPerfectAutoRefreshAction; import com.android.hierarchyviewerlib.models.PixelPerfectModel; import com.android.hierarchyviewerlib.models.PixelPerfectModel.IImageChangeListener; @@ -25,6 +24,7 @@ import com.android.hierarchyviewerlib.ui.PixelPerfectPixelPanel; import org.eclipse.andmore.base.resources.ImageFactory; +import org.eclipse.andmore.hierarchyviewer.HierarchyViewerPlugin; import org.eclipse.jface.action.Action; import org.eclipse.jface.action.IMenuManager; import org.eclipse.jface.action.IToolBarManager; @@ -54,7 +54,7 @@ public void run() { @Override public void createPartControl(Composite parent) { mShowInLoupeAction.setAccelerator(SWT.MOD1 + 'S'); - ImageFactory imageFactory = HierarchyViewerDirector.getDirector().getImageFactory(); + ImageFactory imageFactory = HierarchyViewerPlugin.getPlugin().getImageFactory(); Image image = imageFactory.getImageByName("show-overlay.png"); //$NON-NLS-1$ mShowInLoupeAction.setImageDescriptor(ImageDescriptor.createFromImage(image)); mShowInLoupeAction.setToolTipText("Show the overlay in the loupe view"); diff --git a/android-core/plugins/org.eclipse.andmore.traceview/build.properties b/android-core/plugins/org.eclipse.andmore.traceview/build.properties index e646329a..8cb84c4d 100644 --- a/android-core/plugins/org.eclipse.andmore.traceview/build.properties +++ b/android-core/plugins/org.eclipse.andmore.traceview/build.properties @@ -1,11 +1,10 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - libs/,\ - plugin.xml,\ - icons/,\ - about.ini,\ - about.properties,\ - plugin.properties,\ - about.html +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.xml,\ + icons/,\ + about.ini,\ + about.properties,\ + plugin.properties,\ + about.html