diff --git a/com.ibm.wala.core/src/com/ibm/wala/viz/SWTTreeViewer.java b/com.ibm.wala.core/src/com/ibm/wala/viz/SWTTreeViewer.java index c0f0db911..179f0bfdd 100644 --- a/com.ibm.wala.core/src/com/ibm/wala/viz/SWTTreeViewer.java +++ b/com.ibm.wala.core/src/com/ibm/wala/viz/SWTTreeViewer.java @@ -38,56 +38,44 @@ public class SWTTreeViewer extends AbstractJFaceRunner { protected Graph graphInput; - protected Collection rootsInput = null; - protected NodeDecorator nodeDecoratorInput = null; - final protected List popUpActions = new LinkedList(); - public SWTTreeViewer() { super(); } - public Graph getGraphInput() { return graphInput; } - public void setGraphInput(Graph newGraphInput) { graphInput = newGraphInput; } - public Collection getRootsInput() { return rootsInput; } - public void setRootsInput(Collection newRootsInput) { rootsInput = newRootsInput; } - public NodeDecorator getNodeDecoratorInput() { return nodeDecoratorInput; } - public void setNodeDecoratorInput(NodeDecorator newNodeDecoratorInput) { nodeDecoratorInput = newNodeDecoratorInput; } - public List getPopUpActions() { return popUpActions; } - @Override public String toString() { StringBuffer result = new StringBuffer(super.toString()); @@ -131,19 +119,26 @@ public class SWTTreeViewer extends AbstractJFaceRunner { d.asyncExec(r); } } else { - Runnable r = new Runnable() { - public void run() { - w.open(); - Display.getCurrent().dispose(); - } - }; - Thread t = new Thread(r); - t.start(); - if (isBlockInput()) { - try { - t.join(); - } catch (InterruptedException e) { - throw new WalaException("unexpected interruption", e); + if (System.getProperty("mrj.version") != null) { + // the Mac does not like running the Window code in another thread + // side-effect: we always block input on Mac + w.open(); + Display.getCurrent().dispose(); + } else { + Runnable r = new Runnable() { + public void run() { + w.open(); + Display.getCurrent().dispose(); + } + }; + Thread t = new Thread(r); + t.start(); + if (isBlockInput()) { + try { + t.join(); + } catch (InterruptedException e) { + throw new WalaException("unexpected interruption", e); + } } } } @@ -212,8 +207,7 @@ public class SWTTreeViewer extends AbstractJFaceRunner { /** * @author sfink * - * Simple wrapper around an EObjectGraph to provide content for a tree - * viewer. + * Simple wrapper around an EObjectGraph to provide content for a tree viewer. */ private class GraphContentProvider implements ITreeContentProvider {