Author: dazarov
Date: 2010-03-10 09:30:37 -0500 (Wed, 10 Mar 2010)
New Revision: 20736
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/action/AddTLDMarkerResolution.java
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/action/JSPProblemMarkerResolutionGenerator.java
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/messages.properties
Log:
https://jira.jboss.org/jira/browse/JBIDE-4876
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/action/AddTLDMarkerResolution.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/action/AddTLDMarkerResolution.java 2010-03-10
14:15:49 UTC (rev 20735)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/action/AddTLDMarkerResolution.java 2010-03-10
14:30:37 UTC (rev 20736)
@@ -36,15 +36,16 @@
public class AddTLDMarkerResolution implements IMarkerResolution2{
private IFile file;
private Properties properties;
+ private String resolutionName;
-
- public AddTLDMarkerResolution(IFile file, Properties properties){
+ public AddTLDMarkerResolution(IFile file, String name, Properties properties){
this.file = file;
this.properties = properties;
+ this.resolutionName = name;
}
public String getLabel() {
- return Messages.AddTLDMarkerResolution_Name;
+ return Messages.bind(Messages.AddTLDMarkerResolution_Name, resolutionName);
}
public void run(IMarker marker) {
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/action/JSPProblemMarkerResolutionGenerator.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/action/JSPProblemMarkerResolutionGenerator.java 2010-03-10
14:15:49 UTC (rev 20735)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/action/JSPProblemMarkerResolutionGenerator.java 2010-03-10
14:30:37 UTC (rev 20736)
@@ -39,6 +39,9 @@
*/
public class JSPProblemMarkerResolutionGenerator implements IMarkerResolutionGenerator2
{
+ private static final String
HTML_VALIDATOR_MARKER="org.eclipse.wst.html.core.validationMarker";
//$NON-NLS-1$
+ private static final String
JSP_VALIDATOR_MARKER="org.eclipse.jst.jsp.core.validationMarker"; //$NON-NLS-1$
+
public static HashMap<String, String> libs = new HashMap<String, String>();
static{
libs.put("s", "http://jboss.com/products/seam/taglib");
//$NON-NLS-1$//$NON-NLS-2$
@@ -53,12 +56,13 @@
private IFile file;
private Properties properties;
+ private String resolutionName;
public IMarkerResolution[] getResolutions(IMarker marker) {
try{
if(isOurCase(marker)){
return new IMarkerResolution[] {
- new AddTLDMarkerResolution(file, properties)
+ new AddTLDMarkerResolution(file, resolutionName, properties)
};
}
}catch(CoreException ex){
@@ -123,6 +127,12 @@
if(p.containsValue(prefix))
return false;
+ if(marker.getType().equals(HTML_VALIDATOR_MARKER) ||
marker.isSubtypeOf(HTML_VALIDATOR_MARKER)){
+ resolutionName = "xmlns: "+prefix+" =
\""+libs.get(prefix)+"\""; //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$
+ }else if(marker.getType().equals(JSP_VALIDATOR_MARKER) ||
marker.isSubtypeOf(JSP_VALIDATOR_MARKER)){
+ resolutionName = "<%@ taglib uri =
\""+libs.get(prefix)+"\" prefix=\""+prefix+"\"
%>"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+
return true;
}
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/messages.properties
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/messages.properties 2010-03-10
14:15:49 UTC (rev 20735)
+++
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/messages.properties 2010-03-10
14:30:37 UTC (rev 20736)
@@ -65,4 +65,4 @@
WebAppFoldersFormLayoutData_WebAppMimeMapping=WebAppMimeMapping
WebCompoundEditor_WebXMLEditor=Web XML Editor
XActionProvider_CompanyName=Red Hat
-AddTLDMarkerResolution_Name=Insert tag library definition
+AddTLDMarkerResolution_Name=Insert ''{0}'' tag library definition