Author: mareshkau
Date: 2009-11-09 12:21:44 -0500 (Mon, 09 Nov 2009)
New Revision: 18497
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/4812/
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/4812/resourceProcessingTestPage.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/4812/resourceProcessingTestPage.xhtml.xml
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/Jsf2ResourceUtil.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/2550/jbide2550.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/4954/inputUserName.jsp.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5015/login.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2550Test.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionSrc.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/ElService.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/FileUtil.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4812
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/2550/jbide2550.xhtml.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/2550/jbide2550.xhtml.xml 2009-11-09
13:43:44 UTC (rev 18496)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/2550/jbide2550.xhtml.xml 2009-11-09
17:21:44 UTC (rev 18497)
@@ -20,29 +20,29 @@
</LABEL>
</TD>
<TD>
-<IMG SRC="/.*jsf2test/WebContent/resources/ch/img/1.0/img.gif/"
STYLE="-moz-user-modify: read-write;"/>
+<IMG SRC="/.*/jsf2test/WebContent/resources/ch/img/1.0/img.gif/"
STYLE="-moz-user-modify: read-write;"/>
</TD>
</TR>
<TR>
<TD>
-<LABEL>
+<LABEL >
resource [ "ch/img/2.0:img.gif" ]
</LABEL>
</TD>
<TD>
-<IMG SRC="/.*jsf2test/WebContent/resources/ch/img/2.0/img.gif/"
STYLE="-moz-user-modify: read-write;"/>
+<IMG SRC="/.*/jsf2test/WebContent/resources/ch/img/2.0/img.gif/"
STYLE="-moz-user-modify: read-write;"/>
</TD>
</TR>
<TR>
<TD>
-<LABEL>
+<LABEL >
resource['ru/img/1.0/img.gif']
</LABEL>
</TD>
<TD>
-<IMG SRC="/.*jsf2test/WebContent/resources/ru/img/1.0/img.gif/"
STYLE="-moz-user-modify: read-write;"/>
+<IMG SRC="/.*/ve/unresolved_image.gif/" STYLE="-moz-user-modify:
read-write;"/>
</TD>
</TR>
@@ -53,7 +53,7 @@
</LABEL>
</TD>
<TD>
-<IMG SRC="/.*jsf2test/WebContent/resources/ru/img/2.0/img.gif/"
STYLE="-moz-user-modify: read-write;"/>
+<IMG SRC="/.*/jsf2test/WebContent/resources/ru/img/2.0/img.gif/"
STYLE="-moz-user-modify: read-write;"/>
</TD>
</TR>
@@ -64,7 +64,7 @@
</LABEL>
</TD>
<TD>
-<IMG SRC="/.*jsf2test/WebContent/resources/ru/img/1.0/img.gif/1.gif/"
STYLE="-moz-user-modify: read-write;"/>
+<IMG SRC="/.*/jsf2test/WebContent/resources/ru/img/1.0/img.gif/1.gif/"
STYLE="-moz-user-modify: read-write;"/>
</TD>
</TR>
@@ -75,7 +75,7 @@
</LABEL>
</TD>
<TD>
-<IMG SRC="/.*jsf2test/WebContent/resources/ru/img/1.0/img.gif/2.gif/"
STYLE="-moz-user-modify: read-write;"/>
+<IMG SRC="/.*/jsf2test/WebContent/resources/ru/img/1.0/img.gif/2.gif/"
STYLE="-moz-user-modify: read-write;"/>
</TD>
</TR>
@@ -97,7 +97,7 @@
</LABEL>
</TD>
<TD>
-<IMG SRC="/.*jsf2test.WebContent.resources.us.img.img.gif/"
STYLE="-moz-user-modify: read-write;"/>
+<IMG SRC="/.*/jsf2test/WebContent/resources/us/img/img.gif/"
STYLE="-moz-user-modify: read-write;"/>
</TD>
</TR>
@@ -108,7 +108,7 @@
</LABEL>
</TD>
<TD>
-<IMG SRC="/.*metadata..plugins.org.jboss.tools.vpe.img.*.gif/"
STYLE="-moz-user-modify: read-write;"/>
+<IMG SRC="/.*/org.jboss.tools.vpe/img.*.gif/" STYLE="-moz-user-modify:
read-write;"/>
</TD>
</TR>
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/4812/resourceProcessingTestPage.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/4812/resourceProcessingTestPage.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/4812/resourceProcessingTestPage.xhtml 2009-11-09
17:21:44 UTC (rev 18497)
@@ -0,0 +1,18 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ez="http://java.sun.com/jsf/composite/ezcomp"
+
xmlns:jar="http://java.sun.com/jsf/composite/jarPage">
+<h:head>
+ <title>A simple example of EZComp</title>
+</h:head>
+<h:body>
+ <h:form id="jbide4812">
+ #{resource['css/stylesBlue.css']}
+ <h:outputText value="#{resource['css/stylesBlue.css']}" />
+ #{resource['css/stylesBlue.css1']}
+ </h:form>
+</h:body>
+</html>
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/4812/resourceProcessingTestPage.xhtml.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/4812/resourceProcessingTestPage.xhtml.xml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/4812/resourceProcessingTestPage.xhtml.xml 2009-11-09
17:21:44 UTC (rev 18497)
@@ -0,0 +1,12 @@
+<tests>
+ <test id="jbide4812">
+ <FORM STYLE="border: 1px dotted rgb(255, 102, 0); padding: 5px;">
+<SPAN CLASS="vpe-text">
+/resources/css/stylesBlue.css
+</SPAN>
+<SPAN CLASS="vpe-text">
+/resources/css/stylesBlue.css
+</SPAN>
+</FORM>
+ </test>
+</tests>
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/4954/inputUserName.jsp.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/4954/inputUserName.jsp.xml 2009-11-09
13:43:44 UTC (rev 18496)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/4954/inputUserName.jsp.xml 2009-11-09
17:21:44 UTC (rev 18497)
@@ -6,7 +6,7 @@
Test for JBIDE-4954
</SPAN>
</H1>
-<IMG SRC="/.*jsf2test/WebContent/resources/" STYLE="-moz-user-modify:
read-write;"/>
+<IMG SRC="/.*ve/unresolved_image.gif/" STYLE="-moz-user-modify:
read-write;"/>
</FORM>
</test>
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5015/login.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5015/login.xhtml 2009-11-09
13:43:44 UTC (rev 18496)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/5015/login.xhtml 2009-11-09
17:21:44 UTC (rev 18497)
@@ -10,6 +10,7 @@
</h:head>
<h:body>
<h:form id="jbide5015">
+ <h:outputStylesheet />
<jar:echo echo="Hello, Custom Jsf 2.O Components" />
<ez:loginPanel id="loginPanel" login="LOgin">
<f:actionListener for="loginEvent"
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2550Test.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2550Test.java 2009-11-09
13:43:44 UTC (rev 18496)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2550Test.java 2009-11-09
17:21:44 UTC (rev 18497)
@@ -34,6 +34,10 @@
public void testForJSF2CustomTags() throws Throwable{
performContentTest("JBIDE/5015/login.xhtml"); //$NON-NLS-1$
}
+ //test for
https://jira.jboss.org/jira/browse/JBIDE-4812
+ public void testForJSFResourcesForAnyAttribute() throws Throwable{
+ performContentTest("JBIDE/4812/resourceProcessingTestPage.xhtml");
//$NON-NLS-1$
+ }
@Override
protected String getTestProjectName() {
return JsfAllTests.IMPORT_JSF_20_PROJECT_NAME;
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionSrc.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionSrc.java 2009-11-09
13:43:44 UTC (rev 18496)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionSrc.java 2009-11-09
17:21:44 UTC (rev 18497)
@@ -11,27 +11,14 @@
package org.jboss.tools.vpe.editor.template.expression;
import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import java.util.zip.ZipEntry;
import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.internal.core.JarPackageFragmentRoot;
import org.eclipse.jface.text.IDocument;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IFileEditorInput;
@@ -54,14 +41,15 @@
import org.jboss.tools.vpe.editor.template.VpeCreatorUtil;
import org.jboss.tools.vpe.editor.util.ElService;
import org.jboss.tools.vpe.editor.util.FileUtil;
+import org.jboss.tools.vpe.editor.util.Jsf2ResourceUtil;
import org.jboss.tools.vpe.editor.util.VpeStyleUtil;
import org.w3c.dom.Node;
public class VpeFunctionSrc extends VpeFunction {
static final String IMG_UNRESOLVED = "unresolved_image.gif"; //$NON-NLS-1$
static final String IMG_PREFIX = "file:///"; //$NON-NLS-1$
- private static final Pattern resourcePatternWithSinglCoat=
Pattern.compile("[#\\$]\\{\\s*resource\\s*\\[\\s*'(.*)'\\s*\\]\\s*\\}");
//$NON-NLS-1$
- private static final Pattern resourcePatternWithDoableCoat=
Pattern.compile("[#\\$]\\{\\s*resource\\s*\\[\\s*\"(.*)\"\\s*\\]\\s*\\}");
//$NON-NLS-1$
+// private static final Pattern resourcePatternWithSinglCoat=
Pattern.compile("[#\\$]\\{\\s*resource\\s*\\[\\s*'(.*)'\\s*\\]\\s*\\}");
//$NON-NLS-1$
+// private static final Pattern resourcePatternWithDoableCoat=
Pattern.compile("[#\\$]\\{\\s*resource\\s*\\[\\s*\"(.*)\"\\s*\\]\\s*\\}");
//$NON-NLS-1$
public VpeValue exec(VpePageContext pageContext, Node sourceNode) throws
VpeExpressionException {
@@ -270,13 +258,9 @@
String resolvedValue =
value.replaceFirst("^\\s*(\\#|\\$)\\{facesContext.externalContext.requestContextPath\\}",
""); //$NON-NLS-1$ //$NON-NLS-2$
//fix for JBIDE-2550, author Maksim Areshkau
- Matcher singleCoatMatcher =
resourcePatternWithSinglCoat.matcher(resolvedValue);
- Matcher doubleCoatMatcher =
resourcePatternWithDoableCoat.matcher(resolvedValue);
- if(doubleCoatMatcher.find()) {
- resolvedValue = FileUtil.processJSF2Resource(pageContext,
doubleCoatMatcher.group(1));
- }else if(singleCoatMatcher.find()){
- resolvedValue = FileUtil.processJSF2Resource(pageContext,
singleCoatMatcher.group(1));
- }
+ if(Jsf2ResourceUtil.isJSF2ResourceString(resolvedValue)){
+ resolvedValue = Jsf2ResourceUtil.processCustomJSFAttributes(pageContext,
resolvedValue);
+ }
//Fix for JBIDE-3030
if(pageContext.getVisualBuilder().getCurrentIncludeInfo()==null
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/ElService.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/ElService.java 2009-11-09
13:43:44 UTC (rev 18496)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/ElService.java 2009-11-09
17:21:44 UTC (rev 18497)
@@ -19,7 +19,6 @@
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Platform;
-import org.eclipse.ui.texteditor.TextNavigationAction;
import org.jboss.tools.common.el.core.ELReferenceList;
import org.jboss.tools.common.el.core.GlobalELReferenceList;
import org.jboss.tools.common.resref.core.ResourceReference;
@@ -28,7 +27,6 @@
import org.w3c.dom.Attr;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
-import org.w3c.dom.Text;
/**
@@ -93,6 +91,7 @@
* @see IELService#replaceEl(IFile, String)
*/
public String replaceEl(IFile resourceFile, String resourceString) {
+
// Assert.isNotNull(resourceString);
if ((resourceString == null) || (resourceFile == null)) {
return ""; //$NON-NLS-1$
@@ -187,6 +186,9 @@
if (((this.isAvailable(file) && this.isAvailableForNode(sourceNode,
file)))
|| isInResourcesBundle(pageContext, sourceNode)){
rst = true;
+ }else if(Jsf2ResourceUtil.isContainJSF2ResourceAttributes(sourceNode)) {
+ //added by Maksim Areshkau, see JBIDE-4812
+ rst = true;
}
return rst;
}
@@ -383,6 +385,10 @@
rst = ResourceUtil.getBundleValue(pageContext, value);
//replace custom attributes
rst = replaceCustomAttributes(pageContext,rst);
+
+ if(Jsf2ResourceUtil.isJSF2ResourceString(rst)){
+ rst = Jsf2ResourceUtil.processCustomJSFAttributes(pageContext, rst);
+ }
//fix for JBIDE-3030
if((pageContext.getVisualBuilder().getCurrentIncludeInfo()==null)
|| !(pageContext.getVisualBuilder().getCurrentIncludeInfo().getStorage()
instanceof IFile)) {
@@ -393,7 +399,7 @@
return rst;
}
-
+
private String replaceCustomAttributes(VpePageContext pageContext, String value){
String result = value;
for (String el : pageContext.getCustomElementsAttributes().keySet()) {
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/FileUtil.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/FileUtil.java 2009-11-09
13:43:44 UTC (rev 18496)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/FileUtil.java 2009-11-09
17:21:44 UTC (rev 18497)
@@ -17,7 +17,6 @@
import java.io.InputStream;
import java.io.OutputStream;
import java.util.zip.ZipEntry;
-
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
@@ -62,30 +61,32 @@
* @return
*/
public static final String processJSF2Resource(VpePageContext pageContext, String
resStr){
- String resulString = resStr;
- resulString=resulString.replaceAll(":", "/");
//$NON-NLS-1$//$NON-NLS-2$
- resulString = "/resources/"+resulString; //$NON-NLS-1$
+ String tempString = resStr;
+ tempString=tempString.replaceAll(":", "/");
//$NON-NLS-1$//$NON-NLS-2$
+ tempString = FileUtil.JSF2_RESOURCES+tempString;
+ String result = ""; //$NON-NLS-1$
// if file not accessible and try to search in jar files
- if(VpeCreatorUtil.getFile(resulString, pageContext)==null) {
- String tempEntryPath =seachResourceInClassPath(pageContext,
"META-INF"+resulString); //$NON-NLS-1$
+ if(VpeCreatorUtil.getFile(tempString, pageContext)==null) {
+ String tempEntryPath =seachResourceInClassPath(pageContext,
"META-INF"+tempString); //$NON-NLS-1$
if(tempEntryPath!=null) {
- resulString = tempEntryPath;
+ result = tempEntryPath;
}
+ } else {
+ result = tempString;
}
- return resulString;
+ return result;
}
-
+
public static boolean isExistsInJSF2Resources(VpePageContext pageContext, String
resStr) {
String resourceString = resStr;
resourceString = resourceString.replaceAll(":", "/");
//$NON-NLS-1$//$NON-NLS-2$
- resourceString = "/resources/"+resourceString; //$NON-NLS-1$
+ resourceString = FileUtil.JSF2_RESOURCES+resourceString;
if(FileUtil.getFile(pageContext.getEditPart().getEditorInput(),
resourceString)!=null ||
- seachResourceInClassPath(pageContext, "META-INF"+resourceString)!=null)
{
+ FileUtil.seachResourceInClassPath(pageContext,
"META-INF"+resourceString)!=null) {
return true;
}
return false;
}
-
/**
* Function search into project class path resource, if resource founded in jar file,
make a
* temp copy of this resource and return path to copy.
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/Jsf2ResourceUtil.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/Jsf2ResourceUtil.java
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/Jsf2ResourceUtil.java 2009-11-09
17:21:44 UTC (rev 18497)
@@ -0,0 +1,99 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.editor.util;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.w3c.dom.Attr;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+
+/**
+ * Class created for processing jsf 2.0 resources, see following issues
+ * JBIDE-2550, JBIDE-4812,
+ *
+ * @author mareshkau
+ */
+public class Jsf2ResourceUtil {
+ private static final Pattern resourcePatternWithSinglCoat = Pattern
+ .compile("[#\\$]\\{\\s*resource\\s*\\[\\s*'(.*)'\\s*\\]\\s*\\}");
//$NON-NLS-1$
+ private static final Pattern resourcePatternWithDoableCoat = Pattern
+ .compile("[#\\$]\\{\\s*resource\\s*\\[\\s*\"(.*)\"\\s*\\]\\s*\\}");
//$NON-NLS-1$
+
+ /**
+ * Checks is node contained jsf attributes declaration
+ * @param sourceNode
+ * @return true if node has #{resource[...]} declarations
+ * false otherwise
+ */
+ public static boolean isContainJSF2ResourceAttributes(Node sourceNode) {
+ boolean result = false;
+ if (sourceNode.getNodeType() == Node.TEXT_NODE) {
+ String textValue = sourceNode.getNodeValue();
+ if (textValue != null) {
+ if (Jsf2ResourceUtil.isJSF2ResourceString(textValue)) {
+ result = true;
+ }
+ }
+ } else {
+ final NamedNodeMap nodeMap = sourceNode.getAttributes();
+ if ((nodeMap != null) && (nodeMap.getLength() > 0)) {
+ for (int i = 0; i < nodeMap.getLength(); i++) {
+ if (Jsf2ResourceUtil.isJSF2ResourceString(((Attr) nodeMap
+ .item(i)).getValue())) {
+ result = true;
+
+ }
+ }
+ }
+ }
+ return result;
+ }
+ /**
+ * Replaces custom jsf attribute with attribute from VPE
+ * @param pageContext
+ * @param value
+ * @return
+ */
+ public static final String processCustomJSFAttributes(VpePageContext pageContext,
String value){
+ String result =null;
+ //fix for JBIDE-2550, author Maksim Areshkau
+ Matcher singleCoatMatcher = resourcePatternWithSinglCoat.matcher(value);
+ Matcher doubleCoatMatcher = resourcePatternWithDoableCoat.matcher(value);
+ if(doubleCoatMatcher.find()) {
+ result = FileUtil.processJSF2Resource(pageContext, doubleCoatMatcher.group(1));
+ }else if(singleCoatMatcher.find()){
+ result = FileUtil.processJSF2Resource(pageContext,
singleCoatMatcher.group(1));
+ }
+
+ return result;
+ }
+
+ /**
+ * Checks if string is jsf 2 resource
+ *
+ * @param attributeValue
+ * @return
+ */
+ public static boolean isJSF2ResourceString(String attributeValue) {
+ Matcher singleCoatMatcher = resourcePatternWithSinglCoat
+ .matcher(attributeValue);
+ Matcher doubleCoatMatcher = resourcePatternWithDoableCoat
+ .matcher(attributeValue);
+ boolean result = false;
+ if (doubleCoatMatcher.find() || singleCoatMatcher.find()) {
+ result = true;
+ }
+ return result;
+ }
+}