View | Details | Raw Unified | Return to bug 215473 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/jface/text/TextViewer.java (-16 / +23 lines)
Lines 21-27 Link Here
21
import java.util.regex.PatternSyntaxException;
21
import java.util.regex.PatternSyntaxException;
22
22
23
import org.eclipse.core.runtime.Assert;
23
import org.eclipse.core.runtime.Assert;
24
24
import org.eclipse.jface.internal.text.NonDeletingPositionUpdater;
25
import org.eclipse.jface.text.hyperlink.HyperlinkManager;
26
import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
27
import org.eclipse.jface.text.hyperlink.IHyperlinkDetectorExtension;
28
import org.eclipse.jface.text.hyperlink.IHyperlinkPresenter;
29
import org.eclipse.jface.text.hyperlink.HyperlinkManager.DETECTION_STRATEGY;
30
import org.eclipse.jface.text.projection.ChildDocument;
31
import org.eclipse.jface.text.projection.ChildDocumentManager;
32
import org.eclipse.jface.viewers.IPostSelectionProvider;
33
import org.eclipse.jface.viewers.ISelection;
34
import org.eclipse.jface.viewers.ISelectionChangedListener;
35
import org.eclipse.jface.viewers.ISelectionProvider;
36
import org.eclipse.jface.viewers.SelectionChangedEvent;
37
import org.eclipse.jface.viewers.Viewer;
25
import org.eclipse.swt.SWT;
38
import org.eclipse.swt.SWT;
26
import org.eclipse.swt.custom.LineBackgroundEvent;
39
import org.eclipse.swt.custom.LineBackgroundEvent;
27
import org.eclipse.swt.custom.LineBackgroundListener;
40
import org.eclipse.swt.custom.LineBackgroundListener;
Lines 61-80 Link Here
61
import org.eclipse.swt.widgets.Listener;
74
import org.eclipse.swt.widgets.Listener;
62
import org.eclipse.swt.widgets.ScrollBar;
75
import org.eclipse.swt.widgets.ScrollBar;
63
76
64
import org.eclipse.jface.internal.text.NonDeletingPositionUpdater;
65
import org.eclipse.jface.text.hyperlink.HyperlinkManager;
66
import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
67
import org.eclipse.jface.text.hyperlink.IHyperlinkDetectorExtension;
68
import org.eclipse.jface.text.hyperlink.IHyperlinkPresenter;
69
import org.eclipse.jface.text.projection.ChildDocument;
70
import org.eclipse.jface.text.projection.ChildDocumentManager;
71
import org.eclipse.jface.viewers.IPostSelectionProvider;
72
import org.eclipse.jface.viewers.ISelection;
73
import org.eclipse.jface.viewers.ISelectionChangedListener;
74
import org.eclipse.jface.viewers.ISelectionProvider;
75
import org.eclipse.jface.viewers.SelectionChangedEvent;
76
import org.eclipse.jface.viewers.Viewer;
77
78
77
79
/**
78
/**
80
 * SWT based implementation of {@link ITextViewer} and its extension interfaces.
79
 * SWT based implementation of {@link ITextViewer} and its extension interfaces.
Lines 5366-5372 Link Here
5366
	 */
5365
	 */
5367
	private void ensureHyperlinkManagerInstalled() {
5366
	private void ensureHyperlinkManagerInstalled() {
5368
		if (fHyperlinkDetectors != null && fHyperlinkDetectors.length > 0 && fHyperlinkPresenter != null && fHyperlinkManager == null) {
5367
		if (fHyperlinkDetectors != null && fHyperlinkDetectors.length > 0 && fHyperlinkPresenter != null && fHyperlinkManager == null) {
5369
			fHyperlinkManager= new HyperlinkManager(HyperlinkManager.FIRST);
5368
			
5369
			DETECTION_STRATEGY strategy;
5370
			if (fHyperlinkPresenter.canShowMultipleHyperlinks()) {
5371
				strategy= HyperlinkManager.ALL;
5372
			} else {
5373
				strategy= HyperlinkManager.FIRST;
5374
			}
5375
			fHyperlinkManager= new HyperlinkManager(strategy);
5376
			
5370
			fHyperlinkManager.install(this, fHyperlinkPresenter, fHyperlinkDetectors, fHyperlinkStateMask);
5377
			fHyperlinkManager.install(this, fHyperlinkPresenter, fHyperlinkDetectors, fHyperlinkStateMask);
5371
		}
5378
		}
5372
	}
5379
	}
(-)src/org/eclipse/jface/text/hyperlink/URLHyperlink.java (-2 / +6 lines)
Lines 10-21 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.jface.text.hyperlink;
11
package org.eclipse.jface.text.hyperlink;
12
12
13
import org.eclipse.core.runtime.Assert;
14
import org.eclipse.jface.text.IRegion;
13
import org.eclipse.swt.SWT;
15
import org.eclipse.swt.SWT;
14
import org.eclipse.swt.program.Program;
16
import org.eclipse.swt.program.Program;
15
17
16
import org.eclipse.core.runtime.Assert;
18
import com.ibm.icu.text.MessageFormat;
17
19
18
import org.eclipse.jface.text.IRegion;
19
20
20
21
21
/**
22
/**
Lines 81-86 Link Here
81
	 * @see org.eclipse.jdt.internal.ui.javaeditor.IHyperlink#getHyperlinkText()
82
	 * @see org.eclipse.jdt.internal.ui.javaeditor.IHyperlink#getHyperlinkText()
82
	 */
83
	 */
83
	public String getHyperlinkText() {
84
	public String getHyperlinkText() {
85
		if (fURLString != null)
86
			return MessageFormat.format(HyperlinkMessages.getString("URLHyperlink.hyperlinkText"), new Object[] { fURLString }); //$NON-NLS-1$
87
		
84
		return null;
88
		return null;
85
	}
89
	}
86
	
90
	
(-)src/org/eclipse/jface/text/hyperlink/LinkListInformationControl.java (+351 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2008 IBM 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
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
12
package org.eclipse.jface.text.hyperlink;
13
14
import org.eclipse.core.runtime.Assert;
15
import org.eclipse.jface.dialogs.Dialog;
16
import org.eclipse.jface.dialogs.PopupDialog;
17
import org.eclipse.jface.resource.JFaceResources;
18
import org.eclipse.jface.text.IInformationControl;
19
import org.eclipse.jface.text.IInformationControlExtension;
20
import org.eclipse.jface.text.IInformationControlExtension2;
21
import org.eclipse.jface.text.IInformationControlExtension3;
22
import org.eclipse.jface.text.IInformationControlExtension5;
23
import org.eclipse.swt.SWT;
24
import org.eclipse.swt.events.DisposeEvent;
25
import org.eclipse.swt.events.DisposeListener;
26
import org.eclipse.swt.events.FocusListener;
27
import org.eclipse.swt.events.SelectionAdapter;
28
import org.eclipse.swt.events.SelectionEvent;
29
import org.eclipse.swt.graphics.Color;
30
import org.eclipse.swt.graphics.Font;
31
import org.eclipse.swt.graphics.FontMetrics;
32
import org.eclipse.swt.graphics.GC;
33
import org.eclipse.swt.graphics.Point;
34
import org.eclipse.swt.graphics.Rectangle;
35
import org.eclipse.swt.layout.GridData;
36
import org.eclipse.swt.layout.GridLayout;
37
import org.eclipse.swt.widgets.Composite;
38
import org.eclipse.swt.widgets.Control;
39
import org.eclipse.swt.widgets.Layout;
40
import org.eclipse.swt.widgets.Link;
41
import org.eclipse.swt.widgets.Shell;
42
43
import com.ibm.icu.text.MessageFormat;
44
45
46
/**
47
 * An information control capable of showing a list of links. The links can be opened.
48
 *
49
 * @since 3.4
50
 */
51
public class LinkListInformationControl implements IInformationControl, IInformationControlExtension, IInformationControlExtension2, IInformationControlExtension3, IInformationControlExtension5, DisposeListener {
52
	
53
	private PopupDialog fPopupDialog;
54
	
55
	private Composite fLinkComposite;
56
	
57
	/**
58
	 * Creates a link list information control with the given shell as parent.
59
	 *
60
	 * @param parentShell the parent shell
61
	 * @param shellStyle the additional styles for the shell
62
	 * @param statusFieldText the text to be used in the optional status field
63
	 *                         or <code>null</code> if the status field should be hidden
64
	 */
65
	public LinkListInformationControl(Shell parentShell, int shellStyle, String statusFieldText) {
66
		shellStyle= shellStyle | SWT.NO_FOCUS | SWT.ON_TOP;
67
		fPopupDialog= new PopupDialog(parentShell, shellStyle, false, false, false, false, null, statusFieldText) {
68
			
69
			protected Control createDialogArea(Composite parent) {
70
				fLinkComposite= new Composite(parent, SWT.NONE);
71
				fLinkComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
72
				fLinkComposite.setLayout(new GridLayout(1, false));
73
				
74
				return fLinkComposite;
75
			}
76
		};
77
		
78
		// Force create early so that listeners can be added at all times with API.
79
		fPopupDialog.create();
80
	}
81
	
82
	/*
83
	 * @see IInformationControl#setInformation(String)
84
	 */
85
	public void setInformation(String content) {
86
		Assert.isTrue(false, "Must implement IInformationProviderExtension and provide array of linkes as input"); //$NON-NLS-1$
87
	}
88
	
89
	/*
90
	 * @see IInformationControl#setVisible(boolean)
91
	 */
92
	public void setVisible(boolean visible) {
93
		if (visible) {
94
			
95
			Point currentSize= fPopupDialog.getShell().getSize();
96
			fPopupDialog.getShell().pack(true);
97
			Point newSize= fPopupDialog.getShell().getSize();
98
			if (newSize.x > currentSize.x || newSize.y > currentSize.y)
99
				setSize(currentSize.x, currentSize.y); // restore previous size
100
				
101
			fPopupDialog.open();
102
		} else
103
			fPopupDialog.getShell().setVisible(false);
104
	}
105
	
106
	/*
107
	 * @see IInformationControl#dispose()
108
	 */
109
	public void dispose() {
110
		fPopupDialog.close();
111
		fPopupDialog= null;
112
	}
113
	
114
	/*
115
	 * @see IInformationControl#setSize(int, int)
116
	 */
117
	public void setSize(int width, int height) {
118
		fPopupDialog.getShell().setSize(width, height);
119
	}
120
	
121
	/*
122
	 * @see IInformationControl#setLocation(Point)
123
	 */
124
	public void setLocation(Point location) {
125
		fPopupDialog.getShell().setLocation(location);
126
	}
127
	
128
	/*
129
	 * @see IInformationControl#setSizeConstraints(int, int)
130
	 */
131
	public void setSizeConstraints(int maxWidth, int maxHeight) {
132
	}
133
	
134
	/*
135
	 * @see IInformationControl#computeSizeHint()
136
	 */
137
	public Point computeSizeHint() {
138
		// see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=117602
139
		int widthHint= SWT.DEFAULT;
140
		
141
142
		return fPopupDialog.getShell().computeSize(widthHint, SWT.DEFAULT, true);
143
	}
144
	
145
	/*
146
	 * @see org.eclipse.jface.text.IInformationControlExtension3#computeTrim()
147
	 * @since 3.0
148
	 */
149
	public Rectangle computeTrim() {
150
		Shell shell= fPopupDialog.getShell();
151
		Rectangle trim= shell.computeTrim(0, 0, 0, 0);
152
		
153
		// PopupDialog adds a 1 pixel border when SWT.NO_TRIM is set:
154
		Layout layout= shell.getLayout();
155
		if (layout instanceof GridLayout) {
156
			GridLayout gridLayout= (GridLayout) layout;
157
			int left= gridLayout.marginLeft + gridLayout.marginWidth;
158
			int top= gridLayout.marginTop + gridLayout.marginHeight;
159
			trim.x-= left;
160
			trim.y-= top;
161
			trim.width+= left + gridLayout.marginRight + 2 * gridLayout.marginWidth;
162
			trim.height+= top + gridLayout.marginBottom + 2 * gridLayout.marginHeight;
163
		}
164
		return trim;
165
	}
166
	
167
	/*
168
	 * @see org.eclipse.jface.text.IInformationControlExtension3#getBounds()
169
	 * @since 3.0
170
	 */
171
	public Rectangle getBounds() {
172
		return fPopupDialog.getShell().getBounds();
173
	}
174
	
175
	/*
176
	 * @see org.eclipse.jface.text.IInformationControlExtension3#restoresLocation()
177
	 * @since 3.0
178
	 */
179
	public boolean restoresLocation() {
180
		return false;
181
	}
182
	
183
	/*
184
	 * @see org.eclipse.jface.text.IInformationControlExtension3#restoresSize()
185
	 * @since 3.0
186
	 */
187
	public boolean restoresSize() {
188
		return false;
189
	}
190
	
191
	/*
192
	 * @see IInformationControl#addDisposeListener(DisposeListener)
193
	 */
194
	public void addDisposeListener(DisposeListener listener) {
195
		fPopupDialog.getShell().addDisposeListener(listener);
196
	}
197
	
198
	/*
199
	 * @see IInformationControl#removeDisposeListener(DisposeListener)
200
	 */
201
	public void removeDisposeListener(DisposeListener listener) {
202
		fPopupDialog.getShell().removeDisposeListener(listener);
203
	}
204
	
205
	/*
206
	 * @see IInformationControl#setForegroundColor(Color)
207
	 */
208
	public void setForegroundColor(Color foreground) {
209
		fLinkComposite.setForeground(foreground);
210
	}
211
	
212
	/*
213
	 * @see IInformationControl#setBackgroundColor(Color)
214
	 */
215
	public void setBackgroundColor(Color background) {
216
		fLinkComposite.setBackground(background);
217
	}
218
	
219
	/*
220
	 * @see IInformationControl#isFocusControl()
221
	 */
222
	public boolean isFocusControl() {
223
		Shell shell= fPopupDialog.getShell();
224
		return shell.getDisplay().getActiveShell() == shell;
225
	}
226
	
227
	/*
228
	 * @see IInformationControl#setFocus()
229
	 */
230
	public void setFocus() {
231
		fPopupDialog.getShell().forceFocus();
232
		fLinkComposite.setFocus();
233
	}
234
	
235
	/*
236
	 * @see IInformationControl#addFocusListener(FocusListener)
237
	 */
238
	public void addFocusListener(FocusListener listener) {
239
		fLinkComposite.addFocusListener(listener);
240
	}
241
	
242
	/*
243
	 * @see IInformationControl#removeFocusListener(FocusListener)
244
	 */
245
	public void removeFocusListener(FocusListener listener) {
246
		fLinkComposite.removeFocusListener(listener);
247
	}
248
	
249
	/*
250
	 * @see IInformationControlExtension#hasContents()
251
	 */
252
	public boolean hasContents() {
253
		return fLinkComposite.getChildren().length > 0;
254
	}
255
	
256
	/**
257
	 * @see org.eclipse.swt.events.DisposeListener#widgetDisposed(org.eclipse.swt.events.DisposeEvent)
258
	 * @deprecated As of 3.2, no longer used and called
259
	 */
260
	public void widgetDisposed(DisposeEvent event) {
261
	}
262
	
263
	/*
264
	 * @see org.eclipse.jface.text.IInformationControlExtension5#containsControl(org.eclipse.swt.widgets.Control)
265
	 * @since 3.4
266
	 */
267
	public boolean containsControl(Control control) {
268
		do {
269
			Shell popupShell= fPopupDialog.getShell();
270
			if (control == popupShell)
271
				return true;
272
			if (control instanceof Shell)
273
				return false;
274
			control= control.getParent();
275
		} while (control != null);
276
		return false;
277
	}
278
	
279
	/*
280
	 * @see org.eclipse.jface.text.IInformationControlExtension5#isVisible()
281
	 * @since 3.4
282
	 */
283
	public boolean isVisible() {
284
		Shell popupShell= fPopupDialog.getShell();
285
		return popupShell != null && !popupShell.isDisposed() && popupShell.isVisible();
286
	}
287
	
288
	/*
289
	 * @see org.eclipse.jface.text.IInformationControlExtension5#allowMoveIntoControl()
290
	 * @since 3.4
291
	 */
292
	public boolean allowMoveIntoControl() {
293
		return true;
294
	}
295
	
296
	/* (non-Javadoc)
297
	 * @see org.eclipse.jface.text.IInformationControlExtension2#setInput(java.lang.Object)
298
	 */
299
	public void setInput(Object input) {
300
		if (!(input instanceof IHyperlink[]))
301
			Assert.isTrue(false, "Must provide an array of IHyperlink as input"); //$NON-NLS-1$
302
		
303
		IHyperlink[] links= (IHyperlink[]) input;
304
		for (int i= 0; i < links.length; i++) {
305
			final IHyperlink link= links[i];
306
			
307
			Link linkControl= new Link(fLinkComposite, SWT.NONE);
308
			linkControl.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
309
			
310
			String text= link.getHyperlinkText();
311
			if (text == null)
312
				text= HyperlinkMessages.getString("LinkListInformationControl.unknownLink"); //$NON-NLS-1$
313
			
314
			if (i == 0) {
315
				text= MessageFormat.format(HyperlinkMessages.getString("LinkListInformationControl.defaultLinkPattern"), new Object[] { text }); //$NON-NLS-1$
316
			}
317
			
318
			linkControl.setText("<a>" + text + "</a>"); //$NON-NLS-1$ //$NON-NLS-2$
319
			linkControl.setBackground(fLinkComposite.getBackground());
320
			linkControl.setForeground(fLinkComposite.getForeground());
321
			
322
			linkControl.addSelectionListener(new SelectionAdapter() {
323
				/* (non-Javadoc)
324
				 * @see org.eclipse.swt.events.SelectionAdapter#widgetSelected(org.eclipse.swt.events.SelectionEvent)
325
				 */
326
				public void widgetSelected(SelectionEvent e) {
327
					LinkListInformationControl.this.dispose();
328
					link.open();
329
				}
330
			});
331
			
332
		}
333
	}
334
335
	/* (non-Javadoc)
336
	 * @see org.eclipse.jface.text.IInformationControlExtension5#computeSizeConstraints(int, int)
337
	 */
338
	public Point computeSizeConstraints(int widthInChars, int heightInChars) {
339
		Font font= JFaceResources.getDialogFont();
340
		
341
		GC gc= new GC(font.getDevice());
342
		gc.setFont(font);
343
		FontMetrics metrics= gc.getFontMetrics();
344
		gc.dispose();
345
		
346
		int width= Dialog.convertWidthInCharsToPixels(metrics, widthInChars);
347
		int height= Dialog.convertHeightInCharsToPixels(metrics, heightInChars);
348
		
349
		return new Point(width, height);
350
	}
351
}
(-)src/org/eclipse/jface/text/hyperlink/MultipleHyperlinkPresenter.java (+189 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2007, 2008 IBM 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
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.jface.text.hyperlink;
12
13
import org.eclipse.jface.preference.IPreferenceStore;
14
import org.eclipse.jface.text.IInformationControl;
15
import org.eclipse.jface.text.IInformationControlCreator;
16
import org.eclipse.jface.text.IRegion;
17
import org.eclipse.jface.text.ITextViewer;
18
import org.eclipse.jface.text.Region;
19
import org.eclipse.jface.text.information.IInformationProvider;
20
import org.eclipse.jface.text.information.IInformationProviderExtension;
21
import org.eclipse.jface.text.information.IInformationProviderExtension2;
22
import org.eclipse.jface.text.information.InformationPresenter;
23
import org.eclipse.swt.SWT;
24
import org.eclipse.swt.graphics.RGB;
25
import org.eclipse.swt.widgets.Shell;
26
27
/**
28
 * A hyperlink presenter capable of showing multiple hyperlinks in a information pop up
29
 * 
30
 * @since 3.4
31
 */
32
public class MultipleHyperlinkPresenter extends DefaultHyperlinkPresenter {
33
	
34
	private class MultipleHyperlinkInformationProvider implements IInformationProvider, IInformationProviderExtension, IInformationProviderExtension2 {
35
36
		/**
37
		 * @see org.eclipse.jface.text.information.IInformationProvider#getInformation(org.eclipse.jface.text.ITextViewer, org.eclipse.jface.text.IRegion)
38
		 * @deprecated
39
		 */
40
		public String getInformation(ITextViewer textViewer, IRegion subject) {
41
			return null;
42
		}
43
		
44
		/* (non-Javadoc)
45
		 * @see org.eclipse.jface.text.information.IInformationProvider#getSubject(org.eclipse.jface.text.ITextViewer, int)
46
		 */
47
		public IRegion getSubject(ITextViewer textViewer, int offset) {
48
			return fSubjectRegion;
49
		}
50
		
51
		/* (non-Javadoc)
52
		 * @see org.eclipse.jface.text.information.IInformationProviderExtension#getInformation2(org.eclipse.jface.text.ITextViewer, org.eclipse.jface.text.IRegion)
53
		 */
54
		public Object getInformation2(ITextViewer textViewer, IRegion subject) {
55
			return fHyperlinks;
56
		}
57
		
58
		/* (non-Javadoc)
59
		 * @see org.eclipse.jface.text.information.IInformationProviderExtension2#getInformationPresenterControlCreator()
60
		 */
61
		public IInformationControlCreator getInformationPresenterControlCreator() {
62
			return new IInformationControlCreator() {
63
				public IInformationControl createInformationControl(Shell parent) {
64
					return new LinkListInformationControl(parent, (SWT.RESIZE | SWT.TOOL), HyperlinkMessages.getString("MultipleHyperlinkPresenter.clickLinkAfordance")); //$NON-NLS-1$
65
				}
66
			};
67
		}
68
	}
69
	
70
	private final ITextViewer fTextViewer;
71
	private final InformationPresenter fPresenter;
72
	
73
	private IHyperlink[] fHyperlinks;
74
	private Region fSubjectRegion;
75
	
76
	/**
77
	 * Creates a new multiple hyperlink presenter which uses
78
	 * {@link #HYPERLINK_COLOR} to read the color from the given preference store.
79
	 *
80
	 * @param store the preference store
81
	 * @param viewer the viewer in which to present the hyperlinks
82
	 */
83
	public MultipleHyperlinkPresenter(IPreferenceStore store, ITextViewer viewer) {
84
		super(store);
85
		
86
		fTextViewer= viewer;
87
		fPresenter= createInformationPresenter();
88
		fPresenter.install(fTextViewer);
89
	}
90
91
	/**
92
	 * Creates a new multiple hyperlink presenter.
93
	 *
94
	 * @param color the hyperlink color, to be disposed by the caller
95
	 * @param viewer the viewer in which to present the hyperlinks
96
	 */
97
	public MultipleHyperlinkPresenter(RGB color, ITextViewer viewer) {
98
		super(color);
99
		
100
		fTextViewer= viewer;
101
		fPresenter= createInformationPresenter();
102
		fPresenter.install(fTextViewer);
103
	}
104
105
	/* (non-Javadoc)
106
	 * @see org.eclipse.jface.text.hyperlink.DefaultHyperlinkPresenter#canShowMultipleHyperlinks()
107
	 */
108
	public boolean canShowMultipleHyperlinks() {
109
		return true;
110
	}
111
	
112
	/* (non-Javadoc)
113
	 * @see org.eclipse.jface.text.hyperlink.DefaultHyperlinkPresenter#hideHyperlinks()
114
	 */
115
	public void hideHyperlinks() {
116
		super.hideHyperlinks();
117
		
118
		fHyperlinks= null;
119
	}
120
	
121
	/* (non-Javadoc)
122
	 * @see org.eclipse.jface.text.hyperlink.DefaultHyperlinkPresenter#showHyperlinks(org.eclipse.jface.text.hyperlink.IHyperlink[])
123
	 */
124
	public void showHyperlinks(final IHyperlink[] hyperlinks) {
125
		super.showHyperlinks(new IHyperlink[] { hyperlinks[0] });
126
				
127
		if (equals(fHyperlinks, hyperlinks))
128
			return;
129
		
130
		fHyperlinks= hyperlinks;
131
		fPresenter.disposeInformationControl();
132
		
133
		if (hyperlinks.length == 1)
134
			return;
135
		
136
		int start= hyperlinks[0].getHyperlinkRegion().getOffset();
137
		int end= start + hyperlinks[0].getHyperlinkRegion().getLength();
138
		
139
		for (int i= 1; i < hyperlinks.length; i++) {
140
			int hstart= hyperlinks[i].getHyperlinkRegion().getOffset();
141
			int hend= hstart + hyperlinks[i].getHyperlinkRegion().getLength();
142
			
143
			start= Math.min(start, hstart);
144
			end= Math.max(end, hend);
145
		}
146
		
147
		fSubjectRegion= new Region(start, end - start);
148
		
149
		fPresenter.showInformation();
150
	}
151
152
	private boolean equals(IHyperlink[] oldLinks, IHyperlink[] newLinks) {
153
		if (oldLinks == null)
154
			return false;
155
		
156
		if (oldLinks.length != newLinks.length)
157
			return false;
158
		
159
		for (int i= 0; i < newLinks.length; i++) {
160
			if (!oldLinks[i].getHyperlinkRegion().equals(newLinks[i].getHyperlinkRegion()))
161
				return false;
162
		}
163
		
164
		return true;
165
	}
166
	
167
	private InformationPresenter createInformationPresenter() {
168
		final MultipleHyperlinkInformationProvider informationProvider= new MultipleHyperlinkInformationProvider();
169
		
170
		InformationPresenter result= new InformationPresenter(informationProvider.getInformationPresenterControlCreator()) {
171
			/* (non-Javadoc)
172
			 * @see org.eclipse.jface.text.information.InformationPresenter#getInformationProvider(java.lang.String)
173
			 */
174
			public IInformationProvider getInformationProvider(String contentType) {
175
				return informationProvider;
176
			}
177
			
178
			/* (non-Javadoc)
179
			 * @see org.eclipse.jface.text.AbstractInformationControlManager#showInformation()
180
			 */
181
			public void showInformation() {
182
				doShowInformation();
183
			}
184
		};
185
		
186
		result.takesFocusWhenVisible(false);
187
		return result;
188
	}
189
}
(-)src/org/eclipse/jface/text/hyperlink/HyperlinkMessages.java (+34 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2007 IBM 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
 *     IBM Corporation - initial API and implementation
10
 *******************************************************************************/
11
package org.eclipse.jface.text.hyperlink;
12
13
import java.util.MissingResourceException;
14
import java.util.ResourceBundle;
15
16
/**
17
 * @since 3.4
18
 */
19
public class HyperlinkMessages {
20
	private static final String BUNDLE_NAME= "org.eclipse.jface.text.hyperlink.HyperlinkMessages"; //$NON-NLS-1$
21
	
22
	private static final ResourceBundle RESOURCE_BUNDLE= ResourceBundle.getBundle(BUNDLE_NAME);
23
	
24
	private HyperlinkMessages() {
25
	}
26
	
27
	public static String getString(String key) {
28
		try {
29
			return RESOURCE_BUNDLE.getString(key);
30
		} catch (MissingResourceException e) {
31
			return '!' + key + '!';
32
		}
33
	}
34
}
(-)src/org/eclipse/jface/text/hyperlink/HyperlinkMessages.properties (+6 lines)
Added Link Here
1
LinkListInformationControl.defaultLinkPattern={0} (default)
2
LinkListInformationControl.unknownLink=Unknown Hyperlink
3
4
MultipleHyperlinkPresenter.clickLinkAfordance=Click link to open
5
6
URLHyperlink.hyperlinkText=Open ''{0}'' in a browser
(-)src/org/eclipse/ui/editors/text/TextSourceViewerConfiguration.java (-11 / +8 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-31 Link Here
16
import java.util.StringTokenizer;
16
import java.util.StringTokenizer;
17
import java.util.Map.Entry;
17
import java.util.Map.Entry;
18
18
19
import org.eclipse.swt.SWT;
20
import org.eclipse.swt.widgets.Shell;
21
22
import org.eclipse.core.runtime.Assert;
19
import org.eclipse.core.runtime.Assert;
23
import org.eclipse.core.runtime.IAdaptable;
20
import org.eclipse.core.runtime.IAdaptable;
24
25
import org.eclipse.jface.action.Action;
21
import org.eclipse.jface.action.Action;
26
import org.eclipse.jface.internal.text.html.HTMLTextPresenter;
22
import org.eclipse.jface.internal.text.html.HTMLTextPresenter;
27
import org.eclipse.jface.preference.IPreferenceStore;
23
import org.eclipse.jface.preference.IPreferenceStore;
28
29
import org.eclipse.jface.text.DefaultInformationControl;
24
import org.eclipse.jface.text.DefaultInformationControl;
30
import org.eclipse.jface.text.DefaultTextHover;
25
import org.eclipse.jface.text.DefaultTextHover;
31
import org.eclipse.jface.text.IInformationControl;
26
import org.eclipse.jface.text.IInformationControl;
Lines 35-43 Link Here
35
import org.eclipse.jface.text.ITextViewerExtension2;
30
import org.eclipse.jface.text.ITextViewerExtension2;
36
import org.eclipse.jface.text.IUndoManager;
31
import org.eclipse.jface.text.IUndoManager;
37
import org.eclipse.jface.text.TextViewerUndoManager;
32
import org.eclipse.jface.text.TextViewerUndoManager;
38
import org.eclipse.jface.text.hyperlink.DefaultHyperlinkPresenter;
39
import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
33
import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
40
import org.eclipse.jface.text.hyperlink.IHyperlinkPresenter;
34
import org.eclipse.jface.text.hyperlink.IHyperlinkPresenter;
35
import org.eclipse.jface.text.hyperlink.MultipleHyperlinkPresenter;
41
import org.eclipse.jface.text.quickassist.IQuickAssistAssistant;
36
import org.eclipse.jface.text.quickassist.IQuickAssistAssistant;
42
import org.eclipse.jface.text.quickassist.QuickAssistAssistant;
37
import org.eclipse.jface.text.quickassist.QuickAssistAssistant;
43
import org.eclipse.jface.text.reconciler.IReconciler;
38
import org.eclipse.jface.text.reconciler.IReconciler;
Lines 48-54 Link Here
48
import org.eclipse.jface.text.source.IAnnotationHover;
43
import org.eclipse.jface.text.source.IAnnotationHover;
49
import org.eclipse.jface.text.source.ISourceViewer;
44
import org.eclipse.jface.text.source.ISourceViewer;
50
import org.eclipse.jface.text.source.SourceViewerConfiguration;
45
import org.eclipse.jface.text.source.SourceViewerConfiguration;
51
46
import org.eclipse.swt.SWT;
47
import org.eclipse.swt.graphics.RGB;
48
import org.eclipse.swt.widgets.Shell;
52
import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants;
49
import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants;
53
import org.eclipse.ui.texteditor.AnnotationPreference;
50
import org.eclipse.ui.texteditor.AnnotationPreference;
54
import org.eclipse.ui.texteditor.HyperlinkDetectorRegistry;
51
import org.eclipse.ui.texteditor.HyperlinkDetectorRegistry;
Lines 300-308 Link Here
300
	 */
297
	 */
301
	public IHyperlinkPresenter getHyperlinkPresenter(ISourceViewer sourceViewer) {
298
	public IHyperlinkPresenter getHyperlinkPresenter(ISourceViewer sourceViewer) {
302
		if (fPreferenceStore == null)
299
		if (fPreferenceStore == null)
303
			return super.getHyperlinkPresenter(sourceViewer);
300
			return new MultipleHyperlinkPresenter(new RGB(0, 0, 255), sourceViewer);
304
301
		
305
		return new DefaultHyperlinkPresenter(fPreferenceStore);
302
		return new MultipleHyperlinkPresenter(fPreferenceStore, sourceViewer);
306
	}
303
	}
307
304
308
	/**
305
	/**
(-)ui/org/eclipse/jdt/internal/ui/javaeditor/NLSKeyHyperlinkDetector.java (-2 / +2 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 49-55 Link Here
49
	 */
49
	 */
50
	public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks) {
50
	public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks) {
51
		ITextEditor textEditor= (ITextEditor)getAdapter(ITextEditor.class);
51
		ITextEditor textEditor= (ITextEditor)getAdapter(ITextEditor.class);
52
		if (region == null || textEditor == null || canShowMultipleHyperlinks)
52
		if (region == null || textEditor == null)
53
			return null;
53
			return null;
54
54
55
		IEditorSite site= textEditor.getEditorSite();
55
		IEditorSite site= textEditor.getEditorSite();
(-)ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditorMessages.properties (+4 lines)
Lines 153-160 Link Here
153
JavaEditor_occurrence_tooltip=Occurrence of ''{0}''
153
JavaEditor_occurrence_tooltip=Occurrence of ''{0}''
154
JavaEditorBreadcrumbActionGroup_go_to_editor_action_label=&Go to Editor
154
JavaEditorBreadcrumbActionGroup_go_to_editor_action_label=&Go to Editor
155
155
156
JavaElementHyperlink_hyperlinkTextDetail=Open declaration of ''{0}''
157
JavaElementHyperlink_hyperlinkTextGeneric=Open declaration
158
156
Editor_OpenPropertiesFile_error_keyNotFound= The key "{0}" is not defined in this properties file
159
Editor_OpenPropertiesFile_error_keyNotFound= The key "{0}" is not defined in this properties file
157
Editor_OpenPropertiesFile_error_fileNotFound_dialogMessage= Could not determine properties file
160
Editor_OpenPropertiesFile_error_fileNotFound_dialogMessage= Could not determine properties file
158
Editor_OpenPropertiesFile_error_openEditor_dialogMessage= Could not open the properties file editor for: {0}
161
Editor_OpenPropertiesFile_error_openEditor_dialogMessage= Could not open the properties file editor for: {0}
162
Editor_OpenPropertiesFile_hyperlinkText=Open ''{0}'' in ''{1}''
159
163
160
Editor_MoveLines_IllegalMove_status= Move not possible - Uncheck "Show Source of Selected Element Only" to see the entire document
164
Editor_MoveLines_IllegalMove_status= Move not possible - Uncheck "Show Source of Selected Element Only" to see the entire document
(-)ui/org/eclipse/jdt/internal/ui/javaeditor/JavaElementHyperlink.java (-4 / +25 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 10-22 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.jdt.internal.ui.javaeditor;
11
package org.eclipse.jdt.internal.ui.javaeditor;
12
12
13
import com.ibm.icu.text.MessageFormat;
14
13
import org.eclipse.core.runtime.Assert;
15
import org.eclipse.core.runtime.Assert;
14
16
15
import org.eclipse.jface.action.IAction;
17
import org.eclipse.jface.action.IAction;
18
import org.eclipse.jface.viewers.StructuredSelection;
16
19
17
import org.eclipse.jface.text.IRegion;
20
import org.eclipse.jface.text.IRegion;
18
import org.eclipse.jface.text.hyperlink.IHyperlink;
21
import org.eclipse.jface.text.hyperlink.IHyperlink;
19
22
23
import org.eclipse.jdt.core.IJavaElement;
24
25
import org.eclipse.jdt.ui.JavaElementLabels;
26
import org.eclipse.jdt.ui.actions.SelectionDispatchAction;
27
20
28
21
/**
29
/**
22
 * Java element hyperlink.
30
 * Java element hyperlink.
Lines 27-43 Link Here
27
35
28
	private final IRegion fRegion;
36
	private final IRegion fRegion;
29
	private final IAction fOpenAction;
37
	private final IAction fOpenAction;
38
	private final IJavaElement[] fElements;
30
39
31
40
32
	/**
41
	/**
33
	 * Creates a new Java element hyperlink.
42
	 * Creates a new Java element hyperlink.
43
	 * @param region the region of the link
44
	 * @param openAction the action to use to open the java elements
45
	 * @param elements the java elements to open
34
	 */
46
	 */
35
	public JavaElementHyperlink(IRegion region, IAction openAction) {
47
	public JavaElementHyperlink(IRegion region, IAction openAction, IJavaElement[] elements) {
36
		Assert.isNotNull(openAction);
48
		Assert.isNotNull(openAction);
37
		Assert.isNotNull(region);
49
		Assert.isNotNull(region);
38
50
39
		fRegion= region;
51
		fRegion= region;
40
		fOpenAction= openAction;
52
		fOpenAction= openAction;
53
		fElements= elements;
41
	}
54
	}
42
55
43
	/*
56
	/*
Lines 53-59 Link Here
53
	 * @since 3.1
66
	 * @since 3.1
54
	 */
67
	 */
55
	public void open() {
68
	public void open() {
56
		fOpenAction.run();
69
		if (fOpenAction instanceof SelectionDispatchAction) {
70
			((SelectionDispatchAction) fOpenAction).run(new StructuredSelection(fElements));
71
		} else {
72
			fOpenAction.run();
73
		}
57
	}
74
	}
58
75
59
	/*
76
	/*
Lines 69-74 Link Here
69
	 * @since 3.1
86
	 * @since 3.1
70
	 */
87
	 */
71
	public String getHyperlinkText() {
88
	public String getHyperlinkText() {
72
		return null;
89
		if (fElements.length != 1) {
90
			return JavaEditorMessages.JavaElementHyperlink_hyperlinkTextGeneric;
91
		} else {
92
			return MessageFormat.format(JavaEditorMessages.JavaElementHyperlink_hyperlinkTextDetail, new Object[] { JavaElementLabels.getElementLabel(fElements[0], JavaElementLabels.ALL_POST_QUALIFIED) });
93
		}
73
	}
94
	}
74
}
95
}
(-)ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditorMessages.java (+5 lines)
Lines 156-164 Link Here
156
	public static String JavaEditor_markOccurrences_job_name;
156
	public static String JavaEditor_markOccurrences_job_name;
157
	public static String JavaEditor_occurrence_tooltip;
157
	public static String JavaEditor_occurrence_tooltip;
158
	public static String JavaEditorBreadcrumbActionGroup_go_to_editor_action_label;
158
	public static String JavaEditorBreadcrumbActionGroup_go_to_editor_action_label;
159
	
160
	public static String JavaElementHyperlink_hyperlinkTextDetail;
161
	public static String JavaElementHyperlink_hyperlinkTextGeneric;
162
	
159
	public static String Editor_OpenPropertiesFile_error_keyNotFound;
163
	public static String Editor_OpenPropertiesFile_error_keyNotFound;
160
	public static String Editor_OpenPropertiesFile_error_fileNotFound_dialogMessage;
164
	public static String Editor_OpenPropertiesFile_error_fileNotFound_dialogMessage;
161
	public static String Editor_OpenPropertiesFile_error_openEditor_dialogMessage;
165
	public static String Editor_OpenPropertiesFile_error_openEditor_dialogMessage;
166
	public static String Editor_OpenPropertiesFile_hyperlinkText;
162
	public static String Editor_MoveLines_IllegalMove_status;
167
	public static String Editor_MoveLines_IllegalMove_status;
163
	public static String BasicEditorActionContributor_specific_content_assist_menu;
168
	public static String BasicEditorActionContributor_specific_content_assist_menu;
164
169
(-)ui/org/eclipse/jdt/internal/ui/javaeditor/JavaElementHyperlinkDetector.java (-3 / +3 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 39-45 Link Here
39
	 */
39
	 */
40
	public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks) {
40
	public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks) {
41
		ITextEditor textEditor= (ITextEditor)getAdapter(ITextEditor.class);
41
		ITextEditor textEditor= (ITextEditor)getAdapter(ITextEditor.class);
42
		if (region == null || canShowMultipleHyperlinks || !(textEditor instanceof JavaEditor))
42
		if (region == null || !(textEditor instanceof JavaEditor))
43
			return null;
43
			return null;
44
44
45
		IAction openAction= textEditor.getAction("OpenEditor"); //$NON-NLS-1$
45
		IAction openAction= textEditor.getAction("OpenEditor"); //$NON-NLS-1$
Lines 61-67 Link Here
61
			IJavaElement[] elements= null;
61
			IJavaElement[] elements= null;
62
			elements= ((ICodeAssist) input).codeSelect(wordRegion.getOffset(), wordRegion.getLength());
62
			elements= ((ICodeAssist) input).codeSelect(wordRegion.getOffset(), wordRegion.getLength());
63
			if (elements != null && elements.length > 0)
63
			if (elements != null && elements.length > 0)
64
				return new IHyperlink[] {new JavaElementHyperlink(wordRegion, openAction)};
64
				return new IHyperlink[] { new JavaElementHyperlink(wordRegion, openAction, elements) };
65
		} catch (JavaModelException e) {
65
		} catch (JavaModelException e) {
66
			return null;
66
			return null;
67
		}
67
		}
(-)ui/org/eclipse/jdt/internal/ui/javaeditor/NLSKeyHyperlink.java (-2 / +5 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 36-41 Link Here
36
36
37
import org.eclipse.jdt.internal.corext.refactoring.nls.AccessorClassReference;
37
import org.eclipse.jdt.internal.corext.refactoring.nls.AccessorClassReference;
38
import org.eclipse.jdt.internal.corext.refactoring.nls.NLSHintHelper;
38
import org.eclipse.jdt.internal.corext.refactoring.nls.NLSHintHelper;
39
import org.eclipse.jdt.internal.corext.refactoring.nls.NLSRefactoring;
39
import org.eclipse.jdt.internal.corext.refactoring.nls.PropertyFileDocumentModel;
40
import org.eclipse.jdt.internal.corext.refactoring.nls.PropertyFileDocumentModel;
40
import org.eclipse.jdt.internal.corext.util.Messages;
41
import org.eclipse.jdt.internal.corext.util.Messages;
41
42
Lines 194-199 Link Here
194
	 * @see org.eclipse.jdt.internal.ui.javaeditor.IHyperlink#getHyperlinkText()
195
	 * @see org.eclipse.jdt.internal.ui.javaeditor.IHyperlink#getHyperlinkText()
195
	 */
196
	 */
196
	public String getHyperlinkText() {
197
	public String getHyperlinkText() {
197
		return null;
198
		String bundleName= fAccessorClassReference.getResourceBundleName();
199
		String propertyFileName= bundleName.substring(bundleName.lastIndexOf('.') + 1, bundleName.length()) + NLSRefactoring.PROPERTY_FILE_EXT;
200
		return Messages.format(JavaEditorMessages.Editor_OpenPropertiesFile_hyperlinkText, new Object[] { fKeyName, propertyFileName });
198
	}
201
	}
199
}
202
}
(-)ui/org/eclipse/jdt/internal/ui/propertiesfileeditor/PropertyKeyHyperlinkDetector.java (-2 / +2 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 50-56 Link Here
50
	 */
50
	 */
51
	public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks) {
51
	public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks) {
52
		ITextEditor textEditor= (ITextEditor)getAdapter(ITextEditor.class);
52
		ITextEditor textEditor= (ITextEditor)getAdapter(ITextEditor.class);
53
		if (region == null || textEditor == null || canShowMultipleHyperlinks)
53
		if (region == null || textEditor == null)
54
			return null;
54
			return null;
55
55
56
		IEditorSite site= textEditor.getEditorSite();
56
		IEditorSite site= textEditor.getEditorSite();
(-)ui/org/eclipse/jdt/internal/ui/propertiesfileeditor/PropertiesFileEditorMessages.java (+1 lines)
Lines 51-56 Link Here
51
	public static String OpenAction_error_messageErrorResolvingSelection;
51
	public static String OpenAction_error_messageErrorResolvingSelection;
52
	public static String OpenAction_error_messageErrorSearchingKey;
52
	public static String OpenAction_error_messageErrorSearchingKey;
53
	public static String OpenAction_error_messageNoResult;
53
	public static String OpenAction_error_messageNoResult;
54
	public static String OpenAction_hyperlinkText;
54
	public static String OpenAction_SelectionDialog_title;
55
	public static String OpenAction_SelectionDialog_title;
55
	public static String OpenAction_SelectionDialog_details;
56
	public static String OpenAction_SelectionDialog_details;
56
	public static String OpenAction_SelectionDialog_message;
57
	public static String OpenAction_SelectionDialog_message;
(-)ui/org/eclipse/jdt/internal/ui/propertiesfileeditor/PropertiesFileEditorMessages.properties (+1 lines)
Lines 21-26 Link Here
21
OpenAction_error_messageErrorResolvingSelection= Error resolving current text selection
21
OpenAction_error_messageErrorResolvingSelection= Error resolving current text selection
22
OpenAction_error_messageErrorSearchingKey= Error searching references to the selected properties key
22
OpenAction_error_messageErrorSearchingKey= Error searching references to the selected properties key
23
OpenAction_error_messageNoResult= Found no references to the selected properties key
23
OpenAction_error_messageNoResult= Found no references to the selected properties key
24
OpenAction_hyperlinkText=Search for usages of ''{0}''
24
25
25
OpenAction_SelectionDialog_title= Open
26
OpenAction_SelectionDialog_title= Open
26
OpenAction_SelectionDialog_details= &Details
27
OpenAction_SelectionDialog_details= &Details
(-)ui/org/eclipse/jdt/internal/ui/propertiesfileeditor/PropertyKeyHyperlink.java (-2 / +2 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 504-509 Link Here
504
	 * @see org.eclipse.jdt.internal.ui.javaeditor.IHyperlink#getHyperlinkText()
504
	 * @see org.eclipse.jdt.internal.ui.javaeditor.IHyperlink#getHyperlinkText()
505
	 */
505
	 */
506
	public String getHyperlinkText() {
506
	public String getHyperlinkText() {
507
		return null;
507
		return Messages.format(PropertiesFileEditorMessages.OpenAction_hyperlinkText, fPropertiesKey);
508
	}
508
	}
509
}
509
}

Return to bug 215473