[jbosstools-commits] JBoss Tools SVN: r9425 - in trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces: template and 1 other directory.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Wed Jul 30 06:43:54 EDT 2008


Author: estherbin
Date: 2008-07-30 06:43:53 -0400 (Wed, 30 Jul 2008)
New Revision: 9425

Modified:
   trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java
   trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelItemTemplate.java
   trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuGroupTemplate.java
   trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuItemTemplate.java
   trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTabTemplate.java
Log:
Move getBundleValue methods to the ResourceUtil class for (https://jira.jboss.org/jira/browse/JBIDE-2582) issue.

Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java	2008-07-30 10:43:43 UTC (rev 9424)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java	2008-07-30 10:43:53 UTC (rev 9425)
@@ -23,18 +23,13 @@
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IFileEditorInput;
 import org.eclipse.ui.editors.text.ILocationProvider;
-import org.eclipse.wst.xml.core.internal.document.NodeListImpl;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
 import org.jboss.tools.jsf.vpe.richfaces.template.util.RichFaces;
-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.util.ElService;
 import org.mozilla.interfaces.nsIDOMElement;
 import org.mozilla.interfaces.nsIDOMNode;
 import org.mozilla.interfaces.nsIDOMNodeList;
 import org.mozilla.xpcom.XPCOMException;
-import org.w3c.dom.Attr;
 import org.w3c.dom.Element;
 import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.Node;
@@ -608,36 +603,8 @@
         }
     }
 
+  
     /**
-     * Gets the bundle value.
-     * 
-     * @param value the value
-     * @param offfset      *
-     * param pageContext the page context
-     * @param pageContext the page context
-     * @param offset the offset
-     * 
-     * @return the bundle value
-     */
-    public static String getBundleValue(VpePageContext pageContext, String value, int offset) {
-        BundleMap bundle = pageContext.getBundle();
-        return bundle.getBundleValue(value, offset);
-
-    }
-
-    /**
-     * get bundle.
-     * 
-     * @param pageContext the page context
-     * @param attr the attr
-     * 
-     * @return the bundle value
-     */
-    public static String getBundleValue(VpePageContext pageContext, Attr attr) {
-        return getBundleValue(pageContext, attr.getNodeValue(), ((IDOMAttr) attr).getValueRegionStartOffset());
-    }
-
-    /**
      * Parses the width height value.
      * 
      * @param value the value

Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelItemTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelItemTemplate.java	2008-07-30 10:43:43 UTC (rev 9424)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelItemTemplate.java	2008-07-30 10:43:53 UTC (rev 9425)
@@ -18,6 +18,7 @@
 import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
 import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
 import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.ResourceUtil;
 import org.mozilla.interfaces.nsIDOMDocument;
 import org.mozilla.interfaces.nsIDOMElement;
 import org.mozilla.interfaces.nsIDOMText;
@@ -215,7 +216,7 @@
 	    }
 	    if (attr != null) {
 		String itemLabel = attr.getNodeValue();
-		String bundleValue = ComponentUtil.getBundleValue(pageContext,
+		String bundleValue = ResourceUtil.getBundleValue(pageContext,
 			attr);
 		nsIDOMText text;
 		// if bundleValue differ from value then will be represent

Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuGroupTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuGroupTemplate.java	2008-07-30 10:43:43 UTC (rev 9424)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuGroupTemplate.java	2008-07-30 10:43:53 UTC (rev 9425)
@@ -26,6 +26,7 @@
 import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
 import org.jboss.tools.vpe.editor.template.VpeCreationData;
 import org.jboss.tools.vpe.editor.template.VpeToggableTemplate;
+import org.jboss.tools.vpe.editor.util.ResourceUtil;
 import org.jboss.tools.vpe.editor.util.VpeStyleUtil;
 import org.mozilla.interfaces.nsIDOMDocument;
 import org.mozilla.interfaces.nsIDOMElement;
@@ -291,7 +292,7 @@
 		}
 		if (null != labelAttr) {
 			labelValue = labelAttr.getNodeValue();
-			bundleValue = ComponentUtil.getBundleValue(pageContext,
+			bundleValue = ResourceUtil.getBundleValue(pageContext,
 					labelAttr);
 		}
 		

Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuItemTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuItemTemplate.java	2008-07-30 10:43:43 UTC (rev 9424)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelMenuItemTemplate.java	2008-07-30 10:43:53 UTC (rev 9425)
@@ -20,6 +20,7 @@
 import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
 import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
 import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.ResourceUtil;
 import org.jboss.tools.vpe.editor.util.VpeStyleUtil;
 import org.mozilla.interfaces.nsIDOMDocument;
 import org.mozilla.interfaces.nsIDOMElement;
@@ -212,7 +213,7 @@
 			}
 			if (null != labelAttr) {
 				labelValue = labelAttr.getNodeValue();
-				bundleValue = ComponentUtil.getBundleValue(pageContext,
+				bundleValue = ResourceUtil.getBundleValue(pageContext,
 						labelAttr);
 			}
 			

Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTabTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTabTemplate.java	2008-07-30 10:43:43 UTC (rev 9424)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTabTemplate.java	2008-07-30 10:43:53 UTC (rev 9425)
@@ -18,6 +18,7 @@
 import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
 import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
 import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.ResourceUtil;
 import org.mozilla.interfaces.nsIDOMDocument;
 import org.mozilla.interfaces.nsIDOMElement;
 import org.mozilla.interfaces.nsIDOMText;
@@ -269,7 +270,7 @@
 		} else if (sourceElement.hasAttribute(LABEL)) {
 			Attr labelAttr = sourceElement.getAttributeNode(LABEL);
 			if (null != labelAttr) {
-				String bundleValue = ComponentUtil.getBundleValue(pageContext, labelAttr);
+				String bundleValue = ResourceUtil.getBundleValue(pageContext, labelAttr);
 				mainTd.appendChild(visualDocument.createTextNode(bundleValue));
 			}
 		} else {




More information about the jbosstools-commits mailing list