Author: akazakov
Date: 2009-06-17 13:39:03 -0400 (Wed, 17 Jun 2009)
New Revision: 16018
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageProcessor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2808
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageProcessor.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageProcessor.java 2009-06-17
17:09:57 UTC (rev 16017)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageProcessor.java 2009-06-17
17:39:03 UTC (rev 16018)
@@ -49,7 +49,7 @@
public TextProposal[] getProposals(KbQuery query, IPageContext context) {
ArrayList<TextProposal> proposals = new ArrayList<TextProposal>();
- if (!isQueryForELProposals(query)) {
+ if (!isQueryForELProposals(query, context)) {
ITagLibrary[] libs = context.getLibraries();
for (int i = 0; libs != null && i < libs.length; i++) {
TextProposal[] libProposals = libs[i].getProposals(query, context);
@@ -61,27 +61,26 @@
// TODO
}
} else {
- if(query.getType() == KbQuery.Type.ATTRIBUTE_VALUE || ((query.getType() ==
KbQuery.Type.TEXT )&& context instanceof IFaceletPageContext)) {
- String value = query.getValue();
- //TODO convert value to EL string.
- String elString = value;
- ELResolver[] resolvers = context.getElResolvers();
- for (int i = 0; resolvers != null && i < resolvers.length; i++) {
- proposals.addAll(resolvers[i].getCompletions(elString, !query.isMask(),
query.getOffset(), context));
- }
+ String value = query.getValue();
+ //TODO convert value to EL string.
+ String elString = value;
+ ELResolver[] resolvers = context.getElResolvers();
+ for (int i = 0; resolvers != null && i < resolvers.length; i++) {
+ proposals.addAll(resolvers[i].getCompletions(elString, !query.isMask(),
query.getOffset(), context));
}
}
return proposals.toArray(new TextProposal[proposals.size()]);
}
- private boolean isQueryForELProposals(KbQuery query) {
+ private boolean isQueryForELProposals(KbQuery query, IPageContext context) {
if (query.getType() != KbQuery.Type.ATTRIBUTE_VALUE &&
- query.getType() != KbQuery.Type.TEXT)
+ ((query.getType() != KbQuery.Type.TEXT ) || !(context instanceof
IFaceletPageContext))) {
return false;
+ }
return (query.getValue() != null &&
- ( query.getValue().startsWith("#{") ||
- query.getValue().startsWith("${") ) );
+ (query.getValue().startsWith("#{") ||
+ query.getValue().startsWith("${")));
}
/**