Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoritrimble2010-01-26 21:45:56 +0000
committeritrimble2010-01-26 21:45:56 +0000
commitc544cde9bafbaa9cfc591497c7938662f674e8e2 (patch)
treee58f4e7b7cf7445d65273f3eb076a6b858511d97
parente656f15a4f8b95ebfce1f1d999128bcb89e38aff (diff)
downloadwebtools.jsf-c544cde9bafbaa9cfc591497c7938662f674e8e2.tar.gz
webtools.jsf-c544cde9bafbaa9cfc591497c7938662f674e8e2.tar.xz
webtools.jsf-c544cde9bafbaa9cfc591497c7938662f674e8e2.zip
Bug 254452 - JSF hyperlink provider shows "unknown hyperlink" when in list
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/Messages.java21
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jspeditor/BeanSuffixHyperlink.java14
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jspeditor/JavaElementHyperlink.java14
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/messages.properties7
4 files changed, 52 insertions, 4 deletions
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/Messages.java b/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/Messages.java
index 1fd9d71ee..90577674a 100644
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/Messages.java
+++ b/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/Messages.java
@@ -327,5 +327,24 @@ public class Messages extends NLS {
* see messages.properties
*/
public static String JSFPreferences_RootPage_Description;
-
+
+ /**
+ * see messages.properties
+ */
+ public static String Hyperlink_Open_JavaType;
+
+ /**
+ * see messages.properties
+ */
+ public static String Hyperlink_Open_JavaMethod;
+
+ /**
+ * see messages.properties
+ */
+ public static String Hyperlink_Open_JavaFile;
+
+ /**
+ * see messages.properties
+ */
+ public static String Hyperlink_Open_JavaElement;
}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jspeditor/BeanSuffixHyperlink.java b/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jspeditor/BeanSuffixHyperlink.java
index 798503fd4..315583bc7 100644
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jspeditor/BeanSuffixHyperlink.java
+++ b/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jspeditor/BeanSuffixHyperlink.java
@@ -11,6 +11,7 @@
package org.eclipse.jst.jsf.ui.internal.jspeditor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.ui.JavaUI;
@@ -22,6 +23,8 @@ import org.eclipse.jst.jsf.context.symbol.IBeanPropertySymbol;
import org.eclipse.jst.jsf.context.symbol.ISymbol;
import org.eclipse.jst.jsf.context.symbol.internal.impl.JavaUtil;
import org.eclipse.jst.jsf.ui.internal.JSFUiPlugin;
+import org.eclipse.jst.jsf.ui.internal.Messages;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.ui.IEditorPart;
/**
@@ -67,7 +70,16 @@ class BeanSuffixHyperlink implements IHyperlink,ITestHyperlink {
* @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
*/
public String getHyperlinkText() {
- return null;
+ //Bug 254452 - JSF hyperlink provider shows "unknown hyperlink" when in list
+ final IJavaElement element = determineJavaElement();
+ if (element != null) {
+ final ICompilationUnit compilationUnit = (ICompilationUnit)element.getAncestor(IJavaElement.COMPILATION_UNIT);
+ if (compilationUnit != null) {
+ return NLS.bind(Messages.Hyperlink_Open_JavaMethod, compilationUnit.getElementName(), element.getElementName());
+ }
+ return Messages.Hyperlink_Open_JavaFile;
+ }
+ return Messages.Hyperlink_Open_JavaElement;
}
/*
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jspeditor/JavaElementHyperlink.java b/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jspeditor/JavaElementHyperlink.java
index 7d77ce805..62b06ebef 100644
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jspeditor/JavaElementHyperlink.java
+++ b/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jspeditor/JavaElementHyperlink.java
@@ -11,11 +11,14 @@
package org.eclipse.jst.jsf.ui.internal.jspeditor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.ui.JavaUI;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.hyperlink.IHyperlink;
import org.eclipse.jst.jsf.ui.internal.JSFUiPlugin;
+import org.eclipse.jst.jsf.ui.internal.Messages;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.ui.IEditorPart;
/**
@@ -58,7 +61,16 @@ class JavaElementHyperlink implements IHyperlink, ITestHyperlink {
* @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
*/
public String getHyperlinkText() {
- return null;
+ //Bug 254452 - JSF hyperlink provider shows "unknown hyperlink" when in list
+ final IJavaElement element = determineJavaElement();
+ if (element != null) {
+ final ICompilationUnit compilationUnit = (ICompilationUnit)element.getAncestor(IJavaElement.COMPILATION_UNIT);
+ if (compilationUnit != null) {
+ return NLS.bind(Messages.Hyperlink_Open_JavaType, compilationUnit.getElementName());
+ }
+ return Messages.Hyperlink_Open_JavaFile;
+ }
+ return Messages.Hyperlink_Open_JavaElement;
}
/*
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/messages.properties b/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/messages.properties
index ba5b6e2fe..3e1e1875c 100644
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/messages.properties
+++ b/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/messages.properties
@@ -88,4 +88,9 @@ JSFValidationPreferencePage_ELPrefPanel_IncrementalValidationCheckBoxTitle= Vali
JSFLibraryEditControl_ImplVersion_UNKNOWN=UNKNOWN
-JSFPreferences_RootPage_Description=Expand the tree to edit preferences for a specific feature. \ No newline at end of file
+JSFPreferences_RootPage_Description=Expand the tree to edit preferences for a specific feature.
+
+Hyperlink_Open_JavaType=Open {0}
+Hyperlink_Open_JavaMethod=Open {1}(...) method in {0}
+Hyperlink_Open_JavaFile=Open Java file
+Hyperlink_Open_JavaElement=Open unknown Java element \ No newline at end of file

Back to the top