View | Details | Raw Unified | Return to bug 406994
Collapse All | Expand All

(-)META-INF/MANIFEST.MF (-1 / +1 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.ui.workbench.texteditor; singleton:=true
4
Bundle-SymbolicName: org.eclipse.ui.workbench.texteditor; singleton:=true
5
Bundle-Version: 3.8.100.qualifier
5
Bundle-Version: 3.9.0.qualifier
6
Bundle-Activator: org.eclipse.ui.internal.texteditor.TextEditorPlugin
6
Bundle-Activator: org.eclipse.ui.internal.texteditor.TextEditorPlugin
7
Bundle-ActivationPolicy: lazy
7
Bundle-ActivationPolicy: lazy
8
Bundle-Vendor: %providerName
8
Bundle-Vendor: %providerName
(-)pom.xml (-1 / +1 lines)
Lines 18-23 Link Here
18
  </parent>
18
  </parent>
19
  <groupId>org.eclipse.ui</groupId>
19
  <groupId>org.eclipse.ui</groupId>
20
  <artifactId>org.eclipse.ui.workbench.texteditor</artifactId>
20
  <artifactId>org.eclipse.ui.workbench.texteditor</artifactId>
21
  <version>3.8.100-SNAPSHOT</version>
21
  <version>3.9.0-SNAPSHOT</version>
22
  <packaging>eclipse-plugin</packaging>
22
  <packaging>eclipse-plugin</packaging>
23
</project>
23
</project>
(-)src/org/eclipse/ui/texteditor/HyperlinkDetectorDescriptor.java (-5 / +17 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2007, 2008 IBM Corporation and others.
2
 * Copyright (c) 2007, 2013 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 82-95 Link Here
82
	}
82
	}
83
83
84
	/**
84
	/**
85
	 * Creates a new {@link IHyperlinkDetector}.
85
	 * Creates a new {@link AbstractHyperlinkDetector}.
86
	 *
86
	 * 
87
	 * @return the hyperlink detector or <code>null</code> if the plug-in isn't loaded yet
87
	 * @return the hyperlink detector or <code>null</code> if the plug-in isn't loaded yet
88
	 * @throws CoreException if a failure occurred during creation
88
	 * @throws CoreException if a failure occurred during creation
89
	 * @deprecated As of 3.9, replaced by {@link #createHyperlinkDetectorImplementation()}
89
	 */
90
	 */
90
	public AbstractHyperlinkDetector createHyperlinkDetector() throws CoreException {
91
	public AbstractHyperlinkDetector createHyperlinkDetector() throws CoreException {
92
		return (AbstractHyperlinkDetector)createHyperlinkDetectorImplementation();
93
	}
94
95
	/**
96
	 * Creates a new {@link IHyperlinkDetector}.
97
	 * 
98
	 * @return the hyperlink detector or <code>null</code> if the plug-in isn't loaded yet
99
	 * @throws CoreException if a failure occurred during creation
100
	 * @since 3.9
101
	 */
102
	public IHyperlinkDetector createHyperlinkDetectorImplementation() throws CoreException {
91
		final Throwable[] exception= new Throwable[1];
103
		final Throwable[] exception= new Throwable[1];
92
		final AbstractHyperlinkDetector[] result= new AbstractHyperlinkDetector[1];
104
		final IHyperlinkDetector[] result= new IHyperlinkDetector[1];
93
		String message= NLSUtility.format(EditorMessages.Editor_error_HyperlinkDetector_couldNotCreate_message, new String[] { getId(), fElement.getContributor().getName() });
105
		String message= NLSUtility.format(EditorMessages.Editor_error_HyperlinkDetector_couldNotCreate_message, new String[] { getId(), fElement.getContributor().getName() });
94
		ISafeRunnable code= new SafeRunnable(message) {
106
		ISafeRunnable code= new SafeRunnable(message) {
95
			/*
107
			/*
Lines 99-105 Link Here
99
		 		String pluginId = fElement.getContributor().getName();
111
		 		String pluginId = fElement.getContributor().getName();
100
				boolean isPlugInActivated= Platform.getBundle(pluginId).getState() == Bundle.ACTIVE;
112
				boolean isPlugInActivated= Platform.getBundle(pluginId).getState() == Bundle.ACTIVE;
101
				if (isPlugInActivated || canActivatePlugIn())
113
				if (isPlugInActivated || canActivatePlugIn())
102
					result[0]= (AbstractHyperlinkDetector)fElement.createExecutableExtension(CLASS_ATTRIBUTE);
114
					result[0]= (IHyperlinkDetector)fElement.createExecutableExtension(CLASS_ATTRIBUTE);
103
			}
115
			}
104
			/*
116
			/*
105
			 * @see org.eclipse.jface.util.SafeRunnable#handleException(java.lang.Throwable)
117
			 * @see org.eclipse.jface.util.SafeRunnable#handleException(java.lang.Throwable)
(-)src/org/eclipse/ui/texteditor/HyperlinkDetectorRegistry.java (-9 / +9 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2007, 2008 IBM Corporation and others.
2
 * Copyright (c) 2007, 2013 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 45-51 Link Here
45
	private class HyperlinkDetectorDelegate implements IHyperlinkDetector, IHyperlinkDetectorExtension, IHyperlinkDetectorExtension2 {
45
	private class HyperlinkDetectorDelegate implements IHyperlinkDetector, IHyperlinkDetectorExtension, IHyperlinkDetectorExtension2 {
46
46
47
		private HyperlinkDetectorDescriptor fHyperlinkDescriptor;
47
		private HyperlinkDetectorDescriptor fHyperlinkDescriptor;
48
		private AbstractHyperlinkDetector fHyperlinkDetector;
48
		private IHyperlinkDetector fHyperlinkDetector;
49
		private boolean fFailedDuringCreation= false;
49
		private boolean fFailedDuringCreation= false;
50
		private IAdaptable fContext;
50
		private IAdaptable fContext;
51
		private int fStateMask;
51
		private int fStateMask;
Lines 69-80 Link Here
69
69
70
			if (!fFailedDuringCreation && fHyperlinkDetector == null) {
70
			if (!fFailedDuringCreation && fHyperlinkDetector == null) {
71
				try {
71
				try {
72
					fHyperlinkDetector= fHyperlinkDescriptor.createHyperlinkDetector();
72
					fHyperlinkDetector= fHyperlinkDescriptor.createHyperlinkDetectorImplementation();
73
				} catch (CoreException ex) {
73
				} catch (CoreException ex) {
74
					fFailedDuringCreation= true;
74
					fFailedDuringCreation= true;
75
				}
75
				}
76
				if (fHyperlinkDetector != null && fContext != null)
76
				if (fContext != null && fHyperlinkDetector instanceof AbstractHyperlinkDetector)
77
					fHyperlinkDetector.setContext(fContext);
77
					((AbstractHyperlinkDetector)fHyperlinkDetector).setContext(fContext);
78
			}
78
			}
79
			if (fHyperlinkDetector != null)
79
			if (fHyperlinkDetector != null)
80
				return fHyperlinkDetector.detectHyperlinks(textViewer, region, canShowMultipleHyperlinks);
80
				return fHyperlinkDetector.detectHyperlinks(textViewer, region, canShowMultipleHyperlinks);
Lines 94-103 Link Here
94
		 * @see org.eclipse.jface.text.hyperlink.IHyperlinkDetectorExtension#dispose()
94
		 * @see org.eclipse.jface.text.hyperlink.IHyperlinkDetectorExtension#dispose()
95
		 */
95
		 */
96
		public void dispose() {
96
		public void dispose() {
97
			if (fHyperlinkDetector != null) {
97
			if (fHyperlinkDetector instanceof AbstractHyperlinkDetector)
98
				fHyperlinkDetector.dispose();
98
				((AbstractHyperlinkDetector)fHyperlinkDetector).dispose();
99
				fHyperlinkDetector= null;
99
100
			}
100
			fHyperlinkDetector= null;
101
			fHyperlinkDescriptor= null;
101
			fHyperlinkDescriptor= null;
102
			fContext= null;
102
			fContext= null;
103
		}
103
		}

Return to bug 406994