|
Lines 1-5
Link Here
|
| 1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
| 2 |
* Copyright (c) 2008 IBM Corporation and others. |
2 |
* Copyright (c) 2008, 2010 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 20-25
Link Here
|
| 20 |
import org.eclipse.jface.text.IRegion; |
20 |
import org.eclipse.jface.text.IRegion; |
| 21 |
import org.eclipse.jface.text.hyperlink.IHyperlink; |
21 |
import org.eclipse.jface.text.hyperlink.IHyperlink; |
| 22 |
import org.eclipse.osgi.util.NLS; |
22 |
import org.eclipse.osgi.util.NLS; |
|
|
23 |
import org.eclipse.ui.IEditorDescriptor; |
| 24 |
import org.eclipse.ui.PartInitException; |
| 25 |
import org.eclipse.ui.ide.IDE; |
| 23 |
import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry; |
26 |
import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry; |
| 24 |
import org.eclipse.wst.xml.ui.internal.XMLUIMessages; |
27 |
import org.eclipse.wst.xml.ui.internal.XMLUIMessages; |
| 25 |
|
28 |
|
|
Lines 59-65
Link Here
|
| 59 |
if (fEntry.getURI().startsWith("jar:file:")) |
62 |
if (fEntry.getURI().startsWith("jar:file:")) |
| 60 |
return new URLStorageHyperlink(fHyperlinkRegion, new URL(fEntry.getURI())) { |
63 |
return new URLStorageHyperlink(fHyperlinkRegion, new URL(fEntry.getURI())) { |
| 61 |
public String getHyperlinkText() { |
64 |
public String getHyperlinkText() { |
| 62 |
return NLS.bind(XMLUIMessages.Open, fEntry.getKey()); |
65 |
IEditorDescriptor editorID= null; |
|
|
66 |
try { |
| 67 |
editorID = IDE.getEditorDescriptor(fEntry.getKey()); |
| 68 |
} catch (PartInitException e) { |
| 69 |
e.printStackTrace(); |
| 70 |
} |
| 71 |
if (editorID != null) |
| 72 |
return NLS.bind(XMLUIMessages.Open_With, fEntry.getKey(), editorID.getLabel()); |
| 73 |
else |
| 74 |
return NLS.bind(XMLUIMessages.Open, fEntry.getKey()); |
| 63 |
} |
75 |
} |
| 64 |
}; |
76 |
}; |
| 65 |
} |
77 |
} |
|
Lines 113-116
Link Here
|
| 113 |
if (link != null) |
125 |
if (link != null) |
| 114 |
link.open(); |
126 |
link.open(); |
| 115 |
} |
127 |
} |
|
|
128 |
|
| 129 |
|
| 116 |
} |
130 |
} |