Skip to content
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.

Commit

Permalink
[Bug 526437] - Android SWT Libraries need to be forked
Browse files Browse the repository at this point in the history
1. Bug fix changed 4 build.properties each referencing an empty libs
folder which Git did not retain on last commit
2. Code review changed 2 hierarchyveiwer classes to get ImageFactory
from plugin in same module instead of refering to external ddmuilib

Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=526437
Signed-off-by: Andrew Bowley <[email protected]>
  • Loading branch information
Kys3rK1ng committed Dec 2, 2017
1 parent f15fa7b commit 7f9fa2c
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
17 changes: 8 additions & 9 deletions android-core/plugins/org.eclipse.andmore.base/build.properties
Original file line number Diff line number Diff line change
@@ -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/
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ bin.includes = META-INF/,\
icons/,\
plugin.xml,\
.,\
libs/,\
schema/,\
schema/,\
about.html,\
about.ini,\
about.properties,\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ bin.includes = META-INF/,\
icons/,\
plugin.xml,\
.,\
libs/,\
about.html,\
about.ini,\
about.properties,\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -48,6 +49,7 @@ public class HierarchyViewerPlugin extends AbstractUIPlugin {

// The shared instance
private static HierarchyViewerPlugin sPlugin;
private HierarchyViewerDirector director;

private Color mRedColor;

Expand Down Expand Up @@ -113,7 +115,7 @@ public void run() {

});

final HierarchyViewerDirector director = HierarchyViewerPluginDirector.createDirector();
director = HierarchyViewerPluginDirector.createDirector();
director.startListenForDevices();

// make the director receive change in ADB.
Expand Down Expand Up @@ -150,7 +152,6 @@ public void stop(BundleContext context) throws Exception {

mRedColor.dispose();

HierarchyViewerDirector director = HierarchyViewerDirector.getDirector();
director.stopListenForDevices();
director.stopDebugBridge();
director.terminate();
Expand Down Expand Up @@ -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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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");
Expand Down
21 changes: 10 additions & 11 deletions android-core/plugins/org.eclipse.andmore.traceview/build.properties
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 7f9fa2c

Please sign in to comment.