Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSzymon Ptaszkiewicz2014-11-17 16:08:00 +0000
committerJayaprakash Arthanareeswaran2014-11-28 11:16:53 +0000
commita892813e8b7a5d041e5d0d3d868b173ea1f47ce5 (patch)
tree3b007ca5d3bf2e6263b50857658a95e81e71907b /org.eclipse.jdt.apt.pluggable.core
parent7c614d1e063fcf9f7927d45e5d481818530396ac (diff)
downloadeclipse.jdt.core-a892813e8b7a5d041e5d0d3d868b173ea1f47ce5.tar.gz
eclipse.jdt.core-a892813e8b7a5d041e5d0d3d868b173ea1f47ce5.tar.xz
eclipse.jdt.core-a892813e8b7a5d041e5d0d3d868b173ea1f47ce5.zip
Bug 451903 - Add org.eclipse.jdt.apt.pluggable.core plugin to General > Tracing preference page
Change-Id: I44e197f753cc05e40120adfbcb31cbcc7c8c5977 Signed-off-by: Szymon Ptaszkiewicz <szymon.ptaszkiewicz@pl.ibm.com>
Diffstat (limited to 'org.eclipse.jdt.apt.pluggable.core')
-rw-r--r--org.eclipse.jdt.apt.pluggable.core/plugin.properties5
-rw-r--r--org.eclipse.jdt.apt.pluggable.core/plugin.xml14
-rw-r--r--org.eclipse.jdt.apt.pluggable.core/src/org/eclipse/jdt/internal/apt/pluggable/core/Apt6Plugin.java36
3 files changed, 40 insertions, 15 deletions
diff --git a/org.eclipse.jdt.apt.pluggable.core/plugin.properties b/org.eclipse.jdt.apt.pluggable.core/plugin.properties
index d6e7bfcdb5..84aa9bfcf4 100644
--- a/org.eclipse.jdt.apt.pluggable.core/plugin.properties
+++ b/org.eclipse.jdt.apt.pluggable.core/plugin.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2006, 2007 IBM Corporation and others.
+# Copyright (c) 2006, 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,4 +10,5 @@
###############################################################################
providerName=Eclipse.org
pluginName=Java Compiler Apt IDE
-compileProblemMarkerName=Annotation Problem (Java 6 processor) \ No newline at end of file
+compileProblemMarkerName=Annotation Problem (Java 6 processor)
+traceComponentLabel=JDT APT Pluggable Core
diff --git a/org.eclipse.jdt.apt.pluggable.core/plugin.xml b/org.eclipse.jdt.apt.pluggable.core/plugin.xml
index 59efc9e764..58973e088d 100644
--- a/org.eclipse.jdt.apt.pluggable.core/plugin.xml
+++ b/org.eclipse.jdt.apt.pluggable.core/plugin.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.2"?>
<!--
- Copyright (c) 2005, 2010 IBM Corporation and others.
+ Copyright (c) 2005, 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
@@ -44,5 +44,15 @@
value="true">
</persistent>
</extension>
-
+ <extension
+ point="org.eclipse.ui.trace.traceComponents">
+ <component
+ id="org.eclipse.jdt.apt.pluggable.core.trace"
+ label="%traceComponentLabel">
+ <bundle
+ consumed="false"
+ name="org.eclipse.jdt.apt.pluggable.core">
+ </bundle>
+ </component>
+ </extension>
</plugin>
diff --git a/org.eclipse.jdt.apt.pluggable.core/src/org/eclipse/jdt/internal/apt/pluggable/core/Apt6Plugin.java b/org.eclipse.jdt.apt.pluggable.core/src/org/eclipse/jdt/internal/apt/pluggable/core/Apt6Plugin.java
index 023fb92f0d..2abc445cf4 100644
--- a/org.eclipse.jdt.apt.pluggable.core/src/org/eclipse/jdt/internal/apt/pluggable/core/Apt6Plugin.java
+++ b/org.eclipse.jdt.apt.pluggable.core/src/org/eclipse/jdt/internal/apt/pluggable/core/Apt6Plugin.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 BEA Systems, Inc.
+ * Copyright (c) 2007, 2014 BEA Systems, Inc. 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
@@ -12,12 +12,15 @@ package org.eclipse.jdt.internal.apt.pluggable.core;
import java.text.SimpleDateFormat;
import java.util.Date;
+import java.util.Hashtable;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
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;
/**
* The plug-in responsible for dispatch of Java 6 (JSR269 Pluggable Annotation
@@ -25,7 +28,7 @@ import org.osgi.framework.BundleContext;
* This is named Apt6Plugin to distinguish it from AptPlugin, which is responsible
* for Java 5 (com.sun.mirror) processors.
*/
-public class Apt6Plugin extends Plugin {
+public class Apt6Plugin extends Plugin implements DebugOptionsListener {
private static final SimpleDateFormat TRACE_DATE_FORMAT = new SimpleDateFormat("HH:mm:ss.SSS"); //$NON-NLS-1$
@@ -42,6 +45,8 @@ public class Apt6Plugin extends Plugin {
private static Apt6Plugin thePlugin = null; // singleton object
+ private ServiceRegistration<DebugOptionsListener> debugRegistration;
+
public Apt6Plugin() {
}
@@ -49,16 +54,25 @@ public class Apt6Plugin extends Plugin {
public void start(BundleContext context) throws Exception {
super.start(context);
thePlugin = this;
- initDebugTracing();
+
+ // register debug options listener
+ Hashtable<String, String> properties = new Hashtable<String, String>(2);
+ properties.put(DebugOptions.LISTENER_SYMBOLICNAME, PLUGIN_ID);
+ debugRegistration = context.registerService(DebugOptionsListener.class, this, properties);
}
-
- private void initDebugTracing() {
- String option = Platform.getDebugOption(APT_DEBUG_OPTION);
- if (option != null) {
- DEBUG = option.equalsIgnoreCase("true"); //$NON-NLS-1$
- }
+
+ public void stop(BundleContext context) throws Exception {
+ super.stop(context);
+
+ // unregister debug options listener
+ debugRegistration.unregister();
+ debugRegistration = null;
}
-
+
+ public void optionsChanged(DebugOptions options) {
+ DEBUG = options.getBooleanOption(APT_DEBUG_OPTION, false);
+ }
+
public static Apt6Plugin getPlugin() {
return thePlugin;
}

Back to the top