fix for mac
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@2759 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
This commit is contained in:
parent
3f293dcc60
commit
11f7a55b2e
|
@ -38,56 +38,44 @@ public class SWTTreeViewer extends AbstractJFaceRunner {
|
||||||
|
|
||||||
protected Graph graphInput;
|
protected Graph graphInput;
|
||||||
|
|
||||||
|
|
||||||
protected Collection<? extends Object> rootsInput = null;
|
protected Collection<? extends Object> rootsInput = null;
|
||||||
|
|
||||||
|
|
||||||
protected NodeDecorator nodeDecoratorInput = null;
|
protected NodeDecorator nodeDecoratorInput = null;
|
||||||
|
|
||||||
|
|
||||||
final protected List<IAction> popUpActions = new LinkedList<IAction>();
|
final protected List<IAction> popUpActions = new LinkedList<IAction>();
|
||||||
|
|
||||||
|
|
||||||
public SWTTreeViewer() {
|
public SWTTreeViewer() {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Graph getGraphInput() {
|
public Graph getGraphInput() {
|
||||||
return graphInput;
|
return graphInput;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setGraphInput(Graph newGraphInput) {
|
public void setGraphInput(Graph newGraphInput) {
|
||||||
graphInput = newGraphInput;
|
graphInput = newGraphInput;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Collection<? extends Object> getRootsInput() {
|
public Collection<? extends Object> getRootsInput() {
|
||||||
return rootsInput;
|
return rootsInput;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setRootsInput(Collection<? extends Object> newRootsInput) {
|
public void setRootsInput(Collection<? extends Object> newRootsInput) {
|
||||||
rootsInput = newRootsInput;
|
rootsInput = newRootsInput;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public NodeDecorator getNodeDecoratorInput() {
|
public NodeDecorator getNodeDecoratorInput() {
|
||||||
return nodeDecoratorInput;
|
return nodeDecoratorInput;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setNodeDecoratorInput(NodeDecorator newNodeDecoratorInput) {
|
public void setNodeDecoratorInput(NodeDecorator newNodeDecoratorInput) {
|
||||||
nodeDecoratorInput = newNodeDecoratorInput;
|
nodeDecoratorInput = newNodeDecoratorInput;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public List<IAction> getPopUpActions() {
|
public List<IAction> getPopUpActions() {
|
||||||
return popUpActions;
|
return popUpActions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
StringBuffer result = new StringBuffer(super.toString());
|
StringBuffer result = new StringBuffer(super.toString());
|
||||||
|
@ -131,19 +119,26 @@ public class SWTTreeViewer extends AbstractJFaceRunner {
|
||||||
d.asyncExec(r);
|
d.asyncExec(r);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Runnable r = new Runnable() {
|
if (System.getProperty("mrj.version") != null) {
|
||||||
public void run() {
|
// the Mac does not like running the Window code in another thread
|
||||||
w.open();
|
// side-effect: we always block input on Mac
|
||||||
Display.getCurrent().dispose();
|
w.open();
|
||||||
}
|
Display.getCurrent().dispose();
|
||||||
};
|
} else {
|
||||||
Thread t = new Thread(r);
|
Runnable r = new Runnable() {
|
||||||
t.start();
|
public void run() {
|
||||||
if (isBlockInput()) {
|
w.open();
|
||||||
try {
|
Display.getCurrent().dispose();
|
||||||
t.join();
|
}
|
||||||
} catch (InterruptedException e) {
|
};
|
||||||
throw new WalaException("unexpected interruption", e);
|
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
|
* @author sfink
|
||||||
*
|
*
|
||||||
* Simple wrapper around an EObjectGraph to provide content for a tree
|
* Simple wrapper around an EObjectGraph to provide content for a tree viewer.
|
||||||
* viewer.
|
|
||||||
*/
|
*/
|
||||||
private class GraphContentProvider implements ITreeContentProvider {
|
private class GraphContentProvider implements ITreeContentProvider {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue