org.eclipse.mylar.monitor.usage
Class MylarUsageMonitorPlugin

java.lang.Object
  extended by org.eclipse.core.runtime.Plugin
      extended by org.eclipse.ui.plugin.AbstractUIPlugin
          extended by org.eclipse.mylar.monitor.usage.MylarUsageMonitorPlugin
All Implemented Interfaces:
org.eclipse.ui.IStartup, org.osgi.framework.BundleActivator

public class MylarUsageMonitorPlugin
extends org.eclipse.ui.plugin.AbstractUIPlugin
implements org.eclipse.ui.IStartup

Author:
Mik Kersten

Nested Class Summary
(package private)  class MylarUsageMonitorPlugin.MonitorExtensionPointReader
           
 
Field Summary
private  java.util.List<IActionExecutionListener> actionExecutionListeners
           
private  ActivityChangeMonitor activityMonitor
           
private  boolean backgroundEnabled
           
private  BrowserMonitor browserMonitor
           
private  java.util.List<AbstractCommandMonitor> commandMonitors
           
private  java.lang.String customizingPlugin
           
private  org.eclipse.mylar.context.core.IContextStoreListener DATA_DIR_MOVE_LISTENER
           
static java.lang.String DEFAULT_ACCEPTED_URL_LIST
           
static java.lang.String DEFAULT_CONTACT_CONSENT_FIELD
           
static long DEFAULT_DELAY_BETWEEN_TRANSMITS
           
static java.lang.String DEFAULT_DESCRIPTION
           
static java.lang.String DEFAULT_ETHICS_FORM
           
static java.lang.String DEFAULT_TITLE
           
static java.lang.String DEFAULT_UPLAOD_SCRIPT_QUESTIONNAIRE
           
static java.lang.String DEFAULT_UPLOAD_SCRIPT
           
static java.lang.String DEFAULT_UPLOAD_SCRIPT_ID
           
static java.lang.String DEFAULT_UPLOAD_SERVER
           
static java.lang.String DEFAULT_VERSION
           
private static long DELAY_ON_FAILURE
           
private static long DELAY_ON_USER_REQUEST
           
private static long HOUR
           
private  InteractionEventLogger interactionLogger
           
private  KeybindingCommandMonitor keybindingCommandMonitor
           
private static java.util.Date lastTransmit
           
private  org.eclipse.core.runtime.ListenerList lifecycleListeners
           
private  MenuCommandMonitor menuMonitor
           
static java.lang.String MONITOR_LOG_NAME
           
private  boolean notifiedOfUserIdSubmission
           
private static boolean performingUpload
           
private  PerspectiveChangeMonitor perspectiveMonitor
           
private static MylarUsageMonitorPlugin plugin
           
static java.lang.String PLUGIN_ID
           
static java.lang.String PREF_USER_ID
           
private  PreferenceChangeMonitor preferenceMonitor
           
private  boolean questionnaireEnabled
           
private  java.util.ResourceBundle resourceBundle
           
private  org.eclipse.swt.events.ShellListener SHELL_LISTENER
           
private  StudyParameters studyParameters
           
static java.lang.String UI_PLUGIN_ID
           
static java.lang.String UPLOAD_FILE_LABEL
           
private  org.eclipse.update.internal.ui.security.Authentication uploadAuthentication
           
static java.lang.String VERSION
           
private  org.eclipse.ui.IWindowListener WINDOW_LISTENER
           
private  WindowChangeMonitor windowMonitor
           
 
Fields inherited from class org.eclipse.core.runtime.Plugin
PLUGIN_PREFERENCE_SCOPE, PREFERENCES_DEFAULT_OVERRIDE_BASE_NAME, PREFERENCES_DEFAULT_OVERRIDE_FILE_NAME
 
Constructor Summary
MylarUsageMonitorPlugin()
           
 
Method Summary
 void actionObserved(org.eclipse.jface.action.IAction action, java.lang.String info)
           
 void addMonitoredPreferences(org.eclipse.core.runtime.Preferences preferences)
           
 void addMonitoringLifecycleListener(IMylarMonitorLifecycleListener listener)
           
private  void checkForFirstMonitorUse()
           
private  void checkForStatisticsUpload()
           
 void configureProxy(org.apache.commons.httpclient.HttpClient httpClient)
           
 void earlyStartup()
          Used to start plugin on startup -> entry in plugin.xml to invoke this
 java.util.List<IActionExecutionListener> getActionExecutionListeners()
           
 java.util.List<AbstractCommandMonitor> getCommandMonitors()
           
 java.lang.String getCustomizedByMessage()
           
 java.lang.String getCustomizingPlugin()
           
static MylarUsageMonitorPlugin getDefault()
          Returns the shared instance.
 java.lang.String getExtensionVersion()
           
 InteractionEventLogger getInteractionLogger()
           
 java.io.File getMonitorLogFile()
           
static org.eclipse.jface.preference.IPreferenceStore getPrefs()
           
 java.util.ResourceBundle getResourceBundle()
          Returns the plugin's resource bundle,
static java.lang.String getResourceString(java.lang.String key)
          Returns the string from the plugin's resource bundle, or 'key' if not found.
 StudyParameters getStudyParameters()
           
private  long getUserTransimitDelay()
           
 void incrementObservedEvents(int increment)
           
private  void initDefaultPrefs()
           
private  void installBrowserMonitor(org.eclipse.ui.IWorkbench workbench)
           
 boolean isBackgroundEnabled()
           
 boolean isMonitoringEnabled()
           
 boolean isObfuscationEnabled()
           
static boolean isPerformingUpload()
           
 boolean isQuestionnaireEnabled()
           
 void removeMonitoredPreferences(org.eclipse.core.runtime.Preferences preferences)
           
 void removeMonitoringLifecycleListener(IMylarMonitorLifecycleListener listener)
           
 boolean setAcceptedUrlMatchList(java.lang.String urlBuffer)
           
 void setBackgroundEnabled(boolean backgroundEnabled)
           
static void setPerformingUpload(boolean performingUpload)
           
 void setQuestionnaireEnabled(boolean questionnaireEnabled)
           
 void start(org.osgi.framework.BundleContext context)
           
 void startMonitoring()
           
 void stop(org.osgi.framework.BundleContext context)
           
 void stopMonitoring()
           
private  void uninstallBrowserMonitor(org.eclipse.ui.IWorkbench workbench)
           
 void userCancelSubmitFeedback(java.util.Date currentTime, boolean wait3Hours)
           
 boolean usingContactField()
           
 
Methods inherited from class org.eclipse.ui.plugin.AbstractUIPlugin
createImageRegistry, getDialogSettings, getImageRegistry, getPreferenceStore, getWorkbench, imageDescriptorFromPlugin, initializeDefaultPluginPreferences, initializeDefaultPreferences, initializeImageRegistry, loadDialogSettings, loadPreferenceStore, refreshPluginActions, saveDialogSettings, savePreferenceStore, shutdown, startup
 
Methods inherited from class org.eclipse.core.runtime.Plugin
find, find, getBundle, getDescriptor, getLog, getPluginPreferences, getStateLocation, internalInitializeDefaultPluginPreferences, isDebugging, openStream, openStream, savePluginPreferences, setDebugging, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PREF_USER_ID

public static final java.lang.String PREF_USER_ID
See Also:
Constant Field Values

VERSION

public static java.lang.String VERSION

UPLOAD_FILE_LABEL

public static java.lang.String UPLOAD_FILE_LABEL

HOUR

private static final long HOUR
See Also:
Constant Field Values

DELAY_ON_USER_REQUEST

private static final long DELAY_ON_USER_REQUEST
See Also:
Constant Field Values

DELAY_ON_FAILURE

private static final long DELAY_ON_FAILURE
See Also:
Constant Field Values

DEFAULT_TITLE

public static final java.lang.String DEFAULT_TITLE
See Also:
Constant Field Values

DEFAULT_DESCRIPTION

public static final java.lang.String DEFAULT_DESCRIPTION
See Also:
Constant Field Values

DEFAULT_DELAY_BETWEEN_TRANSMITS

public static final long DEFAULT_DELAY_BETWEEN_TRANSMITS
See Also:
Constant Field Values

DEFAULT_ETHICS_FORM

public static final java.lang.String DEFAULT_ETHICS_FORM
See Also:
Constant Field Values

DEFAULT_VERSION

public static final java.lang.String DEFAULT_VERSION
See Also:
Constant Field Values

DEFAULT_UPLOAD_SERVER

public static final java.lang.String DEFAULT_UPLOAD_SERVER
See Also:
Constant Field Values

DEFAULT_UPLOAD_SCRIPT_ID

public static final java.lang.String DEFAULT_UPLOAD_SCRIPT_ID
See Also:
Constant Field Values

DEFAULT_UPLOAD_SCRIPT

public static final java.lang.String DEFAULT_UPLOAD_SCRIPT
See Also:
Constant Field Values

DEFAULT_UPLAOD_SCRIPT_QUESTIONNAIRE

public static final java.lang.String DEFAULT_UPLAOD_SCRIPT_QUESTIONNAIRE
See Also:
Constant Field Values

DEFAULT_ACCEPTED_URL_LIST

public static final java.lang.String DEFAULT_ACCEPTED_URL_LIST
See Also:
Constant Field Values

DEFAULT_CONTACT_CONSENT_FIELD

public static final java.lang.String DEFAULT_CONTACT_CONSENT_FIELD
See Also:
Constant Field Values

UI_PLUGIN_ID

public static final java.lang.String UI_PLUGIN_ID
See Also:
Constant Field Values

MONITOR_LOG_NAME

public static final java.lang.String MONITOR_LOG_NAME
See Also:
Constant Field Values

PLUGIN_ID

public static final java.lang.String PLUGIN_ID
See Also:
Constant Field Values

interactionLogger

private InteractionEventLogger interactionLogger

customizingPlugin

private java.lang.String customizingPlugin

preferenceMonitor

private PreferenceChangeMonitor preferenceMonitor

perspectiveMonitor

private PerspectiveChangeMonitor perspectiveMonitor

activityMonitor

private ActivityChangeMonitor activityMonitor

menuMonitor

private MenuCommandMonitor menuMonitor

windowMonitor

private WindowChangeMonitor windowMonitor

keybindingCommandMonitor

private KeybindingCommandMonitor keybindingCommandMonitor

browserMonitor

private BrowserMonitor browserMonitor

plugin

private static MylarUsageMonitorPlugin plugin

actionExecutionListeners

private java.util.List<IActionExecutionListener> actionExecutionListeners

commandMonitors

private java.util.List<AbstractCommandMonitor> commandMonitors

resourceBundle

private java.util.ResourceBundle resourceBundle

lastTransmit

private static java.util.Date lastTransmit

notifiedOfUserIdSubmission

private boolean notifiedOfUserIdSubmission

uploadAuthentication

private org.eclipse.update.internal.ui.security.Authentication uploadAuthentication

performingUpload

private static boolean performingUpload

questionnaireEnabled

private boolean questionnaireEnabled

backgroundEnabled

private boolean backgroundEnabled

studyParameters

private StudyParameters studyParameters

lifecycleListeners

private org.eclipse.core.runtime.ListenerList lifecycleListeners

WINDOW_LISTENER

private org.eclipse.ui.IWindowListener WINDOW_LISTENER

SHELL_LISTENER

private org.eclipse.swt.events.ShellListener SHELL_LISTENER

DATA_DIR_MOVE_LISTENER

private org.eclipse.mylar.context.core.IContextStoreListener DATA_DIR_MOVE_LISTENER
Constructor Detail

MylarUsageMonitorPlugin

public MylarUsageMonitorPlugin()
Method Detail

initDefaultPrefs

private void initDefaultPrefs()

start

public void start(org.osgi.framework.BundleContext context)
           throws java.lang.Exception
Specified by:
start in interface org.osgi.framework.BundleActivator
Overrides:
start in class org.eclipse.ui.plugin.AbstractUIPlugin
Throws:
java.lang.Exception

earlyStartup

public void earlyStartup()
Used to start plugin on startup -> entry in plugin.xml to invoke this

Specified by:
earlyStartup in interface org.eclipse.ui.IStartup

startMonitoring

public void startMonitoring()

addMonitoredPreferences

public void addMonitoredPreferences(org.eclipse.core.runtime.Preferences preferences)

removeMonitoredPreferences

public void removeMonitoredPreferences(org.eclipse.core.runtime.Preferences preferences)

isObfuscationEnabled

public boolean isObfuscationEnabled()

stopMonitoring

public void stopMonitoring()

addMonitoringLifecycleListener

public void addMonitoringLifecycleListener(IMylarMonitorLifecycleListener listener)

removeMonitoringLifecycleListener

public void removeMonitoringLifecycleListener(IMylarMonitorLifecycleListener listener)

stop

public void stop(org.osgi.framework.BundleContext context)
          throws java.lang.Exception
Specified by:
stop in interface org.osgi.framework.BundleActivator
Overrides:
stop in class org.eclipse.ui.plugin.AbstractUIPlugin
Throws:
java.lang.Exception

actionObserved

public void actionObserved(org.eclipse.jface.action.IAction action,
                           java.lang.String info)

getActionExecutionListeners

public java.util.List<IActionExecutionListener> getActionExecutionListeners()

getCommandMonitors

public java.util.List<AbstractCommandMonitor> getCommandMonitors()

installBrowserMonitor

private void installBrowserMonitor(org.eclipse.ui.IWorkbench workbench)

uninstallBrowserMonitor

private void uninstallBrowserMonitor(org.eclipse.ui.IWorkbench workbench)

getMonitorLogFile

public java.io.File getMonitorLogFile()

getUserTransimitDelay

private long getUserTransimitDelay()

userCancelSubmitFeedback

public void userCancelSubmitFeedback(java.util.Date currentTime,
                                     boolean wait3Hours)

getDefault

public static MylarUsageMonitorPlugin getDefault()
Returns the shared instance.


getResourceString

public static java.lang.String getResourceString(java.lang.String key)
Returns the string from the plugin's resource bundle, or 'key' if not found.


getResourceBundle

public java.util.ResourceBundle getResourceBundle()
Returns the plugin's resource bundle,


checkForFirstMonitorUse

private void checkForFirstMonitorUse()

checkForStatisticsUpload

private void checkForStatisticsUpload()

incrementObservedEvents

public void incrementObservedEvents(int increment)

configureProxy

public void configureProxy(org.apache.commons.httpclient.HttpClient httpClient)

getPrefs

public static org.eclipse.jface.preference.IPreferenceStore getPrefs()

isPerformingUpload

public static boolean isPerformingUpload()

setPerformingUpload

public static void setPerformingUpload(boolean performingUpload)

getInteractionLogger

public InteractionEventLogger getInteractionLogger()

isQuestionnaireEnabled

public boolean isQuestionnaireEnabled()

setQuestionnaireEnabled

public void setQuestionnaireEnabled(boolean questionnaireEnabled)

getStudyParameters

public StudyParameters getStudyParameters()

getCustomizingPlugin

public java.lang.String getCustomizingPlugin()

isMonitoringEnabled

public boolean isMonitoringEnabled()

getCustomizedByMessage

public java.lang.String getCustomizedByMessage()

setAcceptedUrlMatchList

public boolean setAcceptedUrlMatchList(java.lang.String urlBuffer)
Returns:
true if the list was set

isBackgroundEnabled

public boolean isBackgroundEnabled()

setBackgroundEnabled

public void setBackgroundEnabled(boolean backgroundEnabled)

getExtensionVersion

public java.lang.String getExtensionVersion()

usingContactField

public boolean usingContactField()