Author: estherbin
Date: 2008-08-04 09:45:31 -0400 (Mon, 04 Aug 2008)
New Revision: 9491
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/TextUtil.java
Log:
Move isContains to the TextUtil
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 2008-08-04
12:51:47 UTC (rev 9490)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/ElService.java 2008-08-04
13:45:31 UTC (rev 9491)
@@ -14,13 +14,11 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.Assert;
-import org.jboss.tools.common.meta.action.impl.handlers.ReplaceSignificanceMessageImpl;
import org.jboss.tools.vpe.editor.bundle.BundleMap;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.css.ELReferenceList;
import org.jboss.tools.vpe.editor.css.ResourceReference;
import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
@@ -178,7 +176,7 @@
if (sourceNode.getNodeType() == Node.TEXT_NODE) {
textValue = sourceNode.getNodeValue();
- if ((textValue != null) && isContainsEl(textValue)) {
+ if ((textValue != null) && TextUtil.isContainsEl(textValue)) {
final String newValue = bundleMap.getBundleValue(textValue, 0);
if (!textValue.equals(newValue)) {
@@ -198,7 +196,7 @@
final Attr attr = (Attr) nodeMap.item(i);
final String value = attr.getValue();
- if (value != null && isContainsEl(value)) {
+ if (value != null && TextUtil.isContainsEl(value)) {
final String value2 = bundleMap.getBundleValue(value, 0);
if (!value2.equals(value)) {
@@ -214,16 +212,7 @@
}
- /**
- * @param value
- * @return
- */
- //TODO E Sherbin It's shouldn't bee here
- private boolean isContainsEl(final String value) {
- return (value.contains("#{") || value.contains("${"));
//$NON-NLS-1$//$NON-NLS-2$
- }
-
/**
* Checks if is available for node.
*
@@ -321,9 +310,8 @@
*/
public String reverseReplace(IFile resourceFile, String replacedString) {
String str = replacedString;
-
final ResourceReference[] references =
ELReferenceList.getInstance().getAllResources(resourceFile);
-
+
if ((str != null) && (references != null) && (references.length
> 0)) {
for (ResourceReference rf : references) {
if (replacedString.contains(rf.getProperties())) {
@@ -331,6 +319,7 @@
}
}
}
+
return str;
}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/TextUtil.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/TextUtil.java 2008-08-04
12:51:47 UTC (rev 9490)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/TextUtil.java 2008-08-04
13:45:31 UTC (rev 9491)
@@ -367,4 +367,14 @@
return str;
}
+
+
+ /**
+ * @param value
+ * @return
+ */
+ public static boolean isContainsEl(final String value) {
+ return (value.contains("#{") || value.contains("${"));
//$NON-NLS-1$//$NON-NLS-2$
+ }
+
}
Show replies by date