|
1 /* |
|
2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 package com.nokia.s60tools.crashanalyser.ui.editors; |
|
19 |
|
20 import java.util.HashMap; |
|
21 import java.util.List; |
|
22 import java.util.Map; |
|
23 |
|
24 import org.eclipse.jface.resource.FontRegistry; |
|
25 import org.eclipse.swt.SWT; |
|
26 import org.eclipse.swt.custom.SashForm; |
|
27 import org.eclipse.swt.events.SelectionEvent; |
|
28 import org.eclipse.swt.events.SelectionListener; |
|
29 import org.eclipse.swt.graphics.FontData; |
|
30 import org.eclipse.swt.layout.FormAttachment; |
|
31 import org.eclipse.swt.layout.FormData; |
|
32 import org.eclipse.swt.layout.FormLayout; |
|
33 import org.eclipse.swt.layout.GridData; |
|
34 import org.eclipse.swt.layout.GridLayout; |
|
35 import org.eclipse.swt.widgets.Combo; |
|
36 import org.eclipse.swt.widgets.Composite; |
|
37 import org.eclipse.swt.widgets.Display; |
|
38 import org.eclipse.swt.widgets.Group; |
|
39 import org.eclipse.swt.widgets.Table; |
|
40 import org.eclipse.swt.widgets.TableColumn; |
|
41 import org.eclipse.swt.widgets.TableItem; |
|
42 import org.eclipse.swt.widgets.Text; |
|
43 import org.eclipse.ui.PlatformUI; |
|
44 |
|
45 import com.nokia.s60tools.crashanalyser.containers.CodeSegment; |
|
46 import com.nokia.s60tools.crashanalyser.containers.EventLog; |
|
47 import com.nokia.s60tools.crashanalyser.containers.Process; |
|
48 import com.nokia.s60tools.crashanalyser.containers.Register; |
|
49 import com.nokia.s60tools.crashanalyser.containers.RegisterBit; |
|
50 import com.nokia.s60tools.crashanalyser.containers.RegisterDetails; |
|
51 import com.nokia.s60tools.crashanalyser.containers.RegisterSet; |
|
52 import com.nokia.s60tools.crashanalyser.containers.Thread; |
|
53 import com.nokia.s60tools.crashanalyser.files.CrashFile; |
|
54 import com.nokia.s60tools.crashanalyser.files.SummaryFile; |
|
55 import com.nokia.s60tools.crashanalyser.resources.HelpContextIDs; |
|
56 import com.nokia.s60tools.crashanalyser.ui.viewers.CodeSegmentsTableViewer; |
|
57 |
|
58 /** |
|
59 * Advanced page in Crash Visualiser editor. |
|
60 * |
|
61 */ |
|
62 public class AdvancedPage implements SelectionListener{ |
|
63 |
|
64 // registers group UI items |
|
65 Combo comboRegisters; |
|
66 Table tableRegisters; |
|
67 |
|
68 // code segments group UI items |
|
69 Table tableCodeSegments; |
|
70 CodeSegmentsTableViewer tableViewerCodeSegments; |
|
71 |
|
72 // event log group UI items |
|
73 Table tableEventLog; |
|
74 |
|
75 // CPSR details group UI items |
|
76 Group groupCpsrEmpty; |
|
77 Combo comboCpsrDetails; |
|
78 Table tableCpsrDetails; |
|
79 |
|
80 FontRegistry fontRegistry; |
|
81 SummaryFile crashFile; |
|
82 Process selectedProcess = null; |
|
83 Thread selectedThread = null; |
|
84 |
|
85 /** |
|
86 * Creates the page |
|
87 * @param parent composite |
|
88 * @param file summary file |
|
89 * @return composite |
|
90 */ |
|
91 public Composite createPage(Composite parent, SummaryFile file) { |
|
92 crashFile = file; |
|
93 return doCreatePage(parent); |
|
94 } |
|
95 |
|
96 /** |
|
97 * Creates the page |
|
98 * @param parent composite |
|
99 * @return composite |
|
100 */ |
|
101 public Composite createPage(Composite parent) { |
|
102 return doCreatePage(parent); |
|
103 } |
|
104 |
|
105 /** |
|
106 * Loads data from given file into UI elements. |
|
107 * @param file crash file |
|
108 */ |
|
109 public void setFile(CrashFile file) { |
|
110 if (file != null) { |
|
111 crashFile = file; |
|
112 initialUserRegistersTableLoad(); |
|
113 loadCodeSegmentsTable(); |
|
114 loadEventLogTable(); |
|
115 initialCpsrDetailsTableLoad(); |
|
116 } |
|
117 } |
|
118 |
|
119 /** |
|
120 * Creates all UI elements to the page |
|
121 * @param parent |
|
122 * @return composite |
|
123 */ |
|
124 Composite doCreatePage(Composite parent) { |
|
125 GridLayout layout = new GridLayout(); |
|
126 layout.numColumns = 1; |
|
127 parent.setLayout(layout); |
|
128 parent.setLayoutData(new GridData(GridData.FILL_BOTH)); |
|
129 |
|
130 fontRegistry = new FontRegistry(Display.getCurrent()); |
|
131 fontRegistry.put("monospace", new FontData[]{new FontData("Courier", 8, SWT.NORMAL)}); |
|
132 |
|
133 SashForm sashFormMain = new SashForm(parent, SWT.VERTICAL); |
|
134 sashFormMain.setLayoutData(new GridData(GridData.FILL_BOTH)); |
|
135 SashForm sashFormTop = new SashForm(sashFormMain, SWT.HORIZONTAL); |
|
136 createRegistersGroup(sashFormTop); |
|
137 createCodeSegmentsGroup(sashFormTop); |
|
138 SashForm sashFormBottom = new SashForm(sashFormMain, SWT.HORIZONTAL); |
|
139 createEventLogGroup(sashFormBottom); |
|
140 createCpsrDetailsGroup(sashFormBottom); |
|
141 |
|
142 sashFormTop.setWeights(new int[]{3,2}); |
|
143 sashFormBottom.setWeights(new int[]{3,7}); |
|
144 |
|
145 setHelps(); |
|
146 |
|
147 return parent; |
|
148 } |
|
149 |
|
150 /** |
|
151 * Creates registers group |
|
152 * @param parent |
|
153 */ |
|
154 void createRegistersGroup(Composite parent) { |
|
155 Group groupRegisters = new Group(parent, SWT.NONE); |
|
156 GridLayout layout = new GridLayout(); |
|
157 layout.numColumns = 2; |
|
158 groupRegisters.setLayout(layout); |
|
159 groupRegisters.setText("Registers"); |
|
160 GridData groupGD = new GridData(GridData.FILL_HORIZONTAL); |
|
161 groupRegisters.setLayoutData(groupGD); |
|
162 |
|
163 comboRegisters = new Combo(groupRegisters, SWT.BORDER | SWT.DROP_DOWN | SWT.READ_ONLY); |
|
164 GridData comboGD = new GridData(); |
|
165 comboGD.horizontalSpan = 2; |
|
166 comboRegisters.setLayoutData(comboGD); |
|
167 comboRegisters.addSelectionListener(this); |
|
168 |
|
169 tableRegisters = new Table(groupRegisters, SWT.BORDER); |
|
170 tableRegisters.setHeaderVisible(true); |
|
171 tableRegisters.setLinesVisible(true); |
|
172 TableColumn col = new TableColumn(tableRegisters, SWT.LEFT); |
|
173 col.setWidth(100); |
|
174 col.setText("Register"); |
|
175 col = new TableColumn(tableRegisters, SWT.LEFT); |
|
176 col.setWidth(100); |
|
177 col.setText("Value"); |
|
178 col = new TableColumn(tableRegisters, SWT.LEFT); |
|
179 col.setWidth(100); |
|
180 col.setText("Symbol"); |
|
181 col = new TableColumn(tableRegisters, SWT.LEFT); |
|
182 col.setWidth(100); |
|
183 col.setText("Comment"); |
|
184 tableRegisters.setFont(fontRegistry.get("monospace")); |
|
185 |
|
186 GridData tableGd = new GridData(GridData.FILL_BOTH); |
|
187 tableGd.horizontalSpan = 2; |
|
188 tableRegisters.setLayoutData(tableGd); |
|
189 |
|
190 initialUserRegistersTableLoad(); |
|
191 |
|
192 } |
|
193 |
|
194 /** |
|
195 * Creates code segments group |
|
196 * @param parent |
|
197 */ |
|
198 void createCodeSegmentsGroup(Composite parent) { |
|
199 Group groupCodeSegments = new Group(parent, SWT.NONE); |
|
200 GridLayout layout = new GridLayout(); |
|
201 layout.numColumns = 1; |
|
202 groupCodeSegments.setLayout(layout); |
|
203 groupCodeSegments.setText("Code Segments"); |
|
204 GridData groupGD = new GridData(); |
|
205 groupCodeSegments.setLayoutData(groupGD); |
|
206 |
|
207 tableCodeSegments = new Table(groupCodeSegments, SWT.BORDER); |
|
208 tableCodeSegments.setHeaderVisible(true); |
|
209 GridData tableGd = new GridData(GridData.FILL_BOTH); |
|
210 tableCodeSegments.setLayoutData(tableGd); |
|
211 |
|
212 tableViewerCodeSegments = new CodeSegmentsTableViewer(tableCodeSegments); |
|
213 tableCodeSegments.setFont(fontRegistry.get("monospace")); |
|
214 |
|
215 loadCodeSegmentsTable(); |
|
216 AutoSizeTableCells(tableCodeSegments); |
|
217 |
|
218 } |
|
219 |
|
220 /** |
|
221 * Creates event log group |
|
222 * @param parent |
|
223 */ |
|
224 void createEventLogGroup(Composite parent) { |
|
225 Group groupEventLog = new Group(parent, SWT.NONE); |
|
226 GridLayout layout = new GridLayout(); |
|
227 layout.numColumns = 1; |
|
228 groupEventLog.setLayout(layout); |
|
229 groupEventLog.setText("Event Log"); |
|
230 GridData groupGD = new GridData(GridData.FILL_BOTH); |
|
231 groupEventLog.setLayoutData(groupGD); |
|
232 |
|
233 tableEventLog = new Table(groupEventLog, SWT.BORDER); |
|
234 tableEventLog.setHeaderVisible(true); |
|
235 TableColumn col = new TableColumn(tableEventLog, SWT.LEFT); |
|
236 col.setWidth(200); |
|
237 col.setText("Type"); |
|
238 col = new TableColumn(tableEventLog, SWT.LEFT); |
|
239 col.setWidth(200); |
|
240 col.setText("Value"); |
|
241 tableEventLog.setLayoutData(new GridData(GridData.FILL_BOTH)); |
|
242 tableEventLog.setFont(fontRegistry.get("monospace")); |
|
243 |
|
244 loadEventLogTable(); |
|
245 } |
|
246 |
|
247 /** |
|
248 * Creates cpsr details group |
|
249 * @param parent |
|
250 */ |
|
251 void createCpsrDetailsGroup(Composite parent) { |
|
252 Group groupCpsrDetails = new Group(parent, SWT.NONE); |
|
253 GridLayout layout = new GridLayout(); |
|
254 layout.numColumns = 1; |
|
255 groupCpsrDetails.setLayout(layout); |
|
256 groupCpsrDetails.setText("CPSR Details"); |
|
257 GridData groupGD = new GridData(GridData.FILL_VERTICAL); |
|
258 groupCpsrDetails.setLayoutData(groupGD); |
|
259 |
|
260 comboCpsrDetails = new Combo(groupCpsrDetails, SWT.BORDER | SWT.DROP_DOWN | SWT.READ_ONLY); |
|
261 comboCpsrDetails.addSelectionListener(this); |
|
262 |
|
263 // Empty group |
|
264 groupCpsrEmpty = new Group(groupCpsrDetails, SWT.NONE); |
|
265 FormLayout fl = new FormLayout(); |
|
266 fl.marginRight = 5; |
|
267 fl.marginLeft = 5; |
|
268 fl.marginBottom = 5; |
|
269 groupCpsrEmpty.setLayout(fl); |
|
270 GridData groupCpsrEmptyGd = new GridData(GridData.FILL_HORIZONTAL); |
|
271 groupCpsrEmptyGd.horizontalAlignment = SWT.FILL; |
|
272 groupCpsrEmptyGd.grabExcessHorizontalSpace = true; |
|
273 groupCpsrEmpty.setLayoutData(groupCpsrEmptyGd); |
|
274 |
|
275 // create 32 empty text boxes |
|
276 for (int i = 0; i < 32; i++) { |
|
277 Text text = new Text(groupCpsrEmpty, SWT.READ_ONLY | SWT.BORDER | SWT.NO_FOCUS | SWT.CENTER); |
|
278 text.setFont(fontRegistry.get("monospace")); |
|
279 FormData textFd = new FormData(); |
|
280 textFd.left = new FormAttachment(0,i*20); |
|
281 textFd.top = new FormAttachment(8, 15); |
|
282 textFd.width = 8; |
|
283 text.setLayoutData(textFd); |
|
284 } |
|
285 |
|
286 tableCpsrDetails = new Table(groupCpsrDetails, SWT.BORDER); |
|
287 tableCpsrDetails.setLinesVisible(true); |
|
288 tableCpsrDetails.setHeaderVisible(true); |
|
289 TableColumn col = new TableColumn(tableCpsrDetails, SWT.LEFT); |
|
290 col.setWidth(380); |
|
291 col.setText("Name"); |
|
292 col = new TableColumn(tableCpsrDetails, SWT.LEFT); |
|
293 col.setWidth(220); |
|
294 col.setText("Value"); |
|
295 GridData tableGd = new GridData(GridData.FILL_VERTICAL | GridData.FILL_HORIZONTAL); |
|
296 tableGd.horizontalAlignment = SWT.FILL; |
|
297 tableGd.grabExcessHorizontalSpace = true; |
|
298 tableCpsrDetails.setLayoutData(tableGd); |
|
299 tableCpsrDetails.setFont(fontRegistry.get("monospace")); |
|
300 initialCpsrDetailsTableLoad(); |
|
301 } |
|
302 |
|
303 |
|
304 /** |
|
305 * Loads register sets to combo, selects the correct set as |
|
306 * default set and then loads set's registers to table. |
|
307 */ |
|
308 void initialUserRegistersTableLoad() { |
|
309 if (crashFile == null) |
|
310 return; |
|
311 |
|
312 int defaultSelectionIndex = 0; |
|
313 |
|
314 // show the data of crashed process |
|
315 selectedProcess = crashFile.getCrashedProcess(); |
|
316 if (selectedProcess != null) { |
|
317 // current UI support only one thread, so show the first thread of first process |
|
318 selectedThread = selectedProcess.getFirstThread(); |
|
319 if (selectedThread != null) { |
|
320 List<RegisterSet> registerSets = selectedThread.getRegisters(); |
|
321 if (registerSets != null && !registerSets.isEmpty()) { |
|
322 // load all register sets to combo |
|
323 for (int i = 0; i < registerSets.size(); i++) { |
|
324 RegisterSet registerSet = registerSets.get(i); |
|
325 // default register to show is the one that contains CPSR register |
|
326 if (registerSet.containsCPSR()) |
|
327 defaultSelectionIndex = i; |
|
328 comboRegisters.add(registerSet.getName()); |
|
329 comboRegisters.setData(registerSet.getName(), registerSet); |
|
330 } |
|
331 } |
|
332 } |
|
333 } |
|
334 |
|
335 List<RegisterSet> standAloneRegisters = crashFile.getStandAloneRegisterSets(); |
|
336 if (standAloneRegisters != null && !standAloneRegisters.isEmpty()) { |
|
337 for (int i = 0; i < standAloneRegisters.size(); i++) { |
|
338 RegisterSet regSet = standAloneRegisters.get(i); |
|
339 if (regSet.containsCPSR()) |
|
340 defaultSelectionIndex = comboRegisters.getItemCount() + i; |
|
341 comboRegisters.add(regSet.getName()); |
|
342 comboRegisters.setData(regSet.getName(), regSet); |
|
343 } |
|
344 } |
|
345 |
|
346 if (comboRegisters.getItemCount() > 0) { |
|
347 comboRegisters.select(defaultSelectionIndex); |
|
348 loadRegistersTable(); |
|
349 } |
|
350 |
|
351 } |
|
352 |
|
353 /** |
|
354 * Loads user registers table according to which registers set is |
|
355 * selected in combo. |
|
356 */ |
|
357 void loadRegistersTable() { |
|
358 tableRegisters.removeAll(); |
|
359 |
|
360 if (comboRegisters.getItemCount() < 1) |
|
361 return; |
|
362 |
|
363 try { |
|
364 RegisterSet registerSet = (RegisterSet)comboRegisters.getData(comboRegisters.getText()); |
|
365 List<Register> registers = registerSet.getRegisters(); |
|
366 if (registers != null && !registers.isEmpty()) { |
|
367 // show all register values in selected register set |
|
368 for (int i = 0; i < registers.size(); i++) { |
|
369 Register register = registers.get(i); |
|
370 newRegistersTableItem(register); |
|
371 } |
|
372 AutoSizeTableCells(tableRegisters); |
|
373 } |
|
374 } catch (Exception e) { |
|
375 e.printStackTrace(); |
|
376 } |
|
377 } |
|
378 |
|
379 /** |
|
380 * Loads code segments to table |
|
381 */ |
|
382 void loadCodeSegmentsTable() { |
|
383 if (selectedProcess == null) |
|
384 return; |
|
385 |
|
386 List<CodeSegment> codeSegments = selectedProcess.getCodeSegments(); |
|
387 if (codeSegments != null && !codeSegments.isEmpty()) { |
|
388 for (int i = 0; i < codeSegments.size(); i++) { |
|
389 CodeSegment codeSegment = codeSegments.get(i); |
|
390 newCodeSegmentsTableItem(codeSegment); |
|
391 } |
|
392 } |
|
393 |
|
394 AutoSizeTableCells(tableCodeSegments); |
|
395 } |
|
396 |
|
397 /** |
|
398 * Loads all event log events to table |
|
399 */ |
|
400 void loadEventLogTable() { |
|
401 if (crashFile == null) |
|
402 return; |
|
403 |
|
404 EventLog eventLog = crashFile.getEventLog(); |
|
405 if (eventLog != null) { |
|
406 List<String[]> events = eventLog.getLogEvents(); |
|
407 if (events != null && !events.isEmpty()) { |
|
408 for (int i = 0; i < events.size(); i++) { |
|
409 String[] event = events.get(i); |
|
410 newEventTableItem(event[0], event[1]); |
|
411 } |
|
412 AutoSizeTableCells(tableEventLog); |
|
413 } |
|
414 } |
|
415 } |
|
416 |
|
417 /** |
|
418 * Loads cprs types to combo, selects first type and then loads it's |
|
419 * data to table. |
|
420 */ |
|
421 void initialCpsrDetailsTableLoad() { |
|
422 if (crashFile == null) |
|
423 return; |
|
424 |
|
425 List<RegisterDetails> registerDetails = crashFile.getRegisterDetails(); |
|
426 if (registerDetails != null && !registerDetails.isEmpty()) { |
|
427 for (int i = 0; i < registerDetails.size(); i++) { |
|
428 RegisterDetails regDetails = registerDetails.get(i); |
|
429 if (regDetails.getDescription().contains("CPSR")) { |
|
430 comboCpsrDetails.add(regDetails.getDescription()); |
|
431 comboCpsrDetails.setData(regDetails.getDescription(), regDetails); |
|
432 } |
|
433 } |
|
434 comboCpsrDetails.select(0); |
|
435 loadCpsrDetailsTable(); |
|
436 } |
|
437 } |
|
438 |
|
439 /** |
|
440 * Loads currently selected cprs's details into table. |
|
441 */ |
|
442 void loadCpsrDetailsTable() { |
|
443 try { |
|
444 tableCpsrDetails.removeAll(); |
|
445 |
|
446 RegisterDetails registerDetails = null; |
|
447 if (comboRegisters.getSelectionIndex() >= 0) |
|
448 registerDetails = (RegisterDetails)comboCpsrDetails.getData(comboCpsrDetails.getText()); |
|
449 |
|
450 boolean bitStartFromRight = registerDetails.bitsStartFromRight(); |
|
451 Map<String, String> categories = new HashMap<String, String>(); |
|
452 // go through all 32 text boxes, and see if there is a bit for each box |
|
453 for (int i = 0, j = 31; i < 32; i++, j--) { |
|
454 Text box = (Text)groupCpsrEmpty.getChildren().clone()[j]; |
|
455 // bits can start from the right or left (endianess) |
|
456 if (!bitStartFromRight) |
|
457 box = (Text)groupCpsrEmpty.getChildren().clone()[i]; |
|
458 RegisterBit bit = registerDetails.getBit(i); |
|
459 // there's no bit for this box |
|
460 if (bit == null) { |
|
461 box.setText(""); |
|
462 box.setToolTipText(""); |
|
463 // there is a bit for this box |
|
464 } else { |
|
465 String regChar = bit.getRegisterChar(); |
|
466 String category = bit.getCategory(); |
|
467 String interpretation = bit.getInterpretation(); |
|
468 // if this bit contains a longer description, it should be shown in the table also |
|
469 if (!"".equals(interpretation) && !categories.containsKey(category)) { |
|
470 categories.put(category, interpretation); |
|
471 } |
|
472 box.setText(regChar); |
|
473 box.setToolTipText(category); |
|
474 } |
|
475 } |
|
476 |
|
477 // load table |
|
478 for (int i = 0; i < categories.size(); i++) { |
|
479 newCpsrDetailsTableItem(categories.keySet().toArray()[i].toString(), |
|
480 categories.values().toArray()[i].toString()); |
|
481 } |
|
482 } catch (Exception e) { |
|
483 e.printStackTrace(); |
|
484 } |
|
485 } |
|
486 |
|
487 /** |
|
488 * Adds a new table row for registers table |
|
489 * @param register row data |
|
490 */ |
|
491 void newRegistersTableItem(Register register) { |
|
492 TableItem item = new TableItem(tableRegisters, SWT.NONE); |
|
493 item.setText(new String[] {register.getName(), |
|
494 register.getValue(), |
|
495 register.getSymbol(), |
|
496 register.getComments()}); |
|
497 } |
|
498 |
|
499 /** |
|
500 * Adds a new table row for code segments table |
|
501 * @param codeSegment |
|
502 */ |
|
503 void newCodeSegmentsTableItem(CodeSegment codeSegment) { |
|
504 TableItem item = new TableItem(tableCodeSegments, SWT.NONE); |
|
505 String segmentRange = codeSegment.getSegmentRange(); |
|
506 String base = ""; |
|
507 String top = ""; |
|
508 try { |
|
509 // segment range is of format: XXXXX-YYYYY, parse this to XXXXX and YYYYY |
|
510 if (segmentRange.contains("-")) { |
|
511 top = segmentRange.substring(segmentRange.indexOf('-')+1); |
|
512 base = segmentRange.substring(0, segmentRange.indexOf('-')); |
|
513 } |
|
514 } catch (Exception e) { |
|
515 e.printStackTrace(); |
|
516 } |
|
517 item.setText(new String[] {base, top, codeSegment.getSegmentName()}); |
|
518 |
|
519 // code segment should be highlighted if there was some problem with the code section |
|
520 // while creating data |
|
521 if (codeSegment.shouldBeHighlighted()) { |
|
522 item.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_MAGENTA)); |
|
523 } |
|
524 item.setData(codeSegment); |
|
525 } |
|
526 |
|
527 /** |
|
528 * Adds a new table row for event log table |
|
529 * @param header header text |
|
530 * @param value value text |
|
531 */ |
|
532 void newEventTableItem(String header, String value) { |
|
533 TableItem item = new TableItem(tableEventLog, SWT.NONE); |
|
534 item.setText(new String[] {header, value}); |
|
535 } |
|
536 |
|
537 /** |
|
538 * Adds a new table row for cpsr details table |
|
539 * @param header header text |
|
540 * @param value value text |
|
541 */ |
|
542 void newCpsrDetailsTableItem(String header, String value) { |
|
543 TableItem item = new TableItem(tableCpsrDetails, SWT.NONE); |
|
544 item.setText(new String[] {header, value}); |
|
545 } |
|
546 |
|
547 /** |
|
548 * Packs all columns for given table |
|
549 * @param table table which columns are to be packed |
|
550 */ |
|
551 void AutoSizeTableCells(Table table) { |
|
552 for (int i = 0; i < table.getColumnCount(); i++) { |
|
553 table.getColumn(i).pack(); |
|
554 } |
|
555 } |
|
556 |
|
557 public void widgetDefaultSelected(SelectionEvent arg0) { |
|
558 // No implementation needed |
|
559 } |
|
560 |
|
561 public void widgetSelected(SelectionEvent event) { |
|
562 // cpsr was changed in combo |
|
563 if (event.widget == comboCpsrDetails) { |
|
564 loadCpsrDetailsTable(); |
|
565 // register set was changed in combo |
|
566 } else if (event.widget == comboRegisters) { |
|
567 loadRegistersTable(); |
|
568 } |
|
569 } |
|
570 |
|
571 /** |
|
572 * Sets context sensitive help ids to UI elements |
|
573 */ |
|
574 void setHelps() { |
|
575 PlatformUI.getWorkbench().getHelpSystem().setHelp(tableCodeSegments, |
|
576 HelpContextIDs.CRASH_ANALYSER_HELP_CRASH_VISUALISER); |
|
577 PlatformUI.getWorkbench().getHelpSystem().setHelp(tableCpsrDetails, |
|
578 HelpContextIDs.CRASH_ANALYSER_HELP_CRASH_VISUALISER); |
|
579 PlatformUI.getWorkbench().getHelpSystem().setHelp(tableEventLog, |
|
580 HelpContextIDs.CRASH_ANALYSER_HELP_CRASH_VISUALISER); |
|
581 PlatformUI.getWorkbench().getHelpSystem().setHelp(tableRegisters, |
|
582 HelpContextIDs.CRASH_ANALYSER_HELP_CRASH_VISUALISER); |
|
583 PlatformUI.getWorkbench().getHelpSystem().setHelp(tableEventLog, |
|
584 HelpContextIDs.CRASH_ANALYSER_HELP_CRASH_VISUALISER); |
|
585 PlatformUI.getWorkbench().getHelpSystem().setHelp(tableRegisters, |
|
586 HelpContextIDs.CRASH_ANALYSER_HELP_CRASH_VISUALISER); |
|
587 PlatformUI.getWorkbench().getHelpSystem().setHelp(comboCpsrDetails, |
|
588 HelpContextIDs.CRASH_ANALYSER_HELP_CRASH_VISUALISER); |
|
589 PlatformUI.getWorkbench().getHelpSystem().setHelp(comboRegisters, |
|
590 HelpContextIDs.CRASH_ANALYSER_HELP_CRASH_VISUALISER); |
|
591 } |
|
592 } |