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 223543
Collapse All | Expand All

(-)META-INF/MANIFEST.MF (-4 / +12 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.jface.text
4
Bundle-SymbolicName: org.eclipse.jface.text
5
Bundle-Version: 3.4.100.qualifier
5
Bundle-Version: 3.4.200.qualifier
6
Bundle-Vendor: %providerName
6
Bundle-Vendor: %providerName
7
Bundle-Localization: plugin
7
Bundle-Localization: plugin
8
Export-Package: 
8
Export-Package: 
Lines 30-37 Link Here
30
 org.eclipse.jface.text.templates,
30
 org.eclipse.jface.text.templates,
31
 org.eclipse.jface.text.templates.persistence
31
 org.eclipse.jface.text.templates.persistence
32
Require-Bundle: 
32
Require-Bundle: 
33
 org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
34
 org.eclipse.text;bundle-version="[3.4.0,4.0.0)";visibility:=reexport,
33
 org.eclipse.text;bundle-version="[3.4.0,4.0.0)";visibility:=reexport,
35
 org.eclipse.jface;bundle-version="[3.4.0,4.0.0)"
34
 org.eclipse.jface;bundle-version="[3.4.0,4.0.0)",
35
 org.eclipse.equinox.common;bundle-version="[3.2.0,4.0.0)",
36
 org.eclipse.core.jobs;bundle-version="[3.2.0,4.0.0)"
36
Bundle-RequiredExecutionEnvironment: J2SE-1.4
37
Bundle-RequiredExecutionEnvironment: J2SE-1.4
37
Import-Package: com.ibm.icu.text
38
Import-Package: com.ibm.icu.text,
39
 org.eclipse.osgi.service.debug;version="1.0.0",
40
 org.eclipse.osgi.util;version="1.1.0",
41
 org.osgi.framework;version="1.3.0",
42
 org.osgi.service.log;version="1.2.0",
43
 org.osgi.util.tracker;version="1.4.0"
44
Bundle-Activator: org.eclipse.jface.internal.text.JFaceTextActivator
45
Bundle-ActivationPolicy: lazy
(-)src/org/eclipse/jface/text/AbstractInformationControlManager.java (-5 / +6 lines)
Lines 13-21 Link Here
13
package org.eclipse.jface.text;
13
package org.eclipse.jface.text;
14
14
15
15
16
import org.eclipse.core.runtime.Assert;
17
import org.eclipse.core.runtime.Platform;
18
19
import org.eclipse.swt.SWT;
16
import org.eclipse.swt.SWT;
20
import org.eclipse.swt.events.DisposeEvent;
17
import org.eclipse.swt.events.DisposeEvent;
21
import org.eclipse.swt.events.DisposeListener;
18
import org.eclipse.swt.events.DisposeListener;
Lines 26-37 Link Here
26
import org.eclipse.swt.widgets.Display;
23
import org.eclipse.swt.widgets.Display;
27
import org.eclipse.swt.widgets.Monitor;
24
import org.eclipse.swt.widgets.Monitor;
28
25
26
import org.eclipse.core.runtime.Assert;
27
29
import org.eclipse.jface.dialogs.IDialogSettings;
28
import org.eclipse.jface.dialogs.IDialogSettings;
30
import org.eclipse.jface.internal.text.InformationControlReplacer;
29
import org.eclipse.jface.internal.text.InformationControlReplacer;
31
import org.eclipse.jface.internal.text.InternalAccessor;
30
import org.eclipse.jface.internal.text.InternalAccessor;
32
import org.eclipse.jface.text.ITextViewerExtension8.EnrichMode;
31
import org.eclipse.jface.internal.text.JFaceTextActivator;
33
import org.eclipse.jface.util.Geometry;
32
import org.eclipse.jface.util.Geometry;
34
33
34
import org.eclipse.jface.text.ITextViewerExtension8.EnrichMode;
35
35
36
36
/**
37
/**
37
 * Manages the life cycle, visibility, layout, and contents of an
38
 * Manages the life cycle, visibility, layout, and contents of an
Lines 217-223 Link Here
217
	 * </p>
218
	 * </p>
218
	 * @since 3.4
219
	 * @since 3.4
219
	 */
220
	 */
220
	protected static final boolean DEBUG= "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.jface.text/debug/AbstractInformationControlManager"));  //$NON-NLS-1$//$NON-NLS-2$
221
	protected static final boolean DEBUG= JFaceTextActivator.getInstance().getBooleanDebugOption("org.eclipse.jface.text/debug/AbstractInformationControlManager", false); //$NON-NLS-1$
221
222
222
223
223
	/** The subject control of the information control */
224
	/** The subject control of the information control */
(-)src/org/eclipse/jface/text/TextViewerHoverManager.java (-7 / +7 lines)
Lines 11-16 Link Here
11
package org.eclipse.jface.text;
11
package org.eclipse.jface.text;
12
12
13
13
14
import org.osgi.service.log.LogService;
15
14
import org.eclipse.swt.custom.StyledText;
16
import org.eclipse.swt.custom.StyledText;
15
import org.eclipse.swt.events.MouseEvent;
17
import org.eclipse.swt.events.MouseEvent;
16
import org.eclipse.swt.events.MouseMoveListener;
18
import org.eclipse.swt.events.MouseMoveListener;
Lines 18-27 Link Here
18
import org.eclipse.swt.graphics.Rectangle;
20
import org.eclipse.swt.graphics.Rectangle;
19
import org.eclipse.swt.widgets.Display;
21
import org.eclipse.swt.widgets.Display;
20
22
21
import org.eclipse.core.runtime.ILog;
23
import org.eclipse.jface.internal.text.JFaceTextActivator;
22
import org.eclipse.core.runtime.IStatus;
23
import org.eclipse.core.runtime.Platform;
24
import org.eclipse.core.runtime.Status;
25
24
26
25
27
/**
26
/**
Lines 188-196 Link Here
188
					}
187
					}
189
					hasFinished= true;
188
					hasFinished= true;
190
				} catch (RuntimeException ex) {
189
				} catch (RuntimeException ex) {
191
					String PLUGIN_ID= "org.eclipse.jface.text"; //$NON-NLS-1$
190
					// TODO what should we do here?
192
					ILog log= Platform.getLog(Platform.getBundle(PLUGIN_ID));
191
					LogService log = JFaceTextActivator.getInstance().getLogger();
193
					log.log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, "Unexpected runtime error while computing a text hover", ex)); //$NON-NLS-1$
192
					if(log != null)
193
						log.log(LogService.LOG_ERROR, "Unexpected runtime error while computing a text hover", ex); //$NON-NLS-1$
194
				} finally {
194
				} finally {
195
					synchronized (fMutex) {
195
					synchronized (fMutex) {
196
						if (fTextViewer != null)
196
						if (fTextViewer != null)
(-)src/org/eclipse/jface/text/source/AnnotationPainter.java (-2 / +3 lines)
Lines 36-42 Link Here
36
import org.eclipse.swt.widgets.Display;
36
import org.eclipse.swt.widgets.Display;
37
37
38
import org.eclipse.core.runtime.Assert;
38
import org.eclipse.core.runtime.Assert;
39
import org.eclipse.core.runtime.Platform;
39
40
import org.eclipse.jface.internal.text.JFaceTextActivator;
40
41
41
import org.eclipse.jface.text.BadLocationException;
42
import org.eclipse.jface.text.BadLocationException;
42
import org.eclipse.jface.text.IDocument;
43
import org.eclipse.jface.text.IDocument;
Lines 282-288 Link Here
282
	 * Tells whether this class is in debug mode.
283
	 * Tells whether this class is in debug mode.
283
	 * @since 3.0
284
	 * @since 3.0
284
	 */
285
	 */
285
	private static boolean DEBUG= "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.jface.text/debug/AnnotationPainter"));  //$NON-NLS-1$//$NON-NLS-2$
286
	private static boolean DEBUG= JFaceTextActivator.getInstance().getBooleanDebugOption("org.eclipse.jface.text/debug/AnnotationPainter", false); //$NON-NLS-1$
286
	/**
287
	/**
287
	 * The squiggly painter strategy.
288
	 * The squiggly painter strategy.
288
	 * @since 3.0
289
	 * @since 3.0
(-)src/org/eclipse/jface/internal/text/revisions/RevisionPainter.java (-2 / +2 lines)
Lines 42-49 Link Here
42
42
43
import org.eclipse.core.runtime.Assert;
43
import org.eclipse.core.runtime.Assert;
44
import org.eclipse.core.runtime.ListenerList;
44
import org.eclipse.core.runtime.ListenerList;
45
import org.eclipse.core.runtime.Platform;
46
45
46
import org.eclipse.jface.internal.text.JFaceTextActivator;
47
import org.eclipse.jface.internal.text.html.BrowserInformationControl;
47
import org.eclipse.jface.internal.text.html.BrowserInformationControl;
48
import org.eclipse.jface.internal.text.html.HTMLPrinter;
48
import org.eclipse.jface.internal.text.html.HTMLPrinter;
49
import org.eclipse.jface.resource.JFaceResources;
49
import org.eclipse.jface.resource.JFaceResources;
Lines 93-99 Link Here
93
 */
93
 */
94
public final class RevisionPainter {
94
public final class RevisionPainter {
95
	/** Tells whether this class is in debug mode. */
95
	/** Tells whether this class is in debug mode. */
96
	private static boolean DEBUG= "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.jface.text.source/debug/RevisionRulerColumn")); //$NON-NLS-1$//$NON-NLS-2$
96
	private static boolean DEBUG= JFaceTextActivator.getInstance().getBooleanDebugOption("org.eclipse.jface.text.source/debug/RevisionRulerColumn", false); //$NON-NLS-1$
97
97
98
	// RGBs provided by UI Designer
98
	// RGBs provided by UI Designer
99
	private static final RGB BY_DATE_START_COLOR= new RGB(199, 134, 57);
99
	private static final RGB BY_DATE_START_COLOR= new RGB(199, 134, 57);
(-)src/org/eclipse/jface/text/rules/FastPartitioner.java (-3 / +4 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2006 IBM Corporation and others.
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 15-21 Link Here
15
import java.util.List;
15
import java.util.List;
16
16
17
import org.eclipse.core.runtime.Assert;
17
import org.eclipse.core.runtime.Assert;
18
import org.eclipse.core.runtime.Platform;
18
19
import org.eclipse.jface.internal.text.JFaceTextActivator;
19
20
20
import org.eclipse.jface.text.BadLocationException;
21
import org.eclipse.jface.text.BadLocationException;
21
import org.eclipse.jface.text.BadPositionCategoryException;
22
import org.eclipse.jface.text.BadPositionCategoryException;
Lines 95-101 Link Here
95
	 */
96
	 */
96
	private Position[] fCachedPositions= null;
97
	private Position[] fCachedPositions= null;
97
	/** Debug option for cache consistency checking. */
98
	/** Debug option for cache consistency checking. */
98
	private static final boolean CHECK_CACHE_CONSISTENCY= "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.jface.text/debug/FastPartitioner/PositionCache"));  //$NON-NLS-1$//$NON-NLS-2$;
99
	private static final boolean CHECK_CACHE_CONSISTENCY= JFaceTextActivator.getInstance().getBooleanDebugOption("org.eclipse.jface.text/debug/FastPartitioner/PositionCache", false); //$NON-NLS-1$
99
100
100
	/**
101
	/**
101
	 * Creates a new partitioner that uses the given scanner and may return
102
	 * Creates a new partitioner that uses the given scanner and may return
(-)src/org/eclipse/jface/contentassist/AbstractControlContentAssistSubjectAdapter.java (-6 / +7 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2007 IBM Corporation and others.
2
 * Copyright (c) 2000, 2008 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 16-24 Link Here
16
import java.util.List;
16
import java.util.List;
17
import java.util.Set;
17
import java.util.Set;
18
18
19
import org.eclipse.core.runtime.Assert;
20
import org.eclipse.core.runtime.Platform;
21
22
import org.eclipse.swt.SWT;
19
import org.eclipse.swt.SWT;
23
import org.eclipse.swt.custom.VerifyKeyListener;
20
import org.eclipse.swt.custom.VerifyKeyListener;
24
import org.eclipse.swt.events.DisposeEvent;
21
import org.eclipse.swt.events.DisposeEvent;
Lines 31-43 Link Here
31
import org.eclipse.swt.widgets.Event;
28
import org.eclipse.swt.widgets.Event;
32
import org.eclipse.swt.widgets.Listener;
29
import org.eclipse.swt.widgets.Listener;
33
30
31
import org.eclipse.core.runtime.Assert;
32
34
import org.eclipse.jface.fieldassist.ControlDecoration;
33
import org.eclipse.jface.fieldassist.ControlDecoration;
34
import org.eclipse.jface.internal.text.JFaceTextActivator;
35
import org.eclipse.jface.resource.ImageDescriptor;
35
import org.eclipse.jface.resource.ImageDescriptor;
36
import org.eclipse.jface.text.IEventConsumer;
37
import org.eclipse.jface.viewers.ILabelProvider;
36
import org.eclipse.jface.viewers.ILabelProvider;
38
import org.eclipse.jface.viewers.ILabelProviderListener;
37
import org.eclipse.jface.viewers.ILabelProviderListener;
39
import org.eclipse.jface.viewers.LabelProviderChangedEvent;
38
import org.eclipse.jface.viewers.LabelProviderChangedEvent;
40
39
40
import org.eclipse.jface.text.IEventConsumer;
41
41
42
42
/**
43
/**
43
 * An <code>AbstractControlContentAssistSubjectAdapter</code> delegates assistance requests from a
44
 * An <code>AbstractControlContentAssistSubjectAdapter</code> delegates assistance requests from a
Lines 51-57 Link Here
51
 */
52
 */
52
public abstract class AbstractControlContentAssistSubjectAdapter implements IContentAssistSubjectControl {
53
public abstract class AbstractControlContentAssistSubjectAdapter implements IContentAssistSubjectControl {
53
54
54
	protected static final boolean DEBUG= "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.jface.text/debug/ContentAssistSubjectAdapters"));  //$NON-NLS-1$//$NON-NLS-2$
55
	protected static final boolean DEBUG= JFaceTextActivator.getInstance().getBooleanDebugOption("org.eclipse.jface.text/debug/ContentAssistSubjectAdapters", false); //$NON-NLS-1$
55
56
56
	/**
57
	/**
57
	 * VerifyKeyListeners for the control.
58
	 * VerifyKeyListeners for the control.
(-)src/org/eclipse/jface/internal/text/JFaceTextActivator.java (+78 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2008 Code 9 Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 * 
8
 * Contributors:
9
 *     Chris Aniszczyk <zx@code9.com> - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.jface.internal.text;
12
13
import org.osgi.framework.BundleActivator;
14
import org.osgi.framework.BundleContext;
15
import org.osgi.service.log.LogService;
16
import org.osgi.util.tracker.ServiceTracker;
17
18
import org.eclipse.osgi.service.debug.DebugOptions;
19
20
public class JFaceTextActivator implements BundleActivator {
21
22
	private static JFaceTextActivator INSTANCE;
23
	
24
	/**
25
	 * The service tracker for debug options
26
	 */
27
	private ServiceTracker debugTracker = null;
28
	
29
	private ServiceTracker logTracker = null;
30
31
	public JFaceTextActivator() {
32
		// do nothing
33
	}
34
35
	public void start(BundleContext context) throws Exception {
36
		INSTANCE = this;
37
		debugTracker = new ServiceTracker(context, DebugOptions.class.getName(), null);
38
		debugTracker.open();
39
		
40
		debugTracker = new ServiceTracker(context, LogService.class.getName(), null);
41
		debugTracker.open();
42
	}
43
44
	public void stop(BundleContext context) throws Exception {
45
		if (debugTracker != null) {
46
			debugTracker.close();
47
			debugTracker = null;
48
		}
49
		if (logTracker != null) {
50
			logTracker.close();
51
			logTracker = null;
52
		}
53
		INSTANCE = null;
54
	}
55
	
56
	public static JFaceTextActivator getInstance() {
57
		return INSTANCE;
58
	}
59
	
60
	public boolean getBooleanDebugOption(String option, boolean defaultValue) {
61
		if (debugTracker == null) {
62
			return defaultValue;
63
		}
64
		DebugOptions options = (DebugOptions) debugTracker.getService();
65
		if (options != null) {
66
			String value = options.getOption(option);
67
			if (value != null)
68
				return value.equalsIgnoreCase("true"); //$NON-NLS-1$
69
		}
70
		return defaultValue;
71
	}
72
	
73
	public LogService getLogger() {
74
		LogService log = (LogService) logTracker.getService();
75
		return log;
76
	}
77
78
}

Return to bug 223543