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 194954 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/tptp/monitoring/instrumentation/ui/provisional/handler/CBEInstrumentHandler.java (-14 / +18 lines)
Lines 232-260 Link Here
232
	
232
	
233
	/**
233
	/**
234
	 * return specific filter set element for CBE analysis type
234
	 * return specific filter set element for CBE analysis type
235
	 * @param filterElement default filter set element from data collection
235
	 * @param filterSetElement default filter set from data collection
236
	 * @param launchconfiguration launch configuration
236
	 * @param launchconfiguration launch configuration
237
	 * @param isProbekit flag whether is probekit type
237
	 * @param isProbekit flag whether is probekit type
238
	 * @return specific filter set element for CBE
238
	 * @return specific filter set element for CBE
239
	 */
239
	 */
240
	private FilterSetElement getFilterSetElement(FilterSetElement filterElement,ILaunchConfiguration launchconfiguration, boolean isProbekit) {
240
	private FilterSetElement getFilterSetElement(FilterSetElement filterSetElement,ILaunchConfiguration launchconfiguration, boolean isProbekit) {
241
		FilterSetElement result = null;
241
		FilterSetElement result = null;
242
242
243
		try {
243
		try {
244
			if (!launchconfiguration.getAttribute(InstrumentLaunchConfiguration.ENABLE_CBE_INSTRUMENT_FILTER_SET, false))
244
			if (launchconfiguration.getAttribute(InstrumentLaunchConfiguration.ENABLE_CBE_INSTRUMENT_FILTER_SET, false)){
245
				return filterElement;
245
				String filterSetId = launchconfiguration.getAttribute(InstrumentLaunchConfiguration.CBE_ACTIVE_INSTRUMENT_FILTER_SET, "");
246
246
				String filterSetKey = InstrumentLaunchConfiguration.CBE_INSTRUMENT_FILTER_SET_KEY + "_" + launchconfiguration.getName();
247
			String filterSetId = launchconfiguration.getAttribute(InstrumentLaunchConfiguration.CBE_ACTIVE_INSTRUMENT_FILTER_SET, "");
247
				result = InstrumentSelectManager.getInstance().getFilterSetElement(filterSetKey, filterSetId);
248
			String filterSetKey = InstrumentLaunchConfiguration.CBE_INSTRUMENT_FILTER_SET_KEY + "_" + launchconfiguration.getName();
248
	
249
			result = InstrumentSelectManager.getInstance().getFilterSetElement(filterSetKey, filterSetId);
249
				if (result == null)
250
250
					result = filterSetElement;
251
			if (result == null)
251
				else if (isProbekit) 
252
				result = filterElement;
252
					result.getChildren().addAll(InstrumentUtil.getFilterElementListByProbe(points));
253
			else if (isProbekit) {
253
				
254
				result.getChildren().addAll(InstrumentUtil.getFilterElementListByProbe(points));
254
			}else{
255
				result= filterSetElement;
255
			}
256
			}
257
			//append filter set element from BtM annotation to result filter set
258
			InstrumentUtil.appendAnnotationToFilterSet(launchconfiguration, result);
259
			
256
		} catch (CoreException e) {
260
		} catch (CoreException e) {
257
			LogHelper.error(e);
261
				LogHelper.error(e);
258
		}
262
		}
259
263
260
		return result;
264
		return result;
(-)src/org/eclipse/tptp/monitoring/instrumentation/ui/provisional/handler/JmxInstrumentHandler.java (-10 / +15 lines)
Lines 116-133 Link Here
116
		FilterSetElement result = null;
116
		FilterSetElement result = null;
117
117
118
		try {
118
		try {
119
			if (!launchconfiguration.getAttribute(InstrumentLaunchConfiguration.ENABLE_JMX_INSTRUMENT_FILTER_SET, false))
119
			if (!launchconfiguration.getAttribute(InstrumentLaunchConfiguration.ENABLE_JMX_INSTRUMENT_FILTER_SET, false)){
120
				return filterElement;
121
			
122
			String filterSetId = launchconfiguration.getAttribute(InstrumentLaunchConfiguration.JMX_ACTIVE_INSTRUMENT_FILTER_SET, "");
123
			String filterSetKey = InstrumentLaunchConfiguration.JMX_INSTRUMENT_FILTER_SET_KEY + "_" + launchconfiguration.getName();
124
			result = InstrumentSelectManager.getInstance().getFilterSetElement(filterSetKey, filterSetId);
125
126
			if (result == null)
127
				result = filterElement;
120
				result = filterElement;
128
			else if (isProbekit) {
121
			}else{			
129
				result.getChildren().addAll(InstrumentUtil.getFilterElementListByProbe(points));
122
				String filterSetId = launchconfiguration.getAttribute(InstrumentLaunchConfiguration.JMX_ACTIVE_INSTRUMENT_FILTER_SET, "");
123
				String filterSetKey = InstrumentLaunchConfiguration.JMX_INSTRUMENT_FILTER_SET_KEY + "_" + launchconfiguration.getName();
124
				result = InstrumentSelectManager.getInstance().getFilterSetElement(filterSetKey, filterSetId);
125
126
				if (result == null)
127
					result = filterElement;
128
				else if (isProbekit) {
129
					result.getChildren().addAll(InstrumentUtil.getFilterElementListByProbe(points));
130
				}
130
			}
131
			}
132
			
133
			//append filter set element from BtM annotation to result filter set
134
			InstrumentUtil.appendAnnotationToFilterSet(launchconfiguration, result);
135
			
131
		} catch (CoreException e) {
136
		} catch (CoreException e) {
132
			LogHelper.error(e);
137
			LogHelper.error(e);
133
		}
138
		}
(-)META-INF/MANIFEST.MF (-1 / +1 lines)
Lines 2-8 Link Here
2
Bundle-ManifestVersion: 2
2
Bundle-ManifestVersion: 2
3
Bundle-Name: %pluginName
3
Bundle-Name: %pluginName
4
Bundle-SymbolicName: org.eclipse.tptp.monitoring.instrumentation.ui;singleton:=true
4
Bundle-SymbolicName: org.eclipse.tptp.monitoring.instrumentation.ui;singleton:=true
5
Bundle-Version: 4.4.1.qualifier
5
Bundle-Version: 4.5.0.qualifier
6
Bundle-Activator: org.eclipse.tptp.monitoring.instrumentation.ui.internal.UIPlugin
6
Bundle-Activator: org.eclipse.tptp.monitoring.instrumentation.ui.internal.UIPlugin
7
Bundle-Localization: plugin
7
Bundle-Localization: plugin
8
Require-Bundle: org.eclipse.tptp.platform.instrumentation.ui;bundle-version="[4.2.0,5.0.0)",
8
Require-Bundle: org.eclipse.tptp.platform.instrumentation.ui;bundle-version="[4.2.0,5.0.0)",
(-)src/org/eclipse/tptp/platform/instrumentation/ui/internal/util/InstrumentFilterTableElement.java (-96 / +7 lines)
Lines 11-50 Link Here
11
 ***********************************************************************/
11
 ***********************************************************************/
12
package org.eclipse.tptp.platform.instrumentation.ui.internal.util;
12
package org.eclipse.tptp.platform.instrumentation.ui.internal.util;
13
13
14
import org.eclipse.hyades.trace.ui.internal.util.TraceMessages;
15
import org.eclipse.osgi.util.TextProcessor;
16
17
/**
14
/**
18
 * This class represents a single cell in a table.  The cell can be 
15
 * This class represents a single cell in a table.  The cell can be 
19
 * method name, class name, visibility, or package name.
16
 * method name, class name, visibility, or package name.
20
 */
17
 */
21
public class InstrumentFilterTableElement {
18
public class InstrumentFilterTableElement extends org.eclipse.tptp.platform.instrumentation.annotation.internal.util.BaseFilterTableElement {
22
23
	/* The visibility value */
24
	public static final String P_VISIBILITY= "combo";
25
	
26
	/* The class value */
27
	public static final String P_TEXT= "string";
28
	
29
	/* The method vale */
30
	public static final String P_METHOD= "method";
31
	
32
	/* The package value */
33
	public static final String P_PACKAGE = "package";
34
19
35
	private String packageName;
36
	private String fText;
37
	private String fMethod="*";	
38
	private String fVisibility;
39
	private InstrumentFilterList fParent;
20
	private InstrumentFilterList fParent;
40
	
21
	
41
	/* The list of visible states */
42
	protected static final String[] fVisibilityState = new String[] {
43
		TraceMessages.EXCLUDE, 
44
		TraceMessages.INCLUDE
45
	};
46
47
	
48
	/**
22
	/**
49
	 * Default constructor.
23
	 * Default constructor.
50
	 * 
24
	 * 
Lines 55-124 Link Here
55
	 */
29
	 */
56
	public InstrumentFilterTableElement(String text, String method,
30
	public InstrumentFilterTableElement(String text, String method,
57
			String visibility, String packageName) {
31
			String visibility, String packageName) {
58
		fMethod = method;		
32
		super(text, method, visibility, packageName);
59
		fText = text;
60
		fVisibility = visibility;	
61
		this.packageName = packageName;
62
	}
63
64
	/**
65
	 * Returns the package name for the current filter
66
	 * 
67
	 * @return the package name
68
	 */
69
	public String getPackageName() {
70
		return TextProcessor.process(packageName);
71
	}
72
73
	/**
74
	 * Returns the method name for the current filter
75
	 * 
76
	 * @return the method
77
	 */
78
	public String getMethod() {
79
		return TextProcessor.process(fMethod);
80
	}
81
82
	/**
83
	 * Returns the class name of the current filter
84
	 * 
85
	 * @return the class
86
	 */
87
	public String getText() {
88
		return TextProcessor.process(fText);
89
	}
90
	
91
	/**
92
	 * Returns the index of the visibility state of the current filter 
93
	 * 
94
	 * @return the index
95
	 */
96
	public int getVisibilityState() {
97
		for(int idx=0; idx<fVisibilityState.length; idx++) {
98
			if(fVisibilityState[idx].equals(fVisibility)) {
99
				return idx;
100
			}
101
		}
102
103
		return -1;
104
	}
105
	
106
	/**
107
	 * Returns an array of visibility states
108
	 * 
109
	 * @return an array of visibility states
110
	 */
111
	public static String[] getVisibilityStates() {
112
		return fVisibilityState;
113
	}
114
	
115
	/**
116
	 * Returns the visibility state of the current filter.
117
	 * 
118
	 * @return the visibility state
119
	 */
120
	public String getVisibility() {
121
		return fVisibility;
122
	}
33
	}
123
34
124
	/**
35
	/**
Lines 129-135 Link Here
129
	 * @param packageName the package name
40
	 * @param packageName the package name
130
	 */
41
	 */
131
	public void setPackageName(String packageName) {
42
	public void setPackageName(String packageName) {
132
		this.packageName = packageName;
43
		super.setPackageName(packageName);
133
		fParent.fireElementChanged(this, P_PACKAGE);
44
		fParent.fireElementChanged(this, P_PACKAGE);
134
	}
45
	}
135
46
Lines 150-156 Link Here
150
	 * @param value the class to filter 
61
	 * @param value the class to filter 
151
	 */
62
	 */
152
	public void setText(String value) {
63
	public void setText(String value) {
153
		fText= value;
64
		super.setText(value);
154
		if(fParent != null) {
65
		if(fParent != null) {
155
			fParent.fireElementChanged(this, P_TEXT);
66
			fParent.fireElementChanged(this, P_TEXT);
156
		}
67
		}
Lines 164-170 Link Here
164
	 * @param value the visibility index
75
	 * @param value the visibility index
165
	 */
76
	 */
166
	public void setVisibility(int value) {
77
	public void setVisibility(int value) {
167
		fVisibility= fVisibilityState[value];
78
		super.setVisibility(value);
168
		if(fParent != null) {
79
		if(fParent != null) {
169
			fParent.fireElementChanged(this, P_VISIBILITY);
80
			fParent.fireElementChanged(this, P_VISIBILITY);
170
		}
81
		}
Lines 178-184 Link Here
178
	 * @param value the visibility 
89
	 * @param value the visibility 
179
	 */
90
	 */
180
	public void setVisibility(String value) {
91
	public void setVisibility(String value) {
181
		fVisibility= value;
92
		super.setVisibility(value);
182
		if(fParent != null) {
93
		if(fParent != null) {
183
			fParent.fireElementChanged(this, P_VISIBILITY);
94
			fParent.fireElementChanged(this, P_VISIBILITY);
184
		}
95
		}
Lines 192-198 Link Here
192
	 * @param value the method 
103
	 * @param value the method 
193
	 */
104
	 */
194
	public void setMethod(String value) {
105
	public void setMethod(String value) {
195
		fMethod= value;
106
		super.setMethod(value);
196
		if(fParent != null) {
107
		if(fParent != null) {
197
			fParent.fireElementChanged(this, P_METHOD);
108
			fParent.fireElementChanged(this, P_METHOD);
198
		}
109
		}
(-)src/org/eclipse/tptp/platform/instrumentation/ui/internal/util/InstrumentUtil.java (-5 / +42 lines)
Lines 34-41 Link Here
34
import org.eclipse.core.resources.IContainer;
34
import org.eclipse.core.resources.IContainer;
35
import org.eclipse.core.resources.IFile;
35
import org.eclipse.core.resources.IFile;
36
import org.eclipse.core.resources.IFolder;
36
import org.eclipse.core.resources.IFolder;
37
import org.eclipse.core.resources.IProject;
38
import org.eclipse.core.resources.IProjectDescription;
39
import org.eclipse.core.resources.IResource;
37
import org.eclipse.core.resources.IResource;
40
import org.eclipse.core.resources.IWorkspaceRoot;
38
import org.eclipse.core.resources.IWorkspaceRoot;
41
import org.eclipse.core.resources.ResourcesPlugin;
39
import org.eclipse.core.resources.ResourcesPlugin;
Lines 46-52 Link Here
46
import org.eclipse.core.runtime.Platform;
44
import org.eclipse.core.runtime.Platform;
47
import org.eclipse.debug.core.ILaunchConfiguration;
45
import org.eclipse.debug.core.ILaunchConfiguration;
48
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
46
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
49
import org.eclipse.hyades.trace.internal.ui.TraceConstants;
50
import org.eclipse.hyades.trace.ui.UIPlugin;
47
import org.eclipse.hyades.trace.ui.UIPlugin;
51
import org.eclipse.hyades.trace.ui.internal.launcher.IProfileLaunchConfigurationConstants;
48
import org.eclipse.hyades.trace.ui.internal.launcher.IProfileLaunchConfigurationConstants;
52
import org.eclipse.hyades.trace.ui.internal.util.FilterSetElement;
49
import org.eclipse.hyades.trace.ui.internal.util.FilterSetElement;
Lines 63-76 Link Here
63
import org.eclipse.jdt.core.JavaModelException;
60
import org.eclipse.jdt.core.JavaModelException;
64
import org.eclipse.jdt.core.dom.Statement;
61
import org.eclipse.jdt.core.dom.Statement;
65
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
62
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
63
import org.eclipse.jdt.launching.IVMInstall2;
64
import org.eclipse.jdt.launching.JavaRuntime;
66
import org.eclipse.jdt.ui.jarpackager.JarPackageData;
65
import org.eclipse.jdt.ui.jarpackager.JarPackageData;
67
import org.eclipse.jface.preference.IPreferenceStore;
66
import org.eclipse.jface.preference.IPreferenceStore;
68
import org.eclipse.jface.text.IRegion;
67
import org.eclipse.jface.text.IRegion;
69
import org.eclipse.jface.text.Region;
68
import org.eclipse.jface.text.Region;
70
import org.eclipse.tptp.platform.common.ui.trace.internal.CommonUITraceConstants;
69
import org.eclipse.tptp.platform.common.ui.trace.internal.CommonUITraceConstants;
70
import org.eclipse.tptp.platform.instrumentation.annotation.internal.util.AnnotationUtil;
71
import org.eclipse.tptp.platform.instrumentation.annotation.internal.util.BaseFilterTableElement;
71
import org.eclipse.tptp.platform.instrumentation.ui.internal.InstrumentConstants;
72
import org.eclipse.tptp.platform.instrumentation.ui.internal.InstrumentConstants;
72
import org.eclipse.tptp.platform.instrumentation.ui.internal.InstrumentUIPlugin;
73
import org.eclipse.tptp.platform.instrumentation.ui.internal.InstrumentUIPlugin;
73
import org.eclipse.tptp.platform.instrumentation.ui.internal.LogHelper;
74
import org.eclipse.tptp.platform.instrumentation.ui.internal.core.InstrumentPoint;
74
import org.eclipse.tptp.platform.instrumentation.ui.internal.core.InstrumentPoint;
75
import org.eclipse.tptp.platform.instrumentation.ui.internal.core.InstrumentSelectManager;
75
import org.eclipse.tptp.platform.instrumentation.ui.internal.core.InstrumentSelectManager;
76
import org.eclipse.tptp.platform.instrumentation.ui.internal.launcher.deleg.application.InstrumentLaunchConfiguration;
76
import org.eclipse.tptp.platform.instrumentation.ui.internal.launcher.deleg.application.InstrumentLaunchConfiguration;
Lines 206-212 Link Here
206
		if (!doesRuleExist(parent.toString())) {
206
		if (!doesRuleExist(parent.toString())) {
207
			parent.append("PROBE" + lineSeparator); //$NON-NLS-1$
207
			parent.append("PROBE" + lineSeparator); //$NON-NLS-1$
208
			for (Iterator targetIter = filterElement.getChildren().iterator(); targetIter.hasNext();) {
208
			for (Iterator targetIter = filterElement.getChildren().iterator(); targetIter.hasNext();) {
209
				InstrumentFilterTableElement t = (InstrumentFilterTableElement) targetIter.next();
209
				BaseFilterTableElement t = (BaseFilterTableElement) targetIter.next();
210
				String pkg = t.getPackageName();
210
				String pkg = t.getPackageName();
211
				if (emptyNullOrStar(pkg))
211
				if (emptyNullOrStar(pkg))
212
					pkg = "*"; //$NON-NLS-1$
212
					pkg = "*"; //$NON-NLS-1$
Lines 871-874 Link Here
871
		}
871
		}
872
		return result;
872
		return result;
873
	}
873
	}
874
	
875
	/**
876
	 * @see AnnotationUtil#appendAnnotationToFilterSet(ILaunchConfiguration, FilterSetElement)
877
	 */
878
	public static void appendAnnotationToFilterSet(ILaunchConfiguration configuration,FilterSetElement filterSetElement) throws CoreException {
879
		if (!isAnnotationSupported(configuration))
880
			return;
881
		//delegate action to AnnotationUtil class
882
		AnnotationUtil.appendAnnotationToFilterSet(configuration, filterSetElement);
883
	}
884
	
885
	/**
886
	 * 
887
	 * @see AnnotationUtil#handleAnnotation(ILaunchConfigurationWorkingCopy)
888
	 */
889
	public static void handleAnnotation(
890
			ILaunchConfigurationWorkingCopy configuration) throws CoreException {
891
		if (!isAnnotationSupported(configuration))
892
			return;
893
		
894
		//delegate action to AnnotationUtil class
895
		AnnotationUtil.handleAnnotation(configuration);
896
	}
897
	
898
	/**
899
	 * determined whether or not need to handle BtM annotation. If JRE version bundled with user project 
900
	 * above Java5, it indicated that BtM runtime don't need to handle BtM annotation information.
901
	 * 
902
	 * @param configuration launch configuration
903
	 * @return true if JRE version is newer or above Java5,otherwise false.
904
	 * @throws CoreException
905
	 */
906
	private static boolean isAnnotationSupported(ILaunchConfiguration configuration)throws CoreException{
907
		IVMInstall2 vmInstall =(IVMInstall2)JavaRuntime.computeVMInstall(configuration);
908
		String version = vmInstall.getJavaVersion();
909
		return version != null  && version.indexOf("1.3") == -1 && version.indexOf("1.4") == -1;
910
	}
874
}
911
}
(-)src/org/eclipse/tptp/platform/instrumentation/ui/internal/launcher/deleg/application/InstrumentDelegateHelper.java (+3 lines)
Lines 102-107 Link Here
102
		FilterSetElement filterSetElement = InstrumentUtil.getActiveFilterSetElement(configuration);
102
		FilterSetElement filterSetElement = InstrumentUtil.getActiveFilterSetElement(configuration);
103
		ILaunchConfigurationWorkingCopy workingCopy = configuration.getWorkingCopy();
103
		ILaunchConfigurationWorkingCopy workingCopy = configuration.getWorkingCopy();
104
		
104
		
105
		//process BtM annotation from user java file 
106
		InstrumentUtil.handleAnnotation(workingCopy);		
107
		
105
		/* Create Project and Model */
108
		/* Create Project and Model */
106
		createModelEntities(configuration);
109
		createModelEntities(configuration);
107
		
110
		
(-)META-INF/MANIFEST.MF (-2 / +3 lines)
Lines 2-8 Link Here
2
Bundle-ManifestVersion: 2
2
Bundle-ManifestVersion: 2
3
Bundle-Name: %pluginName
3
Bundle-Name: %pluginName
4
Bundle-SymbolicName: org.eclipse.tptp.platform.instrumentation.ui;singleton:=true
4
Bundle-SymbolicName: org.eclipse.tptp.platform.instrumentation.ui;singleton:=true
5
Bundle-Version: 4.3.1.qualifier
5
Bundle-Version: 4.5.0.qualifier
6
Bundle-Activator: org.eclipse.tptp.platform.instrumentation.ui.internal.InstrumentUIPlugin
6
Bundle-Activator: org.eclipse.tptp.platform.instrumentation.ui.internal.InstrumentUIPlugin
7
Bundle-Vendor: %providerName
7
Bundle-Vendor: %providerName
8
Bundle-Localization: plugin
8
Bundle-Localization: plugin
Lines 20-26 Link Here
20
 org.eclipse.ui.workbench.texteditor;bundle-version="[3.2.0,4.0.0)",
20
 org.eclipse.ui.workbench.texteditor;bundle-version="[3.2.0,4.0.0)",
21
 org.eclipse.core.expressions;bundle-version="[3.2.0,4.0.0)",
21
 org.eclipse.core.expressions;bundle-version="[3.2.0,4.0.0)",
22
 org.eclipse.tptp.platform.integration.pde;bundle-version="[4.4.0,5.0.0)";resolution:=optional,
22
 org.eclipse.tptp.platform.integration.pde;bundle-version="[4.4.0,5.0.0)";resolution:=optional,
23
 org.eclipse.tptp.platform.execution
23
 org.eclipse.tptp.platform.execution,
24
 org.eclipse.tptp.platform.instrumentation.annotation
24
Eclipse-LazyStart: true
25
Eclipse-LazyStart: true
25
Export-Package: org.eclipse.tptp.platform.instrumentation.ui.internal,
26
Export-Package: org.eclipse.tptp.platform.instrumentation.ui.internal,
26
 org.eclipse.tptp.platform.instrumentation.ui.internal.configuration,
27
 org.eclipse.tptp.platform.instrumentation.ui.internal.configuration,
(-)plugin.properties (-1 / +1 lines)
Lines 15-21 Link Here
15
# NLS_MESSAGEFORMAT_VAR
15
# NLS_MESSAGEFORMAT_VAR
16
16
17
#Plugin.xml entries
17
#Plugin.xml entries
18
pluginName   = Instrument Core UI
18
pluginName   = TPTP Instrumentation UI Core
19
providerName = Eclipse.org
19
providerName = Eclipse.org
20
20
21
INSTRUMENT = Instrument Filter
21
INSTRUMENT = Instrument Filter
(-)META-INF/MANIFEST.MF (-1 / +1 lines)
Lines 2-8 Link Here
2
Bundle-ManifestVersion: 2
2
Bundle-ManifestVersion: 2
3
Bundle-Name: %pluginName
3
Bundle-Name: %pluginName
4
Bundle-SymbolicName: org.eclipse.tptp.trace.arm.ui;singleton:=true
4
Bundle-SymbolicName: org.eclipse.tptp.trace.arm.ui;singleton:=true
5
Bundle-Version: 4.3.100.qualifier
5
Bundle-Version: 4.5.0.qualifier
6
Bundle-Activator: org.eclipse.tptp.trace.arm.ui.internal.ArmUIPlugin
6
Bundle-Activator: org.eclipse.tptp.trace.arm.ui.internal.ArmUIPlugin
7
Bundle-Vendor: %providerName
7
Bundle-Vendor: %providerName
8
Bundle-Localization: plugin
8
Bundle-Localization: plugin
(-)src/org/eclipse/tptp/trace/arm/ui/provisional/handler/ARMInstrumentHandler.java (-24 / +27 lines)
Lines 137-168 Link Here
137
			//return current instrument point
137
			//return current instrument point
138
			String instrumentPointId = launchconfiguration.getAttribute(InstrumentLaunchConfiguration.CURRENT_INSTRUMENT_POINT, (String)null);
138
			String instrumentPointId = launchconfiguration.getAttribute(InstrumentLaunchConfiguration.CURRENT_INSTRUMENT_POINT, (String)null);
139
			if( instrumentPointId == null)
139
			if( instrumentPointId == null)
140
				return filterElement;
141
			
142
			//construct related key of instrument point filters 
143
			String activeFilterKey = ArmConstants.ACTIVE_FILTER_PREFIX + instrumentPointId;
144
			String filterSetKey = ArmConstants.FILTER_SET_PREFIX + instrumentPointId + "_" + launchconfiguration.getName();
145
			
146
			//retrieve filter set of current instrument point from internal cache
147
			Map filterSetMap = InstrumentSelectManager.getInstance().getFilterSet(filterSetKey);
148
			if (filterSetMap == null) {
149
				//save default filter set of current instrument point into internal cache
150
				String filterSetValue = ArmUtil.getInstrumentPointFilterSet(instrumentPointId);
151
				InstrumentSelectManager.getInstance().storeSelectionListInCache(filterSetKey, filterSetValue);
152
			}
153
			
154
			String activefilterSetId = launchconfiguration.getAttribute(activeFilterKey, (String)null);
155
			if( activefilterSetId == null)
156
				result = (FilterSetElement)InstrumentSelectManager.getInstance().getFilterSetCopy(filterSetKey).iterator().next();
157
			else
158
				result = InstrumentSelectManager.getInstance().getFilterSetElement(filterSetKey, activefilterSetId);
159
			
160
			if (result == null) {
161
				result = filterElement;
140
				result = filterElement;
141
			else{			
142
				//construct related key of instrument point filters 
143
				String activeFilterKey = ArmConstants.ACTIVE_FILTER_PREFIX + instrumentPointId;
144
				String filterSetKey = ArmConstants.FILTER_SET_PREFIX + instrumentPointId + "_" + launchconfiguration.getName();
145
				
146
				//retrieve filter set of current instrument point from internal cache
147
				Map filterSetMap = InstrumentSelectManager.getInstance().getFilterSet(filterSetKey);
148
				if (filterSetMap == null) {
149
					//save default filter set of current instrument point into internal cache
150
					String filterSetValue = ArmUtil.getInstrumentPointFilterSet(instrumentPointId);
151
					InstrumentSelectManager.getInstance().storeSelectionListInCache(filterSetKey, filterSetValue);
152
				}
153
				
154
				String activefilterSetId = launchconfiguration.getAttribute(activeFilterKey, (String)null);
155
				if( activefilterSetId == null)
156
					result = (FilterSetElement)InstrumentSelectManager.getInstance().getFilterSetCopy(filterSetKey).iterator().next();
157
				else
158
					result = InstrumentSelectManager.getInstance().getFilterSetElement(filterSetKey, activefilterSetId);
159
				
160
				if (result == null) {
161
					result = filterElement;
162
				}
163
				
164
				/* Combine the two list */
165
				result.getChildren().addAll(filterElement.getChildren());
162
			}
166
			}
163
			
167
			//append filter set element from BtM annotation to result filter set
164
			/* Combine the two list */
168
			InstrumentUtil.appendAnnotationToFilterSet(launchconfiguration, result);
165
			result.getChildren().addAll(filterElement.getChildren());
166
			
169
			
167
		} catch (CoreException e) {
170
		} catch (CoreException e) {
168
			LogHelper.error(e);
171
			LogHelper.error(e);

Return to bug 194954