[272106] [NLS] Most hyperlinks show as 'Unknown Hyperlink'
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/JSPUIPluginResources.properties b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/JSPUIPluginResources.properties
index 7940fcf..60a9bc9 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/JSPUIPluginResources.properties
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/JSPUIPluginResources.properties
@@ -154,7 +154,7 @@
VALIDATION_TRANSLATION_USBEAN_MISSING_TYPE_INFO=Missing type information for jsp:useBean:
VALIDATION_TRANSLATION_USEBEAN_AMBIGUOUS_TYPE_INFO=Ambiguous type information for jsp:useBean:
-Open=Open '{0}'
+Open=Open ''{0}''
TLDHyperlink_hyperlinkText=Open Descriptor
CustomTagHyperlink_hyperlinkText=Open Declaration
TLDContentOutlineConfiguration_0=Show Content Values
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/ExternalFileHyperlink.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/ExternalFileHyperlink.java
index d8bbad5..8784305 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/ExternalFileHyperlink.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/ExternalFileHyperlink.java
@@ -40,7 +40,11 @@
}
public String getHyperlinkText() {
- return NLS.bind(JSPUIMessages.Open, fHyperlinkFile.getName());
+ String path = fHyperlinkFile.getPath();
+ if (path.length() > 60) {
+ path = path.substring(0, 25) + "..." + path.substring(path.length() - 25, path.length());
+ }
+ return NLS.bind(JSPUIMessages.Open, path);
}
public void open() {
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/URLFileHyperlink.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/URLFileHyperlink.java
index 859c72a..df8d5a9 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/URLFileHyperlink.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/URLFileHyperlink.java
@@ -24,6 +24,7 @@
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.ide.IDE;
+import org.eclipse.wst.sse.core.internal.util.JarUtilities;
/**
* Hyperlink for URLs (opens in read-only mode)
@@ -94,7 +95,7 @@
public InputStream getContents() throws CoreException {
InputStream stream = null;
try {
- stream = fURL.openStream();
+ stream = JarUtilities.getInputStream(fURL);
}
catch (Exception e) {
throw new CoreException(new Status(IStatus.ERROR, JSPUIPlugin.getDefault().getBundle().getSymbolicName(), IStatus.ERROR, fURL.toString(), e));
@@ -147,7 +148,10 @@
* @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
*/
public String getHyperlinkText() {
- return NLS.bind(JSPUIMessages.Open, fURL.toString());
+ String path = fURL.getPath();
+ if (path.length() > 0)
+ return NLS.bind(JSPUIMessages.Open, new Path(path).lastSegment());
+ return NLS.bind(JSPUIMessages.TLDHyperlink_hyperlinkText, fURL.toString());
}
/*
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/WorkspaceFileHyperlink.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/WorkspaceFileHyperlink.java
index dd82e89..20b2579 100644
--- a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/WorkspaceFileHyperlink.java
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/hyperlink/WorkspaceFileHyperlink.java
@@ -57,7 +57,11 @@
* @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
*/
public String getHyperlinkText() {
- return NLS.bind(JSPUIMessages.Open, fFile.getName());
+ String path = fFile.getFullPath().toString();
+ if (path.length() > 60) {
+ path = path.substring(0, 25) + "..." + path.substring(path.length() - 25, path.length());
+ }
+ return NLS.bind(JSPUIMessages.Open, path);
}
public void open() {
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIMessages.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIMessages.java
index 9569cd3..9aab77e 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIMessages.java
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIMessages.java
@@ -200,4 +200,5 @@
// Hyperlinks
public static String Hyperlink_line;
+ public static String Open;
}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIPluginResources.properties b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIPluginResources.properties
index f21f3ae..49af0f0 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIPluginResources.properties
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/HTMLUIPluginResources.properties
@@ -172,4 +172,5 @@
Validation_Project=The validation settings have changed. A validation of the project is required for changes to take effect. Validate the project now?
Validation_jobName=Validating...
-Hyperlink_line={0}={1} : line {2}
\ No newline at end of file
+Hyperlink_line={0}={1} : line {2}
+Open=Open ''{0}''
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/AnchorHyperlinkDetector.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/AnchorHyperlinkDetector.java
index 84e91e9..4d8ab98 100644
--- a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/AnchorHyperlinkDetector.java
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/hyperlink/AnchorHyperlinkDetector.java
@@ -196,7 +196,7 @@
* @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
*/
public String getHyperlinkText() {
- return null;
+ return NLS.bind(HTMLUIMessages.Open, fAnchorName);
}
/*
@@ -302,7 +302,7 @@
Logger.logException(e);
}
}
- return fTarget.getNodeName();
+ return NLS.bind(HTMLUIMessages.Open, fTarget.getNodeName());
}
/*
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/ExternalFileHyperlink.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/ExternalFileHyperlink.java
index 4abbd6a..d8905ef 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/ExternalFileHyperlink.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/ExternalFileHyperlink.java
@@ -14,12 +14,14 @@
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.hyperlink.IHyperlink;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.ui.IEditorDescriptor;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.ide.IDE;
+import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
import org.eclipse.wst.jsdt.web.ui.internal.Logger;
/**
@@ -48,7 +50,11 @@
}
public String getHyperlinkText() {
- return null;
+ String path = fHyperlinkFile.getPath();
+ if (path.length() > 60) {
+ path = path.substring(0, 25) + "..." + path.substring(path.length() - 25, path.length());
+ }
+ return NLS.bind(HTMLUIMessages.Open, path);
}
public String getTypeLabel() {
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/JSDTHyperlink.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/JSDTHyperlink.java
index 309c846..b0c8096 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/JSDTHyperlink.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/JSDTHyperlink.java
@@ -14,6 +14,7 @@
import org.eclipse.jface.text.hyperlink.IHyperlink;
import org.eclipse.ui.IEditorPart;
import org.eclipse.wst.jsdt.core.IJavaScriptElement;
+import org.eclipse.wst.jsdt.internal.ui.actions.ActionMessages;
import org.eclipse.wst.jsdt.ui.JavaScriptUI;
import org.eclipse.wst.jsdt.web.ui.internal.Logger;
/**
@@ -48,8 +49,7 @@
* @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
*/
public String getHyperlinkText() {
- // TODO Auto-generated method stub
- return null;
+ return ActionMessages.OpenAction_declaration_label;
}
/*
diff --git a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/WorkspaceFileHyperlink.java b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/WorkspaceFileHyperlink.java
index 0127ad5..ea48fbb 100644
--- a/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/WorkspaceFileHyperlink.java
+++ b/bundles/org.eclipse.wst.jsdt.web.ui/src/org/eclipse/wst/jsdt/web/ui/internal/hyperlink/WorkspaceFileHyperlink.java
@@ -13,21 +13,16 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.hyperlink.IHyperlink;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.ide.IDE;
import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.wst.html.ui.internal.HTMLUIMessages;
import org.eclipse.wst.jsdt.web.ui.internal.Logger;
-/**
-*
-* Provisional API: This class/interface is part of an interim API that is still under development and expected to
-* change significantly before reaching stability. It is being made available at this early stage to solicit feedback
-* from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken
-* (repeatedly) as the API evolves.
-*/
class WorkspaceFileHyperlink implements IHyperlink {
// copies of this class exist in:
// org.eclipse.wst.xml.ui.internal.hyperlink
@@ -58,8 +53,11 @@
* @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
*/
public String getHyperlinkText() {
- // TODO Auto-generated method stub
- return null;
+ String path = fFile.getFullPath().toString();
+ if (path.length() > 60) {
+ path = path.substring(0, 25) + "..." + path.substring(path.length() - 25, path.length());
+ }
+ return NLS.bind(HTMLUIMessages.Open, path);
}
/*
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/XMLUIPluginResources.properties b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/XMLUIPluginResources.properties
index 1239b77..d399d9a 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/XMLUIPluginResources.properties
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/XMLUIPluginResources.properties
@@ -335,5 +335,5 @@
previousSibling_description=Go to Previous Sibling
gotoMatchingTag_label=Matching Tag
gotoMatchingTag_description=Go To Matching Tag
-Open=Open '{0}'
+Open=Open ''{0}''
_UI_BUTTON_SORT=Sort
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/CatalogEntryHyperlink.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/CatalogEntryHyperlink.java
index 346f10a..7ef2986 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/CatalogEntryHyperlink.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/CatalogEntryHyperlink.java
@@ -11,13 +11,14 @@
package org.eclipse.wst.xml.ui.internal.hyperlink;
import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.jface.text.hyperlink.URLHyperlink;
import org.eclipse.osgi.util.NLS;
import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalogEntry;
import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
@@ -50,7 +51,21 @@
return new WorkspaceFileHyperlink(fHyperlinkRegion, ResourcesPlugin.getWorkspace().getRoot().getFile(path));
}
else {
- return new URLHyperlink(fHyperlinkRegion, fEntry.getURI());
+ /*
+ * the URL detector will already work on the literal text, so
+ * offer to open the contents in an editor
+ */
+ try {
+ if (fEntry.getURI().startsWith("jar:file:"))
+ return new URLStorageHyperlink(fHyperlinkRegion, new URL(fEntry.getURI())) {
+ public String getHyperlinkText() {
+ return NLS.bind(XMLUIMessages.Open, fEntry.getKey());
+ }
+ };
+ }
+ catch (MalformedURLException e) {
+ // not valid?
+ }
}
return null;
}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/ExternalFileHyperlink.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/ExternalFileHyperlink.java
index e935fc3..6761969 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/ExternalFileHyperlink.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/ExternalFileHyperlink.java
@@ -51,7 +51,7 @@
public String getHyperlinkText() {
String path = fHyperlinkFile.getPath();
- if (path.length() > 55) {
+ if (path.length() > 60) {
path = path.substring(0, 25) + "..." + path.substring(path.length() - 25, path.length());
}
return NLS.bind(XMLUIMessages.Open, path);
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/URLStorageHyperlink.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/URLStorageHyperlink.java
new file mode 100644
index 0000000..bc4b03f
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/URLStorageHyperlink.java
@@ -0,0 +1,180 @@
+package org.eclipse.wst.xml.ui.internal.hyperlink;
+
+import java.io.InputStream;
+import java.net.URL;
+
+import org.eclipse.core.resources.IStorage;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.hyperlink.IHyperlink;
+import org.eclipse.jface.text.hyperlink.URLHyperlink;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.ui.IEditorDescriptor;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IPersistableElement;
+import org.eclipse.ui.IStorageEditorInput;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.ide.IDE;
+import org.eclipse.wst.sse.core.internal.util.JarUtilities;
+import org.eclipse.wst.xml.core.internal.Logger;
+import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
+import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
+
+/**
+ * Hyperlink for URLs (opens in read-only mode)
+ */
+class URLStorageHyperlink implements IHyperlink {
+ // copies of this class exist in:
+ // org.eclipse.wst.xml.ui.internal.hyperlink
+ // org.eclipse.wst.html.ui.internal.hyperlink
+ // org.eclipse.jst.jsp.ui.internal.hyperlink
+
+ static class StorageEditorInput implements IStorageEditorInput {
+ IStorage fStorage = null;
+
+ StorageEditorInput(IStorage storage) {
+ fStorage = storage;
+ }
+
+ public IStorage getStorage() throws CoreException {
+ return fStorage;
+ }
+
+ public boolean exists() {
+ return fStorage != null;
+ }
+
+ public boolean equals(Object obj) {
+ if (obj instanceof StorageEditorInput) {
+ return fStorage.equals(((StorageEditorInput) obj).fStorage);
+ }
+ return super.equals(obj);
+ }
+
+ public ImageDescriptor getImageDescriptor() {
+ return null;
+ }
+
+ public String getName() {
+ return fStorage.getName();
+ }
+
+ public IPersistableElement getPersistable() {
+ return null;
+ }
+
+ public String getToolTipText() {
+ return fStorage.getFullPath() != null ? fStorage.getFullPath().toString() : fStorage.getName();
+ }
+
+ public Object getAdapter(Class adapter) {
+ return null;
+ }
+ }
+
+ static class URLStorage implements IStorage {
+ URL fURL = null;
+
+ URLStorage(URL url) {
+ fURL = url;
+ }
+
+ public boolean equals(Object obj) {
+ if (obj instanceof URLStorage) {
+ return fURL.equals(((URLStorage) obj).fURL);
+ }
+ return super.equals(obj);
+ }
+
+ public InputStream getContents() throws CoreException {
+ InputStream stream = null;
+ try {
+ if (fURL.toString().startsWith("jar:file"))
+ stream = JarUtilities.getInputStream(fURL);
+ else
+ stream = fURL.openStream();
+ }
+ catch (Exception e) {
+ throw new CoreException(new Status(IStatus.ERROR, XMLUIPlugin.getDefault().getBundle().getSymbolicName(), IStatus.ERROR, fURL.toString(), e));
+ }
+ return stream;
+ }
+
+ public IPath getFullPath() {
+ return new Path(fURL.toString());
+ }
+
+ public String getName() {
+ return new Path(fURL.getFile()).lastSegment();
+ }
+
+ public boolean isReadOnly() {
+ return true;
+ }
+
+ public Object getAdapter(Class adapter) {
+ return null;
+ }
+
+ }
+
+ private IRegion fRegion;
+ private URL fURL;
+
+ public URLStorageHyperlink(IRegion region, URL url) {
+ fRegion = region;
+ fURL = url;
+ }
+
+ public IRegion getHyperlinkRegion() {
+ return fRegion;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.text.hyperlink.IHyperlink#getTypeLabel()
+ */
+ public String getTypeLabel() {
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
+ */
+ public String getHyperlinkText() {
+ return NLS.bind(XMLUIMessages.Open, fURL.toString());
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.text.hyperlink.IHyperlink#open()
+ */
+ public void open() {
+ if (fURL != null) {
+ IEditorInput input = new StorageEditorInput(new URLStorage(fURL));
+ IEditorDescriptor descriptor;
+ try {
+ descriptor = IDE.getEditorDescriptor(input.getName());
+ if (descriptor != null) {
+ IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ IDE.openEditor(page, input, descriptor.getId(), true);
+ }
+ }
+ catch (PartInitException e) {
+ Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e);
+ new URLHyperlink(fRegion, fURL.toString()).open();
+ }
+ }
+ }
+}
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/WorkspaceFileHyperlink.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/WorkspaceFileHyperlink.java
index bcd210b..0319952 100644
--- a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/WorkspaceFileHyperlink.java
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/hyperlink/WorkspaceFileHyperlink.java
@@ -67,7 +67,11 @@
* @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
*/
public String getHyperlinkText() {
- return NLS.bind(XMLUIMessages.Open, fFile.getName());
+ String path = fFile.getFullPath().toString();
+ if (path.length() > 60) {
+ path = path.substring(0, 25) + "..." + path.substring(path.length() - 25, path.length());
+ }
+ return NLS.bind(XMLUIMessages.Open, path);
}
public void open() {
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDHyperlink.java b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDHyperlink.java
index db9b913..960ed5d 100644
--- a/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDHyperlink.java
+++ b/bundles/org.eclipse.wst.xsd.ui/src-adt-xsd/org/eclipse/wst/xsd/ui/internal/editor/XSDHyperlink.java
@@ -25,6 +25,7 @@
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.ide.IDE;
import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
+import org.eclipse.wst.xsd.ui.internal.adt.editor.Messages;
import org.eclipse.xsd.XSDConcreteComponent;
import org.eclipse.xsd.XSDSchema;
@@ -56,7 +57,7 @@
public String getHyperlinkText()
{
- return null;
+ return Messages._UI_ACTION_SET_AS_FOCUS;
}
public void open()