Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 210177
Collapse All | Expand All

(-)src-engine/org/eclipse/tptp/symptom/analysis/XPathCorrelationEngine.java (+2 lines)
Lines 234-239 Link Here
234
		}catch(Exception e){
234
		}catch(Exception e){
235
			log(e);
235
			log(e);
236
		}
236
		}
237
		//reset delegator
238
		cbeDelegator.setEvent(null);//bugzilla 210177
237
		context.setStatus(new OperationStatusImpl(IOperationStatus.OK, PLUGIN_ID, IOperationStatus.OK, "", null)); 
239
		context.setStatus(new OperationStatusImpl(IOperationStatus.OK, PLUGIN_ID, IOperationStatus.OK, "", null)); 
238
	}
240
	}
239
241
(-)src/org/eclipse/tptp/symptom/internal/presentation/view/SymptomAnalysisDetailsPageBook.java (-4 / +66 lines)
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
	}
(-)src/org/eclipse/tptp/platform/log/views/internal/actions/OpenLogViewActionDelegate.java (-8 / +9 lines)
Lines 1-5 Link Here
1
/**********************************************************************
1
/**********************************************************************
2
 * Copyright (c) 2006 IBM Corporation and others.
2
 * Copyright (c) 2006, 2007 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-26 Link Here
13
package org.eclipse.tptp.platform.log.views.internal.actions;
13
package org.eclipse.tptp.platform.log.views.internal.actions;
14
14
15
import org.eclipse.emf.ecore.EObject;
15
import org.eclipse.emf.ecore.EObject;
16
import org.eclipse.hyades.models.cbe.CBECommonBaseEvent;
17
import org.eclipse.hyades.models.hierarchy.TRCAgent;
16
import org.eclipse.hyades.models.hierarchy.TRCAgent;
18
import org.eclipse.hyades.models.hierarchy.TRCAgentProxy;
17
import org.eclipse.hyades.models.hierarchy.TRCAgentProxy;
19
import org.eclipse.hyades.trace.ui.HyadesUtil;
18
import org.eclipse.hyades.trace.ui.HyadesUtil;
20
21
import org.eclipse.jface.action.IAction;
19
import org.eclipse.jface.action.IAction;
22
import org.eclipse.jface.viewers.ISelection;
20
import org.eclipse.jface.viewers.ISelection;
23
import org.eclipse.jface.viewers.IStructuredSelection;
21
import org.eclipse.jface.viewers.IStructuredSelection;
22
import org.eclipse.tptp.platform.common.internal.util.CBECommonBaseEventWeakRef;
24
import org.eclipse.tptp.platform.common.ui.internal.CommonUIConstants;
23
import org.eclipse.tptp.platform.common.ui.internal.CommonUIConstants;
25
import org.eclipse.tptp.platform.log.views.internal.LogViewsPlugin;
24
import org.eclipse.tptp.platform.log.views.internal.LogViewsPlugin;
26
import org.eclipse.tptp.platform.log.views.internal.util.LogUtil;
25
import org.eclipse.tptp.platform.log.views.internal.util.LogUtil;
Lines 45-57 Link Here
45
					.showView(CommonUIConstants.LOG_VIEW_ID));
44
					.showView(CommonUIConstants.LOG_VIEW_ID));
46
45
47
			if (viewer != null) {
46
			if (viewer != null) {
48
				EObject container = ((CBECommonBaseEvent)selObject).eContainer();
47
				//changed to CBECommonBaseEventWeakRef in bugzilla 210177
48
				EObject container = ((CBECommonBaseEventWeakRef)selObject).getDelegate().eContainer();
49
				if (container != null
49
				if (container != null
50
						&& container instanceof TRCAgent) {
50
						&& container instanceof TRCAgent) {
51
					TRCAgentProxy viewerInput = ((TRCAgent) ((CBECommonBaseEvent)selObject).eContainer())
51
					TRCAgentProxy viewerInput = ((TRCAgent) ((CBECommonBaseEventWeakRef)selObject).getDelegate().eContainer())
52
							.getAgentProxy();
52
							.getAgentProxy();
53
					viewer.addViewPage(viewerInput);
53
					viewer.addViewPage(viewerInput);
54
					LogUtil.notifyViewSelectionChanged(this, null, ((CBECommonBaseEvent)selObject));
54
					LogUtil.notifyViewSelectionChanged(this, null, ((CBECommonBaseEventWeakRef)selObject).getDelegate());
55
				}
55
				}
56
			}
56
			}
57
57
Lines 61-67 Link Here
61
				if (viewer != null) {
61
				if (viewer != null) {
62
					EObject object = HyadesUtil.getMofObject();
62
					EObject object = HyadesUtil.getMofObject();
63
					if (object != null) {
63
					if (object != null) {
64
						LogUtil.notifyViewSelectionChanged(this, null, ((CBECommonBaseEvent)selObject));
64
						LogUtil.notifyViewSelectionChanged(this, null, ((CBECommonBaseEventWeakRef)selObject).getDelegate());
65
					}
65
					}
66
				}
66
				}
67
			}
67
			}
Lines 77-83 Link Here
77
	public void selectionChanged(IAction action, ISelection selection) {
77
	public void selectionChanged(IAction action, ISelection selection) {
78
		if(selection!=null && selection instanceof IStructuredSelection && !selection.isEmpty()){
78
		if(selection!=null && selection instanceof IStructuredSelection && !selection.isEmpty()){
79
			selObject = ((IStructuredSelection)selection).getFirstElement();
79
			selObject = ((IStructuredSelection)selection).getFirstElement();
80
			if(action!=null && selObject!=null && selObject instanceof CBECommonBaseEvent){
80
			//changed to CBECommonBaseEventWeakRef in bugzilla 210177
81
			if(action!=null && selObject!=null && selObject instanceof CBECommonBaseEventWeakRef){
81
				action.setEnabled(true);
82
				action.setEnabled(true);
82
				return;
83
				return;
83
			}
84
			}
(-)src/org/eclipse/tptp/platform/log/views/internal/actions/ExtendedAnalyzeAction.java (-4 / +2 lines)
Lines 170-179 Link Here
170
									 String msg = perf.getMessage() + ": deltaTime=" + perf.getTime() + " - usedMemoryDelta=" + perf.getUsedMemoryDelta() +" - freeMemoryDelta=" + perf.getFreeMemoryDelta()+ " - totalMemoryDelta=" + perf.getTotalMemoryDelta() + " - usedMemoryAfter=" + perf.getUsedMemoryAfter()+ " - freeMemoryAfter=" + perf.getFreeMemoryAfter() +" - totalMemoryAfter=" + perf.getTotalMemoryAfter();
170
									 String msg = perf.getMessage() + ": deltaTime=" + perf.getTime() + " - usedMemoryDelta=" + perf.getUsedMemoryDelta() +" - freeMemoryDelta=" + perf.getFreeMemoryDelta()+ " - totalMemoryDelta=" + perf.getTotalMemoryDelta() + " - usedMemoryAfter=" + perf.getUsedMemoryAfter()+ " - freeMemoryAfter=" + perf.getFreeMemoryAfter() +" - totalMemoryAfter=" + perf.getTotalMemoryAfter();
171
									 LogViewsPlugin.log(new Status(IStatus.INFO, LogViewsPlugin.PLUGIN_ID, IStatus.INFO, msg, null));
171
									 LogViewsPlugin.log(new Status(IStatus.INFO, LogViewsPlugin.PLUGIN_ID, IStatus.INFO, msg, null));
172
								 }
172
								 }
173
//								 if(result != null){
173
								 //avoid keeping any cached events, set reference to events list to null
174
//									 result.clear();
174
								 listToAnalyze = null;//bugzilla 210177
175
//									 result = null;
176
//								 }								
177
							}
175
							}
178
						});		
176
						});		
179
					}
177
					}

Return to bug 210177