Author: mareshkau
Date: 2008-12-11 08:31:44 -0500 (Thu, 11 Dec 2008)
New Revision: 12546
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE-3030/jbide3385.jsp
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3030Test.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionTldVersionCheck.java
Log:
JBIDE-3385
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE-3030/jbide3385.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE-3030/jbide3385.jsp
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/JBIDE-3030/jbide3385.jsp 2008-12-11
13:31:44 UTC (rev 12546)
@@ -0,0 +1,112 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<%@ page contentType="text/html; charset=UTF-8"%>
+<%@ taglib
uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib
uri="http://java.sun.com/jsf/html" prefix="h"%>
+
+<html>
+<head>
+<style type="text/css">
+
+.row1{
+ font-family: Times;
+ background-color: #D7E6E3;
+}
+.row2{
+ font-family: Times;
+ background-color: #8D9E9B;
+}
+.name {
+}
+.path {
+font-size: x-small;
+}
+.server {
+font-size: small;
+}
+.fileSize {
+}
+.scanDate{
+font-size: x-small;
+}
+</style>
+<title>Net search</title>
+</head>
+<body>
+
+<f:view>
+ <h1><h:outputText value="Net Search" /></h1>
+ <h:form id="searchFilter">
+ <h:panelGrid id="filter" columns="11" border="1">
+ <h:outputText id="name" value="Name:" />
+ <h:inputText value="#{user.name}"></h:inputText>
+ <h:outputText id="path" value="Path:" />
+ <h:inputText value="#{user.path}"></h:inputText>
+ <h:outputText id="server" value="Server:" />
+ <h:inputText value="#{user.server}"></h:inputText>
+ <h:outputText id="maxSize" value="Max Size:" />
+ <h:inputText value="#{user.sizeMax}"></h:inputText>
+ <h:outputText id="minSize" value="Min Size:" />
+ <h:inputText value="#{user.sizeMin}"></h:inputText>
+ <h:commandButton style="align:right;"
+ value="Submit" />
+ </h:panelGrid>
+ <h:outputText value="Founde Items: #{user.numberOfItems}, shows only first 300
items"></h:outputText>
+ <h:dataTable value="#{user.resources}" rowClasses="row1, row2"
columnClasses="name, path, server,fileSize,scanDate" var="row">
+ <h:column>
+ <f:facet name="header">
+ <h:commandLink>
+ <h:outputText value="Name"></h:outputText>
+ <f:param name="orderBy" value="name"></f:param>
+ <f:param name="orderDirection"
value="#{user.orderDirection}"></f:param>
+ </h:commandLink>
+ </f:facet>
+ <h:outputText value="#{row.name}" />
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:commandLink>
+ <h:outputText value="Path" />
+ <f:param name="orderBy" value="path"></f:param>
+ <f:param name="orderDirection"
value="#{user.orderDirection}"></f:param>
+ </h:commandLink>
+ </f:facet>
+ <h:outputLink charset="UTF-8"
value="#{facesContext.externalContext.requestContextPath}/downloadServlet">
+ <h:outputText value="#{row.path}" />
+ <f:param name="downloadPath"
value="#{row.path}"></f:param>
+ </h:outputLink>
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:commandLink>
+ <h:outputText value="Server" />
+ <f:param name="orderBy" value="server"></f:param>
+ <f:param name="orderDirection"
value="#{user.orderDirection}"></f:param>
+ </h:commandLink>
+ </f:facet>
+ <h:outputText value="#{row.server}" />
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:commandLink>
+ <h:outputText value="File Size" />
+ <f:param name="orderBy" value="fileSize"></f:param>
+ <f:param name="orderDirection"
value="#{user.orderDirection}"></f:param>
+ </h:commandLink>
+ </f:facet>
+ <h:outputText value="#{row.fileSize}" />
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:commandLink>
+ <h:outputText value="Scan Date" />
+ <f:param name="orderBy" value="scanDate"></f:param>
+ <f:param name="orderDirection"
value="#{user.orderDirection}"></f:param>
+ </h:commandLink>
+ </f:facet>
+ <h:outputText value="#{row.scanDate}" />
+ </h:column>
+ </h:dataTable>
+ </h:form>
+</f:view>
+</body>
+</html>
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3030Test.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3030Test.java 2008-12-10
18:42:17 UTC (rev 12545)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3030Test.java 2008-12-11
13:31:44 UTC (rev 12546)
@@ -39,6 +39,7 @@
fileNames.add(jbide3030Path+"test.jsp"); //$NON-NLS-1$
fileNames.add(jbide3030Path+"test.html"); //$NON-NLS-1$
fileNames.add(jbide3030Path+"test.xhtml"); //$NON-NLS-1$
+ fileNames.add(jbide3030Path+"jbide3385.jsp");
}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionTldVersionCheck.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionTldVersionCheck.java 2008-12-10
18:42:17 UTC (rev 12545)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionTldVersionCheck.java 2008-12-11
13:31:44 UTC (rev 12546)
@@ -15,6 +15,7 @@
import java.util.List;
import org.eclipse.core.resources.IProject;
+import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IFileEditorInput;
import org.jboss.tools.common.kb.wtp.TLDVersionHelper;
import org.jboss.tools.common.model.XModel;
@@ -99,7 +100,12 @@
} else {
//here we getting tld version for xhtml files
XModel xm = null;
- IProject project =
((IFileEditorInput)pageContext.getEditPart().getEditorInput()).getFile().getProject();
+ //fix for JBIDE-3385, mareshkau
+ final IEditorInput editorInput = pageContext.getEditPart().getEditorInput();
+ if(!(editorInput instanceof IFileEditorInput)){
+ return new VpeValue(false);
+ }
+ IProject project = ((IFileEditorInput)editorInput).getFile().getProject();
IModelNature mn = EclipseResourceUtil.getModelNature(project);
if(mn!=null) {
xm = mn.getModel();