Author: scabanovich
Date: 2007-10-12 11:50:40 -0400 (Fri, 12 Oct 2007)
New Revision: 4166
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/JSPDialogCellEditorContentAssistProcessor.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPPropertySourceAdapter.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/ValueHelper.java
Log:
JBIDE-525
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/JSPDialogCellEditorContentAssistProcessor.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/JSPDialogCellEditorContentAssistProcessor.java 2007-10-12
15:18:23 UTC (rev 4165)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/JSPDialogCellEditorContentAssistProcessor.java 2007-10-12
15:50:40 UTC (rev 4166)
@@ -86,17 +86,11 @@
String htmlQuery = null;
if(isFacelets && tagName.indexOf(':')<1 &&
!RedHatHtmlContentAssistProcessor.JSFCAttributeName.equals(attributeName)) {
Element element = (Element)node;
-
- NamedNodeMap attributes = element.getAttributes();
- Node jsfC =
attributes.getNamedItem(RedHatHtmlContentAssistProcessor.JSFCAttributeName);
- if(jsfC != null && (jsfC instanceof Attr)) {
- Attr jsfCAttribute = (Attr)jsfC;
- String jsfTagName = jsfCAttribute.getValue();
- if(jsfTagName != null && jsfTagName.indexOf(':') > 0) {
- htmlQuery = new
StringBuffer(KbQuery.TAG_SEPARATOR).append(RedHatHtmlContentAssistProcessor.faceletHtmlPrefixStart
+
tagName).append(KbQuery.ATTRIBUTE_SEPARATOR).append(attributeName).append(KbQuery.ENUMERATION_SEPARATOR).append(matchString).toString();
- tagName = jsfTagName;
- faceletJsfTag = true;
- }
+ String jsfTagName = valueHelper.getFaceletJsfTag(element);
+ if(jsfTagName != null) {
+ faceletJsfTag = true;
+ tagName = jsfTagName;
+ htmlQuery = new
StringBuffer(KbQuery.TAG_SEPARATOR).append(RedHatHtmlContentAssistProcessor.faceletHtmlPrefixStart
+
tagName).append(KbQuery.ATTRIBUTE_SEPARATOR).append(attributeName).append(KbQuery.ENUMERATION_SEPARATOR).append(matchString).toString();
}
}
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPPropertySourceAdapter.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPPropertySourceAdapter.java 2007-10-12
15:18:23 UTC (rev 4165)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/JSPPropertySourceAdapter.java 2007-10-12
15:50:40 UTC (rev 4166)
@@ -36,6 +36,7 @@
import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
import org.eclipse.wst.xml.ui.internal.properties.EnumeratedStringPropertyDescriptor;
import org.jboss.tools.jst.jsp.JspEditorPlugin;
+import org.jboss.tools.jst.jsp.contentassist.RedHatHtmlContentAssistProcessor;
import org.jboss.tools.jst.jsp.editor.IVisualController;
import org.w3c.dom.Attr;
import org.w3c.dom.DOMException;
@@ -119,7 +120,16 @@
}
private String getQuery(String attributeName) {
- return "/" + fNode.getNodeName() + "@" + attributeName;
+ String tagName = fNode.getNodeName();
+ String jsfTagName = null;
+ if(fNode instanceof Element) {
+ jsfTagName = valueHelper.getFaceletJsfTag((Element)fNode);
+ }
+ if(jsfTagName != null) tagName = jsfTagName;
+ if(jsfTagName == null && valueHelper.isFacetets() &&
tagName.indexOf(':') < 0 &&
!RedHatHtmlContentAssistProcessor.JSFCAttributeName.equals(attributeName)) {
+ tagName = RedHatHtmlContentAssistProcessor.faceletHtmlPrefixStart + tagName;
+ }
+ return "/" + tagName + "@" + attributeName;
}
private IPropertyDescriptor[] createPropertyDescriptors() {
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/ValueHelper.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/ValueHelper.java 2007-10-12
15:18:23 UTC (rev 4165)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/ValueHelper.java 2007-10-12
15:50:40 UTC (rev 4166)
@@ -40,6 +40,7 @@
import org.jboss.tools.common.kb.KbConnectorFactory;
import org.jboss.tools.common.kb.KbConnectorType;
import org.jboss.tools.common.kb.KbException;
+import org.jboss.tools.common.kb.KbQuery;
import org.jboss.tools.common.kb.KbTldResource;
import org.jboss.tools.common.kb.TagDescriptor;
import org.jboss.tools.common.kb.wtp.JspWtpKbConnector;
@@ -53,6 +54,10 @@
import org.jboss.tools.jst.web.tld.TaglibData;
import org.jboss.tools.jst.web.tld.TaglibMapping;
import org.jboss.tools.jst.web.tld.VpeTaglibManager;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
public class ValueHelper {
private IEditorInput editorInput = null;
@@ -318,4 +323,21 @@
kbConnector.unregisterJspResource();
}
}
+
+ public String getFaceletJsfTag(Element element) {
+ if(!isFacelets) return null;
+ String name = element.getNodeName();
+ if(name.indexOf(':') >= 0) return null;
+
+ NamedNodeMap attributes = element.getAttributes();
+ Node jsfC =
attributes.getNamedItem(RedHatHtmlContentAssistProcessor.JSFCAttributeName);
+ if(jsfC != null && (jsfC instanceof Attr)) {
+ Attr jsfCAttribute = (Attr)jsfC;
+ String jsfTagName = jsfCAttribute.getValue();
+ if(jsfTagName != null && jsfTagName.indexOf(':') > 0) {
+ return jsfTagName;
+ }
+ }
+ return null;
+ }
}
Show replies by date