Author: mareshkau
Date: 2011-02-22 05:25:25 -0500 (Tue, 22 Feb 2011)
New Revision: 29261
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/LocalizedMessage.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/i18n/I18nMarkerResolution.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/i18n/I18nValidationComponent.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/util/JSF2ValidatorConstants.java
Log:
https://issues.jboss.org/browse/JBIDE-7003, quick fix has been added
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/LocalizedMessage.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/LocalizedMessage.java 2011-02-22
09:15:40 UTC (rev 29260)
+++
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/LocalizedMessage.java 2011-02-22
10:25:25 UTC (rev 29261)
@@ -80,6 +80,8 @@
i18nLocMessage.setAttribute(IMarker.SEVERITY, 1);
i18nLocMessage.setAttribute(ValidatorMessage.ValidationId,
"org.jboss.tools.jsf.i18n.source"); //$NON-NLS-1$
i18nLocMessage.setAttribute(IMarker.MESSAGE,i18nLocMessage.getText());
+ i18nLocMessage.setAttribute(JSF2ValidatorConstants.PROBLEM_LENGHT,
i18nLocMessage.getLength());
+ i18nLocMessage.setAttribute(JSF2ValidatorConstants.PROBLEM_OFFSET,
i18nLocMessage.getOffset());
if(ijsfValidationComponent instanceof I18nValidationComponent){
i18nLocMessage.setAttribute(JSF2ValidatorConstants.INVALID_STRING_KEY,
((I18nValidationComponent)ijsfValidationComponent).getInValidString());
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/i18n/I18nMarkerResolution.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/i18n/I18nMarkerResolution.java 2011-02-22
09:15:40 UTC (rev 29260)
+++
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/i18n/I18nMarkerResolution.java 2011-02-22
10:25:25 UTC (rev 29261)
@@ -14,10 +14,19 @@
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IMarkerResolution;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.ide.IDE;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.eclipse.wst.sse.ui.StructuredTextEditor;
import org.jboss.tools.jsf.JSFModelPlugin;
import org.jboss.tools.jsf.messages.JSFUIMessages;
import org.jboss.tools.jsf.web.validation.jsf2.util.JSF2ValidatorConstants;
+import org.jboss.tools.jst.jsp.i18n.ExternalizeStringsDialog;
+import org.jboss.tools.jst.jsp.i18n.ExternalizeStringsWizard;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
/**
*
@@ -40,7 +49,22 @@
return
MessageFormat.format(JSFUIMessages.NonExternalizedStringMarkerLabel,invalidString);
}
- public void run(IMarker marker) {
-
+ public void run(final IMarker marker) {
+ try {
+ IEditorPart editorPart =
IDE.openEditor(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(),
marker);
+ if(editorPart instanceof JSPMultiPageEditor){
+ StructuredTextEditor textEditor =
((JSPMultiPageEditor)editorPart).getSourceEditor();
+ textEditor.getTextViewer().setSelectedRange((Integer)marker.getAttribute(JSF2ValidatorConstants.PROBLEM_OFFSET),(Integer)
marker.getAttribute(JSF2ValidatorConstants.PROBLEM_LENGHT));
+ ExternalizeStringsDialog dlg = new ExternalizeStringsDialog(
+ PlatformUI.getWorkbench().getDisplay().getActiveShell(),
+ new ExternalizeStringsWizard((ITextEditor)editorPart,
+ null));
+ dlg.open();
+ }
+ } catch (PartInitException e) {
+ JSFModelPlugin.getPluginLog().logError(e);
+ } catch (CoreException e) {
+ JSFModelPlugin.getPluginLog().logError(e);
+ }
}
}
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/i18n/I18nValidationComponent.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/i18n/I18nValidationComponent.java 2011-02-22
09:15:40 UTC (rev 29260)
+++
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/i18n/I18nValidationComponent.java 2011-02-22
10:25:25 UTC (rev 29261)
@@ -14,7 +14,6 @@
import org.jboss.tools.jsf.JSFModelPlugin;
import org.jboss.tools.jsf.messages.JSFUIMessages;
import org.jboss.tools.jsf.web.validation.JSFAbstractValidationComponent;
-import org.w3c.dom.Node;
/**
* @author mareshkau
@@ -44,13 +43,11 @@
public String getType() {
- // TODO Auto-generated method stub
return null;
}
public String getComponentResourceLocation() {
- // TODO Auto-generated method stub
return null;
}
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/util/JSF2ValidatorConstants.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/util/JSF2ValidatorConstants.java 2011-02-22
09:15:40 UTC (rev 29260)
+++
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/jsf2/util/JSF2ValidatorConstants.java 2011-02-22
10:25:25 UTC (rev 29261)
@@ -36,4 +36,8 @@
public static final String JSF2_URI_TYPE = "JSF2_URI_TYPE"; //$NON-NLS-1$
public static final String INVALID_STRING_KEY = "INVALID_STRING_KEY";
//$NON-NLS-1$
+
+ public static final String PROBLEM_OFFSET="PROBLEM_OFFSET"; //$NON-NLS-1$
+
+ public static final String PROBLEM_LENGHT="PROBLEM_LENGHT"; //$NON-NLS-1$
}