harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apetre...@apache.org
Subject svn commit: r518556 - in /harmony/enhanced/classlib/trunk/modules/swing/src: main/java/common/javax/swing/ main/java/common/javax/swing/plaf/ main/java/common/javax/swing/text/ main/java/common/javax/swing/text/html/ main/java/common/org/apache/harmony...
Date Thu, 15 Mar 2007 10:04:15 GMT
Author: apetrenko
Date: Thu Mar 15 03:04:09 2007
New Revision: 518556

URL: http://svn.apache.org/viewvc?view=rev&rev=518556
Log:
Patch for HARMONY-3369 "[classlib][internationalization]Internationalization of the special
strings in the swing module"

Modified:
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JComponent.java
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JFrame.java
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JMenu.java
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JMenuBar.java
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JTextPane.java
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/UIDefaults.java
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/ComponentUI.java
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/AbstractDocument.java
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/DefaultStyledDocument.java
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/FlowView.java
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/StyledEditorKit.java
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/html/CSS.java
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/org/apache/harmony/x/swing/internal/nls/messages.properties
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/html/cssparser/CSSLogger.java
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/html/cssparser/CSSParser.java
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/html/cssparser/CSSParserTokenManager.java
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/html/cssparser/TokenMgrError.java
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/StyledEditorKit_StyledTextActionTest.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JComponent.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JComponent.java?view=diff&rev=518556&r1=518555&r2=518556
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JComponent.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JComponent.java
Thu Mar 15 03:04:09 2007
@@ -327,9 +327,9 @@
 
     private JPopupMenu componentPopupMenu;
 
-    private static final String ILLEGAL_CONDITION_MESSAGE = "condition must be one of "
-            + "JComponent.WHEN_IN_FOCUSED_WINDOW, JComponent.WHEN_FOCUSED "
-            + "or JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT";
+    private static final String ILLEGAL_CONDITION_MESSAGE = 
+            Messages.getString("swing.B3","JComponent.WHEN_IN_FOCUSED_WINDOW, JComponent.WHEN_FOCUSED
", //$NON-NLS-1$ //$NON-NLS-2$
+                    "JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT"); //$NON-NLS-1$ 
 
     private boolean opaque;
 

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JFrame.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JFrame.java?view=diff&rev=518556&r1=518555&r2=518556
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JFrame.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JFrame.java
Thu Mar 15 03:04:09 2007
@@ -30,6 +30,7 @@
 import javax.accessibility.Accessible;
 import javax.accessibility.AccessibleContext;
 import javax.accessibility.AccessibleStateSet;
+import org.apache.harmony.x.swing.internal.nls.Messages;
 import org.apache.harmony.x.swing.StringConstants;
 import org.apache.harmony.x.swing.Utilities;
 
@@ -369,8 +370,8 @@
                 break;
             default:
                 throw new IllegalArgumentException(
-                        "defaultCloseOperation must be one of: DO_NOTHING_ON_CLOSE,"
-                                + " HIDE_ON_CLOSE, DISPOSE_ON_CLOSE, or EXIT_ON_CLOSE");
+                    Messages.getString("swing.B2","defaultCloseOperation", //$NON-NLS-1$
//$NON-NLS-2$
+                        "DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE, DISPOSE_ON_CLOSE, EXIT_ON_CLOSE"));
//$NON-NLS-1$ 
         }
         firePropertyChange("defaultCloseOperation", oldOperation, operation);
     }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JMenu.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JMenu.java?view=diff&rev=518556&r1=518555&r2=518556
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JMenu.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JMenu.java
Thu Mar 15 03:04:09 2007
@@ -298,7 +298,7 @@
     }
 
     public boolean isTearOff() {
-        throw new Error("Not yet implemented");
+        throw new Error(Messages.getString("swing.err.0A")); //$NON-NLS-1$
     }
 
     public boolean isTopLevelMenu() {
@@ -312,7 +312,7 @@
 
     @Override
     public void setAccelerator(KeyStroke keyStroke) {
-        throw new Error("setAccelerator() in not used for JMenu. Use setMnemonic() instead.");
+        throw new Error(Messages.getString("swing.err.0B","setAccelerator()","setMnemonic()"));//$NON-NLS-1$
//$NON-NLS-2$ //$NON-NLS-3$
     }
 
     @Override

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JMenuBar.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JMenuBar.java?view=diff&rev=518556&r1=518555&r2=518556
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JMenuBar.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JMenuBar.java
Thu Mar 15 03:04:09 2007
@@ -32,6 +32,8 @@
 import org.apache.harmony.x.swing.StringConstants;
 import org.apache.harmony.x.swing.Utilities;
 
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
 /**
  * <p>
  * <i>JMenuBar</i>
@@ -210,11 +212,11 @@
     }
 
     public void setHelpMenu(JMenu menu) {
-        throw new Error("setHelpMenu() hasn't been implemented yet");
+        throw new Error(Messages.getString("swing.err.0C", "setHelpMenu()")); //$NON-NLS-1$
//$NON-NLS-2$
     }
 
     public JMenu getHelpMenu() {
-        throw new Error("getHelpMenu() hasn't been implemented yet");
+        throw new Error(Messages.getString("swing.err.0C", "getHelpMenu()")); //$NON-NLS-1$
//$NON-NLS-2$ 
     }
 
     public void setMargin(Insets margin) {

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JTextPane.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JTextPane.java?view=diff&rev=518556&r1=518555&r2=518556
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JTextPane.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JTextPane.java
Thu Mar 15 03:04:09 2007
@@ -69,7 +69,7 @@
         if (doc instanceof StyledDocument) {
             super.setDocument(doc);
         } else {
-            throw new IllegalArgumentException(Messages.getString("swing.48")); //$NON-NLS-1$
+            throw new IllegalArgumentException(Messages.getString("swing.48", "StyledDocument"));
//$NON-NLS-1$ //$NON-NLS-2$
         }
     }
 
@@ -222,7 +222,7 @@
         if (kit instanceof StyledEditorKit) {
             super.setEditorKit(kit);
         } else {
-            throw new IllegalArgumentException(Messages.getString("swing.49")); //$NON-NLS-1$
+            throw new IllegalArgumentException(Messages.getString("swing.49","StyledEditorKit"));
//$NON-NLS-1$ //$NON-NLS-2$
         }
     }
 

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/UIDefaults.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/UIDefaults.java?view=diff&rev=518556&r1=518555&r2=518556
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/UIDefaults.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/UIDefaults.java
Thu Mar 15 03:04:09 2007
@@ -321,7 +321,7 @@
             String classID = comp.getUIClassID();
             String fullClassName = (String)get(classID);
             if (fullClassName == null) {
-                getUIError("there is no UI class for " + classID + " key");
+                getUIError(Messages.getString("swing.err.0D", classID)); //$NON-NLS-1$
                 return null;
             }
             Class uiClass = (Class)get(fullClassName);

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/ComponentUI.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/ComponentUI.java?view=diff&rev=518556&r1=518555&r2=518556
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/ComponentUI.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/ComponentUI.java
Thu Mar 15 03:04:09 2007
@@ -27,6 +27,8 @@
 import javax.accessibility.AccessibleContext;
 import javax.swing.JComponent;
 
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
 public abstract class ComponentUI {
     public void update(final Graphics graphics, final JComponent component) {
         if (component.isOpaque()) {
@@ -73,7 +75,8 @@
     }
 
     public static ComponentUI createUI(final JComponent component) {
-        throw new Error("ComponentUI.createUI not implemented");
+        throw new Error(Messages.getString("swing.err.0C", "ComponentUI.createUI")); //$NON-NLS-1$
//$NON-NLS-2$
     }
 }
+
 

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/AbstractDocument.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/AbstractDocument.java?view=diff&rev=518556&r1=518555&r2=518556
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/AbstractDocument.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/AbstractDocument.java
Thu Mar 15 03:04:09 2007
@@ -284,7 +284,7 @@
             if (AbstractDocument.this.getCurrentWriter()
                 != Thread.currentThread()) {
 
-                throw new Error("The thread doesn't have the write lock");
+                throw new Error(Messages.getString("swing.err.0F")); //$NON-NLS-1$
             }
         }
 
@@ -865,7 +865,7 @@
             final int index = readers.indexOf(currentThread);
 
             if (index == -1) {
-                throw new Error("This thread doesn't hold read lock");
+                throw new Error(Messages.getString("swing.err.10")); //$NON-NLS-1$
             }
 
             readers.remove(index);
@@ -899,11 +899,8 @@
 
         public final synchronized void writeUnlock() {
             if (writer != Thread.currentThread()) {
-                throw new Error("Can't unlock document from "
-                                + "writing the reason being the current thread "
-                                + "doesn't hold the lock");
+                throw new Error(Messages.getString("swing.err.11")); //$NON-NLS-1$      
     }
             }
-
             if (--writerCount == 0) {
                 writer = null;
                 readers.clear();

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/DefaultStyledDocument.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/DefaultStyledDocument.java?view=diff&rev=518556&r1=518555&r2=518556
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/DefaultStyledDocument.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/DefaultStyledDocument.java
Thu Mar 15 03:04:09 2007
@@ -40,6 +40,8 @@
 import javax.swing.undo.AbstractUndoableEdit;
 import javax.swing.undo.UndoableEdit;
 
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
 public class DefaultStyledDocument extends AbstractDocument
     implements StyledDocument {
 
@@ -345,7 +347,7 @@
                     break;
 
                 default:
-                    throw new Error("Unknown type in the spec");
+                    throw new Error(Messages.getString("swing.err.12")); //$NON-NLS-1$
                 }
             }
         }
@@ -485,7 +487,7 @@
                 break;
 
             default:
-                throw new Error("Unknown direction in the ElementSpec");
+                throw new Error(Messages.getString("swing.err.13","ElementSpec")); //$NON-NLS-1$
//$NON-NLS-2$
             }
         }
 
@@ -1454,4 +1456,5 @@
         oos.defaultWriteObject();
     }
 }
+
 

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/FlowView.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/FlowView.java?view=diff&rev=518556&r1=518555&r2=518556
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/FlowView.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/FlowView.java
Thu Mar 15 03:04:09 2007
@@ -94,7 +94,7 @@
                 span += viewSpan;
             }
             if (index == -1) {
-                throw new Error("view to break on not found");
+                throw new Error(Messages.getString("swing.err.14")); //$NON-NLS-1$
             }
 
             View broken = toBreak.breakView(fv.getFlowAxis(),

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/StyledEditorKit.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/StyledEditorKit.java?view=diff&rev=518556&r1=518555&r2=518556
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/StyledEditorKit.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/StyledEditorKit.java
Thu Mar 15 03:04:09 2007
@@ -166,9 +166,9 @@
 
     public abstract static class StyledTextAction extends TextAction {
         private static final String documentExceptionMessage =
-            "document must be StyledDocument";
+            Messages.getString("swing.48","StyledDocument"); //$NON-NLS-1$ //$NON-NLS-2$
         private static final String editorKitExceptionMessage =
-            "EditorKit must be StyledEditorKit";
+            Messages.getString("swing.49","StyledEditorKit"); //$NON-NLS-1$ //$NON-NLS-2$
 
         public StyledTextAction(final String name) {
             super(name);
@@ -494,5 +494,6 @@
         }
     }
 }
+
 
 

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/html/CSS.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/html/CSS.java?view=diff&rev=518556&r1=518555&r2=518556
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/html/CSS.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/text/html/CSS.java
Thu Mar 15 03:04:09 2007
@@ -2972,8 +2972,7 @@
 
     static final class FixedSetValuesError extends Error {
         FixedSetValuesError(final int index, final String className) {
-            super("Can't create value holder for " + index
-                  + " of type " + className);
+            super(Messages.getString("swing.err.07", index, className)); //$NON-NLS-1$
         }
     }
 

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/org/apache/harmony/x/swing/internal/nls/messages.properties
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/org/apache/harmony/x/swing/internal/nls/messages.properties?view=diff&rev=518556&r1=518555&r2=518556
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/org/apache/harmony/x/swing/internal/nls/messages.properties
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/org/apache/harmony/x/swing/internal/nls/messages.properties
Thu Mar 15 03:04:09 2007
@@ -87,8 +87,8 @@
 swing.45=columns less than zero.
 swing.46=rows less than zero.
 swing.47=orientation must be VERTICAL or HORIZONTAL
-swing.48=Model must be StyledDocument.
-swing.49=Kit isn't a StyledEditorKit
+swing.48=Model must be '{0}'
+swing.49=Kit isn't a '{0}'
 swing.4A={0} is not a legal orientation
 swing.4B=No next element in enumeration
 swing.4C=Prefix must be specified
@@ -192,6 +192,8 @@
 swing.AF=node doesn't have a parent
 swing.B0=modification mode is incorrect
 swing.B1=TextUI needs JTextComponent
+swing.B2='{0}' must be one of: '{1}'
+swing.B3=condition must be one of '{0}' or '{1}'
 
 swing.err.01=Illegal request
 swing.err.02=BoxLayout should be used for one container only
@@ -202,3 +204,20 @@
 swing.err.07=font-size: can't resolve relative value. Unknown relative unit
 swing.err.08=FloatValue: can't resolve relative value. Unknown relative unit
 swing.err.09=Graphics is not instance of Graphics2D
+swing.err.0A=Not yet implemented
+swing.err.0B='{0}' in not used for JMenu. Use '{1}' instead.
+swing.err.0C='{0}' hasn't been implemented yet.
+swing.err.0D=There is no UI class for {0} key.
+swing.err.0F=The thread doesn't have the write lock.
+swing.err.10=This thread doesn't hold read lock.
+swing.err.11=Can't unlock document from writing the reason being the current thread doesn't
hold the lock.
+swing.err.12=Unknown type in the spec
+swing.err.13=Unknown direction in the '{0}'
+swing.err.14=View to break on not found.
+swing.err.15=Missing return statement in function.
+swing.err.16=ERROR: Cannot use a static '{0}' class with a non-static lexical analyzer.
+swing.err.17=Error: Ignoring invalid lexical state : {0}. State unchanged.
+swing.err.18=CSSParser: failed to parse {0} 
+swing.err.19=Can't create value holder for {0} of type {1}
+swing.err.1A=Lexical error at line {0}, column {1}. Encountered: 
+swing.err.1B=after : \

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/html/cssparser/CSSLogger.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/html/cssparser/CSSLogger.java?view=diff&rev=518556&r1=518555&r2=518556
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/html/cssparser/CSSLogger.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/html/cssparser/CSSLogger.java
Thu Mar 15 03:04:09 2007
@@ -19,12 +19,13 @@
  * @version $Revision$
  */
 package org.apache.harmony.x.swing.text.html.cssparser;
+import org.apache.harmony.x.swing.internal.nls.Messages;
 
 public class CSSLogger {
     public boolean loggingEnabled = true;
 
     public void logError(final Token token) {
-        printMessage("CSSParser: failed to parse " + getTokenInfo(token));
+        printMessage(Messages.getString("swing.err.18", getTokenInfo(token))); //$NON-NLS-1$
     }
 
 

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/html/cssparser/CSSParser.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/html/cssparser/CSSParser.java?view=diff&rev=518556&r1=518555&r2=518556
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/html/cssparser/CSSParser.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/html/cssparser/CSSParser.java
Thu Mar 15 03:04:09 2007
@@ -2,6 +2,7 @@
 package org.apache.harmony.x.swing.text.html.cssparser;
 
 import org.apache.harmony.x.swing.text.html.cssparser.metamodel.*;
+import org.apache.harmony.x.swing.internal.nls.Messages;
 
 public class CSSParser implements CSSParserConstants {
     private final CSSLogger logger = new CSSLogger();
@@ -53,7 +54,7 @@
     result = styleSheet();
     jj_consume_token(0);
     {if (true) return result;}
-    throw new Error("Missing return statement in function");
+    throw new Error(Messages.getString("swing.err.15")); //$NON-NLS-1$
   }
 
   final public Sheet styleSheet() throws ParseException {
@@ -73,7 +74,7 @@
     }
     styleSheetBody(result);
       {if (true) return result;}
-    throw new Error("Missing return statement in function");
+    throw new Error(Messages.getString("swing.err.15")); //$NON-NLS-1$
   }
 
   final public String importStatement() throws ParseException {
@@ -93,7 +94,7 @@
     }
     jj_consume_token(SEMICOLON);
         {if (true) return TokenResolver.resolve(importValue);}
-    throw new Error("Missing return statement in function");
+    throw new Error(Messages.getString("swing.err.15")); //$NON-NLS-1$
   }
 
   final public String import_recoverable() throws ParseException {
@@ -104,7 +105,7 @@
       skipTillImportEnd();
     }
       {if (true) return result;}
-    throw new Error("Missing return statement in function");
+    throw new Error(Messages.getString("swing.err.15")); //$NON-NLS-1$
   }
 
   final public void styleSheetBody(final Sheet sheet) throws ParseException {
@@ -198,7 +199,7 @@
     }
     jj_consume_token(CLOSE_BRACE);
      {if (true) return result;}
-    throw new Error("Missing return statement in function");
+    throw new Error(Messages.getString("swing.err.15")); //$NON-NLS-1$
   }
 
   final public RuleSet ruleSet_recoverable() throws ParseException {
@@ -209,7 +210,7 @@
      skipTillRuleSetEnd();
     }
      {if (true) return result;}
-    throw new Error("Missing return statement in function");
+    throw new Error(Messages.getString("swing.err.15")); //$NON-NLS-1$
   }
 
   final public String selector() throws ParseException {
@@ -270,7 +271,7 @@
       throw new ParseException();
     }
      {if (true) return TokenResolver.resolve(startToken, getToken(0), true);}
-    throw new Error("Missing return statement in function");
+    throw new Error(Messages.getString("swing.err.15")); //$NON-NLS-1$
   }
 
   final public void simple_selector() throws ParseException {
@@ -369,7 +370,7 @@
       ;
     }
       {if (true) return null;}
-    throw new Error("Missing return statement in function");
+    throw new Error(Messages.getString("swing.err.15")); //$NON-NLS-1$
   }
 
   final public Property declaration_recoverable() throws ParseException {
@@ -380,7 +381,7 @@
       skipTillDeclarationEnd();
     }
       {if (true) return result;}
-    throw new Error("Missing return statement in function");
+    throw new Error(Messages.getString("swing.err.15")); //$NON-NLS-1$
   }
 
   final public void prio() throws ParseException {
@@ -447,7 +448,7 @@
       ;
     }
       {if (true) return result.toString();}
-    throw new Error("Missing return statement in function");
+    throw new Error(Messages.getString("swing.err.15")); //$NON-NLS-1$
   }
 
   final public String term() throws ParseException {
@@ -498,7 +499,7 @@
       throw new ParseException();
     }
       {if (true) return TokenResolver.resolve(startToken, getToken(0), false);}
-    throw new Error("Missing return statement in function");
+    throw new Error(Messages.getString("swing.err.15")); //$NON-NLS-1$
   }
 
   final public String oper() throws ParseException {
@@ -516,7 +517,7 @@
       throw new ParseException();
     }
       {if (true) return TokenResolver.resolve(oper);}
-    throw new Error("Missing return statement in function");
+    throw new Error(Messages.getString("swing.err.15")); //$NON-NLS-1$
   }
 
   final public void unary_oper() throws ParseException {
@@ -538,7 +539,7 @@
   Token name;
     name = jj_consume_token(IDENT);
       {if (true) return TokenResolver.resolve(name);}
-    throw new Error("Missing return statement in function");
+    throw new Error(Messages.getString("swing.err.15")); //$NON-NLS-1$
   }
 
   void skipTillExpressionEnd() throws ParseException {

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/html/cssparser/CSSParserTokenManager.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/html/cssparser/CSSParserTokenManager.java?view=diff&rev=518556&r1=518555&r2=518556
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/html/cssparser/CSSParserTokenManager.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/html/cssparser/CSSParserTokenManager.java
Thu Mar 15 03:04:09 2007
@@ -1,6 +1,7 @@
 /* Generated By:JavaCC: Do not edit this line. CSSParserTokenManager.java */
 package org.apache.harmony.x.swing.text.html.cssparser;
 import org.apache.harmony.x.swing.text.html.cssparser.metamodel.*;
+import org.apache.harmony.x.swing.internal.nls.Messages;
 
 public class CSSParserTokenManager implements CSSParserConstants
 {
@@ -4079,7 +4080,7 @@
 protected char curChar;
 public CSSParserTokenManager(SimpleCharStream stream){
    if (SimpleCharStream.staticFlag)
-      throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical
analyzer.");
+      throw new Error(Messages.getString("swing.err.16", "CharStream")); //$NON-NLS-1$ //$NON-NLS-2$
    input_stream = stream;
 }
 public CSSParserTokenManager(SimpleCharStream stream, int lexState){
@@ -4108,7 +4109,7 @@
 public void SwitchTo(int lexState)
 {
    if (lexState >= 2 || lexState < 0)
-      throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ".
State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
+      throw new TokenMgrError(Messages.getString("swing.err.17", lexState), TokenMgrError.INVALID_LEXICAL_STATE);
//$NON-NLS-1$
    else
       curLexState = lexState;
 }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/html/cssparser/TokenMgrError.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/html/cssparser/TokenMgrError.java?view=diff&rev=518556&r1=518555&r2=518556
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/html/cssparser/TokenMgrError.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/org/apache/harmony/x/swing/text/html/cssparser/TokenMgrError.java
Thu Mar 15 03:04:09 2007
@@ -1,5 +1,6 @@
 /* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 3.0 */
 package org.apache.harmony.x.swing.text.html.cssparser;
+import org.apache.harmony.x.swing.internal.nls.Messages;
 
 public class TokenMgrError extends Error
 {
@@ -95,11 +96,9 @@
     * Note: You can customize the lexical error message by modifying this method.
     */
    protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int
errorColumn, String errorAfter, char curChar) {
-      return("Lexical error at line " +
-           errorLine + ", column " +
-           errorColumn + ".  Encountered: " +
-           (EOFSeen ? "<EOF> " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"")
+ " (" + (int)curChar + "), ") +
-           "after : \"" + addEscapes(errorAfter) + "\"");
+      return(Messages.getString("swing.err.1A", errorLine, errorColumn) +  //$NON-NLS-1$

+           (EOFSeen ? "<EOF> " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"")
+ " (" + (int)curChar + "), ") + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$

+           Messages.getString("swing.err.1B") + addEscapes(errorAfter) + "\""); //$NON-NLS-1$

    }
 
    /**

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/StyledEditorKit_StyledTextActionTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/StyledEditorKit_StyledTextActionTest.java?view=diff&rev=518556&r1=518555&r2=518556
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/StyledEditorKit_StyledTextActionTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/text/StyledEditorKit_StyledTextActionTest.java
Thu Mar 15 03:04:09 2007
@@ -127,7 +127,7 @@
             message = e.getMessage();
         }
         assertTrue(bWasException);
-        assertEquals("document must be StyledDocument", message);
+        assertTrue(message.endsWith("'StyledDocument'"));
         StyledEditorKit styledKit = new StyledEditorKit();
         jep.setEditorKit(styledKit);
         assertEquals(jep.getDocument(), action.getStyledDocument(jep));
@@ -140,7 +140,7 @@
             message = e.getMessage();
         }
         assertTrue(bWasException);
-        assertEquals("document must be StyledDocument", message);
+        assertTrue(message.endsWith("'StyledDocument'"));
     }
 
     public void testGetStyledEditorKit() {
@@ -152,7 +152,7 @@
             message = e.getMessage();
         }
         assertTrue(bWasException);
-        assertEquals("EditorKit must be StyledEditorKit", message);
+        assertTrue(message.endsWith("'StyledEditorKit'"));
         StyledEditorKit styledKit = new StyledEditorKit();
         jep.setEditorKit(styledKit);
         assertEquals(styledKit, action.getStyledEditorKit(jep));



Mime
View raw message