Author: sflanigan
Date: 2009-07-10 03:06:52 -0400 (Fri, 10 Jul 2009)
New Revision: 16524
Added:
trunk/vpe/plugins/org.jboss.tools.vpe.docbook/.settings/
trunk/vpe/plugins/org.jboss.tools.vpe.docbook/.settings/org.eclipse.jdt.core.prefs
trunk/vpe/plugins/org.jboss.tools.vpe.html/.settings/
trunk/vpe/plugins/org.jboss.tools.vpe.html/.settings/org.eclipse.jdt.core.prefs
trunk/vpe/plugins/org.jboss.tools.vpe.jsp/.settings/
trunk/vpe/plugins/org.jboss.tools.vpe.jsp/.settings/org.eclipse.jdt.core.prefs
trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/.settings/
trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/.settings/org.eclipse.jdt.core.prefs
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/.settings/
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/.settings/org.eclipse.jdt.core.prefs
trunk/vpe/plugins/org.jboss.tools.vpe/.settings/
trunk/vpe/plugins/org.jboss.tools.vpe/.settings/org.eclipse.jdt.core.prefs
trunk/vpe/plugins/org.jboss.tools.xulrunner.initializer/.settings/
trunk/vpe/plugins/org.jboss.tools.xulrunner.initializer/.settings/org.eclipse.jdt.core.prefs
trunk/vpe/plugins/org.jboss.tools.xulrunner/.settings/
trunk/vpe/plugins/org.jboss.tools.xulrunner/.settings/org.eclipse.jdt.core.prefs
Removed:
trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/.settings/org.eclipse.core.resources.prefs
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.resref/.settings/org.eclipse.jdt.core.prefs
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeExpressionBuilder.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeExpressionBuilderException.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-3557 Externalize English strings (added localized
message to checked exception VpeExpressionBuilderException; enabled NLS warnings for vpe
module)
Added: trunk/vpe/plugins/org.jboss.tools.vpe/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/.settings/org.eclipse.jdt.core.prefs
(rev 0)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/.settings/org.eclipse.jdt.core.prefs 2009-07-10
07:06:52 UTC (rev 16524)
@@ -0,0 +1 @@
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeExpressionBuilder.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeExpressionBuilder.java 2009-07-10
06:59:49 UTC (rev 16523)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeExpressionBuilder.java 2009-07-10
07:06:52 UTC (rev 16524)
@@ -10,16 +10,19 @@
******************************************************************************/
package org.jboss.tools.vpe.editor.template.expression;
+import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
+import org.jboss.tools.vpe.messages.VpeUIMessages;
+
public class VpeExpressionBuilder {
public static final char ATTR_PREFIX = '@';
- public static final String ATTR_PREFIX_S = "" + '@';
- public static final String SIGNATURE_ANY_ATTR = ATTR_PREFIX + "*";
- public static final String SIGNATURE_JSF_VALUE = "jsfvalue()";
+ public static final String ATTR_PREFIX_S = "" + '@'; //$NON-NLS-1$
+ public static final String SIGNATURE_ANY_ATTR = ATTR_PREFIX + "*";
//$NON-NLS-1$
+ public static final String SIGNATURE_JSF_VALUE = "jsfvalue()"; //$NON-NLS-1$
private static final char COMPL_EXPR_LEFT_BRACKET = '{';
private static final char COMPL_EXPR_RIGHT_BRACKET = '}';
@@ -30,7 +33,7 @@
private static final char OPER_EQUAL = '=';
private static final char OPER_PLUS = '+';
private static final char OPER_OR = '|';
- private static final String OPER_AND = "and";
+ private static final String OPER_AND = "and"; //$NON-NLS-1$
private static final char FUNC_BRACKET_LEFT = OPER_BRACKET_LEFT;
private static final char FUNC_BRACKET_RIGHT = OPER_BRACKET_RIGHT;
private static final char PARAM_SEPARATOR = ',';
@@ -167,7 +170,7 @@
text = text.substring(1);
int pos = text.indexOf(OPER_STRING);
if (pos == -1) {
- error("Closing apostrophe is not found", startPos);
+ error("Closing apostrophe is not found",
VpeUIMessages.VpeExpressionBuilder_ClosingApostropheNotFound, startPos); //$NON-NLS-1$
}
VpeOperand operand = new VpeStringOperand(getToken(pos));
text = text.substring(1);
@@ -190,7 +193,7 @@
private VpeOperand buildFunction(String name, int namePos) throws
VpeExpressionBuilderException {
VpeFunction function = VpeFunctionFactory.getFunction(name);
if (function == null) {
- error("Function \'" + name + "\' is not found", namePos);
//$NON-NLS-1$ //$NON-NLS-2$
+ error(MessageFormat.format("Function \''{0}\'' is not
found", name),
MessageFormat.format(VpeUIMessages.VpeExpressionBuilder_FunctionNotFound, name), namePos);
//$NON-NLS-1$
}
int bracketPos = currentPosition();
List<VpeOperand> params = new ArrayList<VpeOperand>();
@@ -311,14 +314,12 @@
return attrSignature(attrName, caseSensitive);
}
- private void error(String message, int pos) throws VpeExpressionBuilderException {
- throw new VpeExpressionBuilderException(originalText, message, pos);
+ private void error(String errorText, String localizedErrorText, int pos) throws
VpeExpressionBuilderException {
+ throw new VpeExpressionBuilderException(originalText, errorText, pos,
localizedErrorText);
}
-
-
private void undefinedCharacter(int pos) throws VpeExpressionBuilderException {
- error("Undefined character \'" + originalText.charAt(pos) +
'\'', pos);
+ error(MessageFormat.format("Undefined character \''{0}\''",
originalText.charAt(pos)),
MessageFormat.format(VpeUIMessages.VpeExpressionBuilder_UndefinedCharacter,
originalText.charAt(pos)), pos); //$NON-NLS-1$
}
private void undefinedCharacter() throws VpeExpressionBuilderException {
@@ -326,11 +327,11 @@
}
private void undefinedName(String name, int pos) throws VpeExpressionBuilderException {
- error("Undefined name \"" + name + '\"', pos);
+ error(MessageFormat.format("Undefined name \"{0}\"", name),
MessageFormat.format(VpeUIMessages.VpeExpressionBuilder_UndefinedName, name), pos);
//$NON-NLS-1$
}
private void bracketNotFound(int pos) throws VpeExpressionBuilderException {
- error("Closing bracket is not found", pos);
+ error("Closing bracket is not found",
VpeUIMessages.VpeExpressionBuilder_ClosingBracketNotFound, pos); //$NON-NLS-1$
}
public static String getOutputAttrName(String value) {
@@ -352,7 +353,7 @@
return null;
}
}
- if (value.startsWith("jsfvalue(")) {
+ if (value.startsWith("jsfvalue(")) { //$NON-NLS-1$
if (value.charAt(value.length() - 1) == OPER_BRACKET_RIGHT) {
value = value.substring(9, value.length() - 1);
if (value.length() <= 1) {
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeExpressionBuilderException.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeExpressionBuilderException.java 2009-07-10
06:59:49 UTC (rev 16523)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeExpressionBuilderException.java 2009-07-10
07:06:52 UTC (rev 16524)
@@ -10,9 +10,30 @@
******************************************************************************/
package org.jboss.tools.vpe.editor.template.expression;
+import java.text.MessageFormat;
+import org.jboss.tools.vpe.messages.VpeUIMessages;
+
public class VpeExpressionBuilderException extends Exception {
+ private final String expression;
+ private final String localizedErrorText;
+ private final int pos;
+
+ public VpeExpressionBuilderException(String expression, String errorText, int pos,
String localizedErrorText) {
+ super(MessageFormat.format("Expression: \"{0}\" pos={1} {2}",
expression, pos, errorText)); //$NON-NLS-1$
+ this.expression = expression;
+ this.localizedErrorText = localizedErrorText;
+ this.pos = pos;
+ }
+
+ @Deprecated // use constructor which supports localization
public VpeExpressionBuilderException(String expression, String message, int pos) {
- super("Expression: \"" + expression + "\" pos=" + pos +
" " + message);
+ this(expression, message, pos, message);
}
+
+ @Override
+ public String getLocalizedMessage() {
+ return MessageFormat.format(VpeUIMessages.VpeExpressionBuilderException_Message,
expression,
+ pos, localizedErrorText);
+ }
}
Added: trunk/vpe/plugins/org.jboss.tools.vpe.docbook/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.docbook/.settings/org.eclipse.jdt.core.prefs
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.docbook/.settings/org.eclipse.jdt.core.prefs 2009-07-10
07:06:52 UTC (rev 16524)
@@ -0,0 +1 @@
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
Added: trunk/vpe/plugins/org.jboss.tools.vpe.html/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.html/.settings/org.eclipse.jdt.core.prefs
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.html/.settings/org.eclipse.jdt.core.prefs 2009-07-10
07:06:52 UTC (rev 16524)
@@ -0,0 +1 @@
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
Added: trunk/vpe/plugins/org.jboss.tools.vpe.jsp/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.jsp/.settings/org.eclipse.jdt.core.prefs
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.jsp/.settings/org.eclipse.jdt.core.prefs 2009-07-10
07:06:52 UTC (rev 16524)
@@ -0,0 +1 @@
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.resref/.settings/org.eclipse.jdt.core.prefs
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.resref/.settings/org.eclipse.jdt.core.prefs 2009-07-10
06:59:49 UTC (rev 16523)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.resref/.settings/org.eclipse.jdt.core.prefs 2009-07-10
07:06:52 UTC (rev 16524)
@@ -4,4 +4,5 @@
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
org.eclipse.jdt.core.compiler.source=1.5
Copied: trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/.settings (from rev 16387,
trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/.settings)
Deleted:
trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/.settings/org.eclipse.core.resources.prefs
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/.settings/org.eclipse.core.resources.prefs 2009-07-05
16:37:44 UTC (rev 16387)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/.settings/org.eclipse.core.resources.prefs 2009-07-10
07:06:52 UTC (rev 16524)
@@ -1,3 +0,0 @@
-#Tue Mar 07 15:03:35 MSK 2006
-eclipse.preferences.version=1
-encoding//src/org/jboss/tools/palette/messages.properties=8859_1
Added:
trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/.settings/org.eclipse.jdt.core.prefs
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/.settings/org.eclipse.jdt.core.prefs 2009-07-10
07:06:52 UTC (rev 16524)
@@ -0,0 +1 @@
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
Added:
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/.settings/org.eclipse.jdt.core.prefs
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/.settings/org.eclipse.jdt.core.prefs 2009-07-10
07:06:52 UTC (rev 16524)
@@ -0,0 +1 @@
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
Added: trunk/vpe/plugins/org.jboss.tools.xulrunner/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.xulrunner/.settings/org.eclipse.jdt.core.prefs
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.xulrunner/.settings/org.eclipse.jdt.core.prefs 2009-07-10
07:06:52 UTC (rev 16524)
@@ -0,0 +1 @@
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
Added:
trunk/vpe/plugins/org.jboss.tools.xulrunner.initializer/.settings/org.eclipse.jdt.core.prefs
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.xulrunner.initializer/.settings/org.eclipse.jdt.core.prefs
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.xulrunner.initializer/.settings/org.eclipse.jdt.core.prefs 2009-07-10
07:06:52 UTC (rev 16524)
@@ -0,0 +1 @@
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning