diff options
author | Szymon Ptaszkiewicz | 2014-11-17 09:34:48 +0000 |
---|---|---|
committer | Szymon Ptaszkiewicz | 2014-11-17 09:34:48 +0000 |
commit | 770b282bc458d759b7e02cce21e6164182374fbc (patch) | |
tree | 9c08b00242ecfe64ca7e9c6891ba065b23744620 | |
parent | a5a6c81e13e1341b9f8ac12f72b9e864c49505d7 (diff) | |
download | eclipse.platform.team-770b282bc458d759b7e02cce21e6164182374fbc.tar.gz eclipse.platform.team-770b282bc458d759b7e02cce21e6164182374fbc.tar.xz eclipse.platform.team-770b282bc458d759b7e02cce21e6164182374fbc.zip |
Bug 451739 - Add org.eclipse.team.cvs.ssh plugin to General > Tracing preference page
5 files changed, 56 insertions, 12 deletions
diff --git a/bundles/org.eclipse.team.cvs.ssh/build.properties b/bundles/org.eclipse.team.cvs.ssh/build.properties index 6f55f184b..f681f7af6 100644 --- a/bundles/org.eclipse.team.cvs.ssh/build.properties +++ b/bundles/org.eclipse.team.cvs.ssh/build.properties @@ -1,5 +1,5 @@ ############################################################################### -# Copyright (c) 2000, 2008 IBM Corporation and others. +# Copyright (c) 2000, 2014 IBM Corporation and others. # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available at @@ -15,4 +15,5 @@ bin.includes = about.html,\ plugin.properties,\ .,\ .options,\ - META-INF/ + META-INF/,\ + plugin.xml diff --git a/bundles/org.eclipse.team.cvs.ssh/plugin.properties b/bundles/org.eclipse.team.cvs.ssh/plugin.properties index 0fe9f3bcc..8a84ddab1 100644 --- a/bundles/org.eclipse.team.cvs.ssh/plugin.properties +++ b/bundles/org.eclipse.team.cvs.ssh/plugin.properties @@ -1,5 +1,5 @@ ############################################################################### -# Copyright (c) 2000, 2006 IBM Corporation and others. +# Copyright (c) 2000, 2014 IBM Corporation and others. # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available at @@ -10,3 +10,4 @@ ############################################################################### providerName=Eclipse.org pluginName=CVS SSH Core +traceComponentLabel=Platform Team CVS SSH diff --git a/bundles/org.eclipse.team.cvs.ssh/plugin.xml b/bundles/org.eclipse.team.cvs.ssh/plugin.xml new file mode 100644 index 000000000..6a47c84ed --- /dev/null +++ b/bundles/org.eclipse.team.cvs.ssh/plugin.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<?eclipse version="3.4"?> +<plugin> + <extension + point="org.eclipse.ui.trace.traceComponents"> + <component + id="org.eclipse.team.cvs.ssh.trace" + label="%traceComponentLabel"> + <bundle + consumed="false" + name="org.eclipse.team.cvs.ssh"> + </bundle> + </component> + </extension> +</plugin> diff --git a/bundles/org.eclipse.team.cvs.ssh/src/org/eclipse/team/internal/ccvs/ssh/Policy.java b/bundles/org.eclipse.team.cvs.ssh/src/org/eclipse/team/internal/ccvs/ssh/Policy.java index d9f2d06fc..d06f04028 100644 --- a/bundles/org.eclipse.team.cvs.ssh/src/org/eclipse/team/internal/ccvs/ssh/Policy.java +++ b/bundles/org.eclipse.team.cvs.ssh/src/org/eclipse/team/internal/ccvs/ssh/Policy.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2009 IBM Corporation and others. + * Copyright (c) 2000, 2014 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -10,16 +10,17 @@ *******************************************************************************/ package org.eclipse.team.internal.ccvs.ssh; -import org.eclipse.core.runtime.Platform; +import org.eclipse.osgi.service.debug.DebugOptions; +import org.eclipse.osgi.service.debug.DebugOptionsListener; public class Policy { // debug constants public static boolean DEBUG_SSH_PROTOCOL = false; - static { - // init debug options - if (SSHPlugin.getPlugin().isDebugging()) { - DEBUG_SSH_PROTOCOL = "true".equalsIgnoreCase(Platform.getDebugOption(SSHPlugin.ID + "/ssh_protocol"));//$NON-NLS-1$ //$NON-NLS-2$ + static final DebugOptionsListener DEBUG_OPTIONS_LISTENER = new DebugOptionsListener() { + public void optionsChanged(DebugOptions options) { + boolean DEBUG = options.getBooleanOption(SSHPlugin.ID + "/debug", false); //$NON-NLS-1$ + DEBUG_SSH_PROTOCOL = DEBUG && options.getBooleanOption(SSHPlugin.ID + "/ssh_protocol", false); //$NON-NLS-1$ } - } + }; } diff --git a/bundles/org.eclipse.team.cvs.ssh/src/org/eclipse/team/internal/ccvs/ssh/SSHPlugin.java b/bundles/org.eclipse.team.cvs.ssh/src/org/eclipse/team/internal/ccvs/ssh/SSHPlugin.java index 1240c482d..9bbe51a78 100644 --- a/bundles/org.eclipse.team.cvs.ssh/src/org/eclipse/team/internal/ccvs/ssh/SSHPlugin.java +++ b/bundles/org.eclipse.team.cvs.ssh/src/org/eclipse/team/internal/ccvs/ssh/SSHPlugin.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. + * Copyright (c) 2000, 2014 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -9,14 +9,24 @@ * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.team.internal.ccvs.ssh; + +import java.util.Hashtable; + import org.eclipse.core.runtime.Plugin; import org.eclipse.core.runtime.Status; +import org.eclipse.osgi.service.debug.DebugOptions; +import org.eclipse.osgi.service.debug.DebugOptionsListener; +import org.osgi.framework.BundleContext; +import org.osgi.framework.ServiceRegistration; + public class SSHPlugin extends Plugin { public static String ID = "org.eclipse.team.cvs.ssh"; //$NON-NLS-1$ private static SSHPlugin instance; - + + private ServiceRegistration debugRegistration; + /** * Log the given exception along with the provided message and severity indicator */ @@ -39,4 +49,20 @@ public class SSHPlugin extends Plugin { return instance; } + public void start(BundleContext context) throws Exception { + super.start(context); + + // register debug options listener + Hashtable properties = new Hashtable(2); + properties.put(DebugOptions.LISTENER_SYMBOLICNAME, ID); + debugRegistration = context.registerService(DebugOptionsListener.class, Policy.DEBUG_OPTIONS_LISTENER, properties); + } + + public void stop(BundleContext context) throws Exception { + super.stop(context); + + // unregister debug options listener + debugRegistration.unregister(); + debugRegistration = null; + } } |