[jbosstools-commits] JBoss Tools SVN: r24145 - in trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf: web/validation/jsf2 and 2 other directories.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Fri Aug 13 08:42:49 EDT 2010


Author: mareshkau
Date: 2010-08-13 08:42:48 -0400 (Fri, 13 Aug 2010)
New Revision: 24145

Modified:
   trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/messages/messages.properties
   trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2ComponentsValidator.java
   trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/action/JSF2ComponentResolutionGenerator.java
   trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/action/JSF2CompositeAttrsProposal.java
   trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/components/JSF2AttrTempComponent.java
Log:
https://jira.jboss.org/browse/JBIDE-6685

Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/messages/messages.properties
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/messages/messages.properties	2010-08-13 12:02:21 UTC (rev 24144)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/messages/messages.properties	2010-08-13 12:42:48 UTC (rev 24145)
@@ -103,7 +103,7 @@
 Create_JSF_2_Composite_Component=Create JSF 2 composite component named "{0}" in "{1}"
 Missing_JSF_2_Composite_Component=Composite component "{0}" was not found in a project resources directory
 Missing_JSF_2_Component_Attr=Attribute "{0}" is not defined for "{1}" composite component
-Create_JSF_2_Interface_Attr=Create attribute in an interface declaration of a composite component
+Create_JSF_2_Interface_Attr=Create attribute "{0}" in an interface declaration "{2}" of a composite component "{1}" 
 Missing_JSF_2_Resources_Folder=JSF 2 Resources folder "{0}" is missing in a project root directory
 Create_JSF_2_Resources_Folder=Create a folder "{0}" container for JSF 2 resources for URL "{1}"
 Rename_JSF_2_Composite_Components=Rename JSF 2 composite components

Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2ComponentsValidator.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2ComponentsValidator.java	2010-08-13 12:02:21 UTC (rev 24144)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/JSF2ComponentsValidator.java	2010-08-13 12:42:48 UTC (rev 24145)
@@ -129,6 +129,7 @@
 					component.getName());
 			message.setAttribute(JSF2ResourceUtil.COMPONENT_RESOURCE_PATH_KEY,
 					component.getComponentResourceLocation());
+			message.setAttribute(JSF2ResourceUtil.JSF2_COMPONENT_NAME, component.getElementName());
 			return;
 		}
 		if (args[0] instanceof JSF2URITempComponent) {

Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/action/JSF2ComponentResolutionGenerator.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/action/JSF2ComponentResolutionGenerator.java	2010-08-13 12:02:21 UTC (rev 24144)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/action/JSF2ComponentResolutionGenerator.java	2010-08-13 12:42:48 UTC (rev 24145)
@@ -43,7 +43,7 @@
 					return new IMarkerResolution[] { new JSF2CompositeComponentProposal(marker) };
 				}
 				if (IJSF2ValidationComponent.JSF2_FIXABLE_ATTR_TYPE.equals(fixType)) {
-					return new IMarkerResolution[] { new JSF2CompositeAttrsProposal() };
+					return new IMarkerResolution[] { new JSF2CompositeAttrsProposal(marker) };
 				}
 				if (IJSF2ValidationComponent.JSF2_URI_TYPE.equals(fixType)) {
 					return new IMarkerResolution[] { new JSF2ResourcesFolderProposal(marker) };

Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/action/JSF2CompositeAttrsProposal.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/action/JSF2CompositeAttrsProposal.java	2010-08-13 12:02:21 UTC (rev 24144)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/action/JSF2CompositeAttrsProposal.java	2010-08-13 12:42:48 UTC (rev 24145)
@@ -11,6 +11,7 @@
 
 package org.jboss.tools.jsf.web.validation.jsf2.action;
 
+import java.text.MessageFormat;
 import java.util.Map;
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IMarker;
@@ -19,6 +20,7 @@
 import org.eclipse.core.runtime.Path;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.ide.IDE;
+import org.jboss.tools.jsf.JSFModelPlugin;
 import org.jboss.tools.jsf.jsf2.util.JSF2ResourceUtil;
 import org.jboss.tools.jsf.messages.JSFUIMessages;
 import org.jboss.tools.jsf.web.validation.jsf2.JSF2XMLValidator;
@@ -34,9 +36,18 @@
 
 	private String componentPath = null;
 	private String[] attrs = null;
+	private String elementName = null;
+	private String attrName="";
 
-	public JSF2CompositeAttrsProposal() {
-		super();
+	public JSF2CompositeAttrsProposal(IMarker marker) {
+		super(marker.getResource());
+		try {
+			this.elementName=(String) marker.getAttribute(JSF2ResourceUtil.JSF2_COMPONENT_NAME);
+			this.componentPath=(String) marker.getAttribute(JSF2ResourceUtil.COMPONENT_RESOURCE_PATH_KEY);
+			this.attrName=(String)marker.getAttribute(IJSF2ValidationComponent.JSF2_ATTR_NAME_KEY);
+		} catch (CoreException e) {
+			JSFModelPlugin.getPluginLog().logError(e);
+		}
 	}
 
 	public JSF2CompositeAttrsProposal(IResource validateResource,
@@ -47,7 +58,7 @@
 	}
 
 	public String getDisplayString() {
-		return JSFUIMessages.Create_JSF_2_Interface_Attr;
+		return MessageFormat.format(JSFUIMessages.Create_JSF_2_Interface_Attr,attrName,elementName,JSF2ResourceUtil.calculateProjectRelativeJSF2ResourceProposal(validateResource.getProject())+componentPath);
 	}
 
 	@Override

Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/components/JSF2AttrTempComponent.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/components/JSF2AttrTempComponent.java	2010-08-13 12:02:21 UTC (rev 24144)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/components/JSF2AttrTempComponent.java	2010-08-13 12:42:48 UTC (rev 24145)
@@ -38,11 +38,14 @@
 	}
 
 	public void createValidationMessage() {
-		String nodeName = parentEl.getLocalName();
 		this.validationMessage = MessageFormat.format(
 				JSFUIMessages.Missing_JSF_2_Component_Attr, attr.getName(),
-				nodeName);
+				getElementName());
 	}
+	
+	public String getElementName(){
+		return parentEl.getLocalName();
+	}
 
 	public String getValidationMessage() {
 		return validationMessage;



More information about the jbosstools-commits mailing list