Lines 1-5
Link Here
|
1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
2 |
* Copyright (c) 2007 IBM Corporation and others. |
2 |
* Copyright (c) 2007, 2009 IBM Corporation and others. |
3 |
* All rights reserved. This program and the accompanying materials |
3 |
* All rights reserved. This program and the accompanying materials |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
5 |
* which accompanies this distribution, and is available at |
5 |
* which accompanies this distribution, and is available at |
Lines 13-18
Link Here
|
13 |
import org.eclipse.swt.*; |
13 |
import org.eclipse.swt.*; |
14 |
import org.eclipse.swt.graphics.*; |
14 |
import org.eclipse.swt.graphics.*; |
15 |
import org.eclipse.swt.widgets.*; |
15 |
import org.eclipse.swt.widgets.*; |
|
|
16 |
|
16 |
import java.io.*; |
17 |
import java.io.*; |
17 |
|
18 |
|
18 |
/** |
19 |
/** |
Lines 27-33
Link Here
|
27 |
Shell shell; |
28 |
Shell shell; |
28 |
List list; |
29 |
List list; |
29 |
Canvas canvas; |
30 |
Canvas canvas; |
30 |
Button start, stop, check; |
31 |
Button start, stop, check, print; |
31 |
Text text; |
32 |
Text text; |
32 |
Label label; |
33 |
Label label; |
33 |
|
34 |
|
Lines 99-104
Link Here
|
99 |
refreshDifference (); |
100 |
refreshDifference (); |
100 |
} |
101 |
} |
101 |
}); |
102 |
}); |
|
|
103 |
print = new Button (shell, SWT.PUSH); |
104 |
print.setText ("Print"); |
105 |
print.setToolTipText ("Prints stack traces to standard output"); |
106 |
print.addListener (SWT.Selection, new Listener () { |
107 |
public void handleEvent(Event event) { |
108 |
exportDifference (); |
109 |
} |
110 |
}); |
102 |
label = new Label (shell, SWT.BORDER); |
111 |
label = new Label (shell, SWT.BORDER); |
103 |
label.setText ("0 object(s)"); |
112 |
label.setText ("0 object(s)"); |
104 |
shell.addListener (SWT.Resize, new Listener () { |
113 |
shell.addListener (SWT.Resize, new Listener () { |
Lines 185-190
Link Here
|
185 |
layout (); |
194 |
layout (); |
186 |
} |
195 |
} |
187 |
|
196 |
|
|
|
197 |
void exportDifference () { |
198 |
for (int i=0; i<objects.length; i++) { |
199 |
System.out.println(objects [i].toString()); |
200 |
errors[i].printStackTrace(System.out); |
201 |
System.out.println(); |
202 |
} |
203 |
} |
204 |
|
188 |
void toggleStackTrace () { |
205 |
void toggleStackTrace () { |
189 |
refreshObject (); |
206 |
refreshObject (); |
190 |
layout (); |
207 |
layout (); |
Lines 304-316
Link Here
|
304 |
Point size2 = stop.computeSize (SWT.DEFAULT, SWT.DEFAULT); |
321 |
Point size2 = stop.computeSize (SWT.DEFAULT, SWT.DEFAULT); |
305 |
Point size3 = check.computeSize (SWT.DEFAULT, SWT.DEFAULT); |
322 |
Point size3 = check.computeSize (SWT.DEFAULT, SWT.DEFAULT); |
306 |
Point size4 = label.computeSize (SWT.DEFAULT, SWT.DEFAULT); |
323 |
Point size4 = label.computeSize (SWT.DEFAULT, SWT.DEFAULT); |
307 |
width = Math.max (size1.x, Math.max (size2.x, Math.max (size3.x, width))); |
324 |
Point size5 = print.computeSize(SWT.DEFAULT, SWT.DEFAULT); |
|
|
325 |
width = Math.max (size1.x, Math.max (size2.x, Math.max (size3.x, Math.max(size5.x, width)))); |
308 |
width = Math.max (64, Math.max (size4.x, list.computeSize (width, SWT.DEFAULT).x)); |
326 |
width = Math.max (64, Math.max (size4.x, list.computeSize (width, SWT.DEFAULT).x)); |
309 |
start.setBounds (0, 0, width, size1.y); |
327 |
start.setBounds (0, 0, width, size1.y); |
310 |
stop.setBounds (0, size1.y, width, size2.y); |
328 |
stop.setBounds (0, size1.y, width, size2.y); |
311 |
check.setBounds (0, size1.y + size2.y, width, size3.y); |
329 |
print.setBounds(0, size1.y + size2.y, width, size5.y); |
|
|
330 |
check.setBounds (0, size1.y + size2.y + size5.y, width, size3.y); |
312 |
label.setBounds (0, rect.height - size4.y, width, size4.y); |
331 |
label.setBounds (0, rect.height - size4.y, width, size4.y); |
313 |
int height = size1.y + size2.y + size3.y; |
332 |
int height = size1.y + size2.y + size3.y + size5.y; |
314 |
list.setBounds (0, height, width, rect.height - height - size4.y); |
333 |
list.setBounds (0, height, width, rect.height - height - size4.y); |
315 |
text.setBounds (width, 0, rect.width - width, rect.height); |
334 |
text.setBounds (width, 0, rect.width - width, rect.height); |
316 |
canvas.setBounds (width, 0, rect.width - width, rect.height); |
335 |
canvas.setBounds (width, 0, rect.width - width, rect.height); |