Author: dmaliarevich
Date: 2010-05-13 04:30:54 -0400 (Thu, 13 May 2010)
New Revision: 22050
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/lib/
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/lib/jhighlight-1.0.jar
Removed:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/lib/jhighlight-1.0.jar
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/.classpath
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/META-INF/MANIFEST.MF
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/build.properties
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInsertTemplate.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-6217 , reverting some changes from
https://jira.jboss.org/jira/browse/JBIDE-1636
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/.classpath
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/.classpath 2010-05-13 06:52:51 UTC
(rev 22049)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/.classpath 2010-05-13 08:30:54 UTC
(rev 22050)
@@ -1,7 +1,8 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con"
path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con"
path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry exported="true" kind="lib"
path="lib/jhighlight-1.0.jar"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/META-INF/MANIFEST.MF
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/META-INF/MANIFEST.MF 2010-05-13
06:52:51 UTC (rev 22049)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/META-INF/MANIFEST.MF 2010-05-13
08:30:54 UTC (rev 22050)
@@ -18,7 +18,8 @@
org.jboss.tools.vpe.xulrunner
Bundle-ActivationPolicy: lazy
Bundle-Vendor: %Bundle-Vendor.0
-Bundle-ClassPath: .
+Bundle-ClassPath: lib/jhighlight-1.0.jar,
+ .
Export-Package: org.jboss.tools.jsf.vpe.richfaces,
org.jboss.tools.jsf.vpe.richfaces.template.util
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/build.properties
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/build.properties 2010-05-13
06:52:51 UTC (rev 22049)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/build.properties 2010-05-13
08:30:54 UTC (rev 22050)
@@ -5,6 +5,7 @@
resources/,\
templates/,\
plugin.xml,\
+ lib/jhighlight-1.0.jar,\
plugin.properties,\
about.html
src.includes = src/,\
Copied: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/lib (from rev 21511,
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/lib)
Deleted: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/lib/jhighlight-1.0.jar
===================================================================
(Binary files differ)
Copied: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/lib/jhighlight-1.0.jar (from
rev 21511, trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/lib/jhighlight-1.0.jar)
===================================================================
(Binary files differ)
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInsertTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInsertTemplate.java 2010-05-13
06:52:51 UTC (rev 22049)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInsertTemplate.java 2010-05-13
08:30:54 UTC (rev 22050)
@@ -40,6 +40,9 @@
import org.w3c.dom.Text;
import org.xml.sax.SAXException;
+import com.uwyn.jhighlight.renderer.Renderer;
+import com.uwyn.jhighlight.renderer.XhtmlRendererFactory;
+
/**
*
* @author ezheleznyakov(a)exadel.com
@@ -138,16 +141,26 @@
}
}
- if (highlightValue == null) {
+ if ((highlightValue == null) || (!searchInSupportedTypes(highlightValue))){
// finalStr = finalStr.replace('\n', ' ');
nsIDOMText text = visualDocument.createTextNode(finalStr);
div.appendChild(text);
return vpeCreationData;
}
- div.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, ERROR_MESSAGE_STYLE);
- nsIDOMText text = visualDocument.createTextNode(HIGHLIGHT_ERROR_MESSAGE);
- div.appendChild(text);
+ Renderer renderer = XhtmlRendererFactory.getRenderer(highlightValue);
+ String transformStr = null;
+ try {
+ transformStr = renderer.highlight("", finalStr, UTF8, false);
//$NON-NLS-1$
+ transformStr = convertString(transformStr, highlightValue);
+ Node node = parseTransformString(transformStr);
+ buildVisualNode(node, div);
+ } catch (IOException e1) {
+ div.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, ERROR_MESSAGE_STYLE);
+ nsIDOMText text = visualDocument.createTextNode(HIGHLIGHT_ERROR_MESSAGE);
+ div.appendChild(text);
+ return vpeCreationData;
+ }
return vpeCreationData;
}
@@ -228,6 +241,30 @@
/**
*
+ * @param highlightValue
+ * value of highlight attribute
+ * @return true of highlight value correct
+ */
+
+ private boolean searchInSupportedTypes(String highlightValue) {
+
+ if (highlightValue == null)
+ return true;
+
+ if (highlightValue.trim().equals(EMPTY_STRING))
+ return false;
+
+ Set<?> set = XhtmlRendererFactory.getSupportedTypes();
+
+ for (Object object : set)
+ if (highlightValue.equalsIgnoreCase((String) object))
+ return true;
+
+ return false;
+ }
+
+ /**
+ *
* @param node
* @param el
* @return