Author: akazakov
Date: 2009-06-29 11:13:48 -0400 (Mon, 29 Jun 2009)
New Revision: 16253
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ActionProposalType.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/internal/taglib/ActionProposalType.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ActionProposalType.java 2009-06-29
15:11:06 UTC (rev 16252)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ActionProposalType.java 2009-06-29
15:13:48 UTC (rev 16253)
@@ -19,6 +19,9 @@
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.graphics.Image;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.common.model.util.XModelObjectLoaderUtil;
import org.jboss.tools.common.text.TextProposal;
import org.jboss.tools.jst.web.kb.KbQuery;
import org.jboss.tools.jst.web.kb.WebKbPlugin;
@@ -43,8 +46,16 @@
if (!isReadyToUse()) {
return EMPTY_PROPOSAL_LIST;
}
+ XModelObject xModelObject =
EclipseResourceUtil.getObjectByResource(context.getResource());
+ if(xModelObject==null) {
+ return EMPTY_PROPOSAL_LIST;
+ }
+ String path = XModelObjectLoaderUtil.getResourcePath(xModelObject);
+ if(path==null) {
+ return EMPTY_PROPOSAL_LIST;
+ }
Properties view = new Properties();
- view.put(IWebPromptingProvider.VIEW_PATH,
context.getResource().getFullPath().removeFirstSegments(1).toString());
+ view.put(IWebPromptingProvider.VIEW_PATH, path);
List<Object> sourceList = provider.getList(xModel,
WebPromptingProvider.JSF_VIEW_ACTIONS, "", view);
if (sourceList != null && !sourceList.isEmpty()) {
Set<String> sorted = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);