Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[mylar-dev] Disabling the submission of usage data in org.eclipse.mylar.monitor.usage

I want to use the org.eclipse.mylar.monitor.usage package for my study to monitor people's interaction with JavaElements in Eclipse. Using the org.eclipse.mylar.monitor.usage package triggers the UsageSubmissionWizard to pop up in some cases, even though I do not want this to happen. Therefore, to disable the popping up I added a variable to enable and disable the feature (the changes are in the attached patch). However, I don't think it is a good solution as the variable should actually be set before the start method of the MylarUsageMonitorPlugin is called or the variable should maybe be loaded from the preferences. Maybe someone else has a better solution to this.

Thomas Fritz
### Eclipse Workspace Patch 1.0
#P org.eclipse.mylar.monitor.usage
Index: src/org/eclipse/mylar/monitor/usage/MylarUsageMonitorPlugin.java
===================================================================
RCS file: /cvsroot/technology/org.eclipse.mylar/org.eclipse.mylar.monitor.usage/src/org/eclipse/mylar/monitor/usage/MylarUsageMonitorPlugin.java,v
retrieving revision 1.11
diff -u -r1.11 MylarUsageMonitorPlugin.java
--- src/org/eclipse/mylar/monitor/usage/MylarUsageMonitorPlugin.java	1 Dec 2006 18:17:43 -0000	1.11
+++ src/org/eclipse/mylar/monitor/usage/MylarUsageMonitorPlugin.java	21 Jan 2007 23:43:12 -0000
@@ -158,6 +158,9 @@
 	private StudyParameters studyParameters = new StudyParameters();
 
 	private ListenerList lifecycleListeners = new ListenerList();
+	
+	private boolean usageSubmissionEnabled = false;
+	
 
 	private IWindowListener WINDOW_LISTENER = new IWindowListener() {
 		public void windowActivated(IWorkbenchWindow window) {
@@ -512,6 +515,8 @@
 	}
 
 	private void checkForFirstMonitorUse() {
+		if(!usageSubmissionEnabled)
+			return;
 		if (!isMonitoringEnabled())
 			return;
 		if (!notifiedOfUserIdSubmission
@@ -527,6 +532,8 @@
 	}
 
 	private void checkForStatisticsUpload() {
+		if(!usageSubmissionEnabled)
+			return;
 		if (!isMonitoringEnabled())
 			return;
 		if (plugin == null || plugin.getPreferenceStore() == null)
@@ -809,6 +816,15 @@
 		else
 			return false;
 	}
+	
+	public void setUsageSubmissionEnabled(boolean submissionEnabled) {
+		usageSubmissionEnabled = submissionEnabled;
+	}
+	
+	public boolean isUsageSubmissionEnabled() {
+		return usageSubmissionEnabled;
+	}
+	
 }
 
 // private void installPreferenceMonitoring() {

Back to the top