|
Lines 27-32
Link Here
|
| 27 |
import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry; |
27 |
import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry; |
| 28 |
import org.eclipse.hyades.loaders.hierarchy.Constants; |
28 |
import org.eclipse.hyades.loaders.hierarchy.Constants; |
| 29 |
import org.eclipse.hyades.models.cbe.CBECommonBaseEvent; |
29 |
import org.eclipse.hyades.models.cbe.CBECommonBaseEvent; |
|
|
30 |
import org.eclipse.hyades.models.cbe.CBEDefaultEvent; |
| 30 |
import org.eclipse.hyades.models.hierarchy.util.HierarchyResourceSetImpl; |
31 |
import org.eclipse.hyades.models.hierarchy.util.HierarchyResourceSetImpl; |
| 31 |
import org.eclipse.hyades.models.plugin.ModelsPlugin; |
32 |
import org.eclipse.hyades.models.plugin.ModelsPlugin; |
| 32 |
import org.eclipse.hyades.sdb.internal.SDbPluginImages; |
33 |
import org.eclipse.hyades.sdb.internal.SDbPluginImages; |
|
Lines 70-75
Link Here
|
| 70 |
import org.eclipse.swt.widgets.Label; |
71 |
import org.eclipse.swt.widgets.Label; |
| 71 |
import org.eclipse.swt.widgets.Menu; |
72 |
import org.eclipse.swt.widgets.Menu; |
| 72 |
import org.eclipse.swt.widgets.Table; |
73 |
import org.eclipse.swt.widgets.Table; |
|
|
74 |
import org.eclipse.tptp.platform.common.internal.util.CBECommonBaseEventWeakRef; |
| 75 |
import org.eclipse.tptp.platform.common.internal.util.CBEDefaultEventWeakRef; |
| 73 |
import org.eclipse.tptp.platform.models.symptom.Symptom; |
76 |
import org.eclipse.tptp.platform.models.symptom.Symptom; |
| 74 |
import org.eclipse.tptp.platform.models.symptom.SymptomDefinition; |
77 |
import org.eclipse.tptp.platform.models.symptom.SymptomDefinition; |
| 75 |
import org.eclipse.tptp.symptom.editor.ISymptomDetailsPage; |
78 |
import org.eclipse.tptp.symptom.editor.ISymptomDetailsPage; |
|
Lines 274-280
Link Here
|
| 274 |
Table cbeTable = toolkit.createTable(_cbeMatchedEvents, SWT.MULTI |
277 |
Table cbeTable = toolkit.createTable(_cbeMatchedEvents, SWT.MULTI |
| 275 |
| SWT.V_SCROLL | SWT.H_SCROLL); |
278 |
| SWT.V_SCROLL | SWT.H_SCROLL); |
| 276 |
cbeTable.setLayoutData(GridUtil.createFill()); |
279 |
cbeTable.setLayoutData(GridUtil.createFill()); |
| 277 |
_cbeTableViewer = new TableViewer(cbeTable); |
280 |
_cbeTableViewer = new TableViewer(cbeTable){ |
|
|
281 |
//bugzilla 210177 |
| 282 |
public ISelection getSelection() { |
| 283 |
|
| 284 |
ISelection newSelection = null; |
| 285 |
ISelection selection = super.getSelection(); |
| 286 |
|
| 287 |
newSelection = SymptomAnalysisDetailsPageBook.this.updateSelection(selection); |
| 288 |
if(newSelection == null){ |
| 289 |
newSelection = StructuredSelection.EMPTY; |
| 290 |
} |
| 291 |
//return CBE weak references |
| 292 |
return newSelection; |
| 293 |
} |
| 294 |
//bugzilla 210177 |
| 295 |
protected void updateSelection(ISelection selection) { |
| 296 |
|
| 297 |
ISelection newSelection = SymptomAnalysisDetailsPageBook.this.updateSelection(selection); |
| 298 |
|
| 299 |
if(newSelection != null && !newSelection.isEmpty()){ |
| 300 |
super.updateSelection(newSelection); |
| 301 |
}else{ |
| 302 |
super.updateSelection(selection); |
| 303 |
} |
| 304 |
} |
| 305 |
}; |
| 278 |
_cbeTableViewer.setContentProvider(new CBETableContentProvider()); |
306 |
_cbeTableViewer.setContentProvider(new CBETableContentProvider()); |
| 279 |
_cbeTableViewer.setLabelProvider(new CBETableLabelProvider()); |
307 |
_cbeTableViewer.setLabelProvider(new CBETableLabelProvider()); |
| 280 |
toolkit.paintBordersFor(_cbeMatchedEvents); |
308 |
toolkit.paintBordersFor(_cbeMatchedEvents); |
|
Lines 297-308
Link Here
|
| 297 |
_cbeTableViewer.addDoubleClickListener(new IDoubleClickListener() { |
325 |
_cbeTableViewer.addDoubleClickListener(new IDoubleClickListener() { |
| 298 |
public void doubleClick(DoubleClickEvent event) { |
326 |
public void doubleClick(DoubleClickEvent event) { |
| 299 |
ISelection sel = event.getSelection(); |
327 |
ISelection sel = event.getSelection(); |
|
|
328 |
sel = updateSelection(sel); |
| 300 |
if (sel instanceof IStructuredSelection |
329 |
if (sel instanceof IStructuredSelection |
| 301 |
&& ((IStructuredSelection) sel).size() == 1) { |
330 |
&& ((IStructuredSelection) sel).size() == 1) { |
| 302 |
Object object = ((IStructuredSelection) sel) |
331 |
Object object = ((IStructuredSelection) sel) |
| 303 |
.getFirstElement(); |
332 |
.getFirstElement(); |
| 304 |
if (object instanceof CBECommonBaseEvent) { |
333 |
if (object instanceof CBECommonBaseEventWeakRef) { |
| 305 |
openView((CBECommonBaseEvent) object, true); |
334 |
//bugzilla 210177 |
|
|
335 |
openView((CBECommonBaseEventWeakRef) object, true); |
| 306 |
} |
336 |
} |
| 307 |
if (object instanceof TablePageDownControl) { |
337 |
if (object instanceof TablePageDownControl) { |
| 308 |
((TablePageDownControl) object).run(); |
338 |
((TablePageDownControl) object).run(); |
|
Lines 367-372
Link Here
|
| 367 |
_cbeTabItem.setControl(_cbeMatchedEvents); |
397 |
_cbeTabItem.setControl(_cbeMatchedEvents); |
| 368 |
|
398 |
|
| 369 |
} |
399 |
} |
|
|
400 |
//bugzilla 210177 |
| 401 |
protected ISelection updateSelection(ISelection selection){ |
| 402 |
IStructuredSelection newSelection = null; |
| 403 |
CBECommonBaseEventWeakRef weakRefCBE = null; |
| 404 |
CBEDefaultEventWeakRef weakRefDefEvent = null; |
| 405 |
|
| 406 |
if(selection instanceof IStructuredSelection){ |
| 407 |
List selObjects = new ArrayList(); |
| 408 |
for (Iterator iterator = ((IStructuredSelection)selection).iterator(); iterator.hasNext();) { |
| 409 |
Object object = iterator.next(); |
| 410 |
if(object instanceof CBECommonBaseEventWeakRef){ |
| 411 |
selObjects.add(object); |
| 412 |
}else if(object instanceof CBEDefaultEventWeakRef){ |
| 413 |
selObjects.add(object); |
| 414 |
}if(object instanceof CBECommonBaseEvent){ |
| 415 |
weakRefCBE = new CBECommonBaseEventWeakRef((CBECommonBaseEvent)object); |
| 416 |
selObjects.add(weakRefCBE); |
| 417 |
}else if(object instanceof CBEDefaultEvent){ |
| 418 |
weakRefDefEvent = new CBEDefaultEventWeakRef((CBEDefaultEvent)object); |
| 419 |
selObjects.add(weakRefDefEvent); |
| 420 |
}else{ |
| 421 |
selObjects.add(selObjects); |
| 422 |
} |
| 423 |
|
| 424 |
} |
| 425 |
newSelection = new StructuredSelection(selObjects); |
| 426 |
} |
| 427 |
return newSelection != null ? newSelection : selection; |
| 428 |
} |
| 370 |
|
429 |
|
| 371 |
/* |
430 |
/* |
| 372 |
* (non-Javadoc) |
431 |
* (non-Javadoc) |
|
Lines 844-850
Link Here
|
| 844 |
|
903 |
|
| 845 |
} |
904 |
} |
| 846 |
|
905 |
|
| 847 |
protected void openView(CBECommonBaseEvent cbeEvent, boolean force) { |
906 |
protected void openView(CBECommonBaseEventWeakRef cbeEvent, boolean force) { |
| 848 |
if(openLogViewActionDelegate == null){ |
907 |
if(openLogViewActionDelegate == null){ |
| 849 |
IConfigurationElement[] extensionList = Platform.getExtensionRegistry() |
908 |
IConfigurationElement[] extensionList = Platform.getExtensionRegistry() |
| 850 |
.getConfigurationElementsFor("org.eclipse.ui", "popupMenus"); |
909 |
.getConfigurationElementsFor("org.eclipse.ui", "popupMenus"); |
|
Lines 908-913
Link Here
|
| 908 |
if (_cbeTableViewer.getLabelProvider() != null) |
967 |
if (_cbeTableViewer.getLabelProvider() != null) |
| 909 |
_cbeTableViewer.getLabelProvider().dispose(); |
968 |
_cbeTableViewer.getLabelProvider().dispose(); |
| 910 |
_cbeTableViewer.getTable().dispose(); |
969 |
_cbeTableViewer.getTable().dispose(); |
|
|
970 |
//bugzilla 210177 |
| 971 |
openLogViewActionDelegate = null; |
| 972 |
openLogViewAction = null; |
| 911 |
// UIPlugin.getDefault().removeViewSelectionChangedListener(this); |
973 |
// UIPlugin.getDefault().removeViewSelectionChangedListener(this); |
| 912 |
super.dispose(); |
974 |
super.dispose(); |
| 913 |
} |
975 |
} |