Index: modules/swing/src/main/java/common/org/apache/harmony/x/swing/BlitSupport.java =================================================================== --- modules/swing/src/main/java/common/org/apache/harmony/x/swing/BlitSupport.java (revision 512762) +++ modules/swing/src/main/java/common/org/apache/harmony/x/swing/BlitSupport.java (working copy) @@ -34,7 +34,9 @@ import org.apache.harmony.awt.ComponentInternals; import org.apache.harmony.awt.gl.MultiRectArea; +import org.apache.harmony.x.swing.internal.nls.Messages; + /** * Blit engine which allows to 'repaint' moving components using Graphics.copyArea() (blitting mode). * To use this class a component and its parent should be JComponent. @@ -170,7 +172,7 @@ private boolean initialize() { if (blitingComponent == null) { - throw new IllegalStateException("Component is not defined yet"); + throw new IllegalStateException(Messages.getString("swing.71")); //$NON-NLS-1$ } if (parent == null) { Index: modules/swing/src/main/java/common/org/apache/harmony/x/swing/Utilities.java =================================================================== --- modules/swing/src/main/java/common/org/apache/harmony/x/swing/Utilities.java (revision 512762) +++ modules/swing/src/main/java/common/org/apache/harmony/x/swing/Utilities.java (working copy) @@ -60,6 +60,8 @@ import javax.swing.plaf.basic.BasicGraphicsUtils; import javax.swing.text.Position; +import org.apache.harmony.x.swing.internal.nls.Messages; + /** * SwingUtilities extension. This class provides utility * methods which are widely used in Swing classes. @@ -98,11 +100,11 @@ public static int getNextMatch(final ListModelAccessor model, final String prefix, final int startIndex, final Position.Bias bias) { if (prefix == null) { - throw new IllegalArgumentException("Prefix must be not null"); + throw new IllegalArgumentException(Messages.getString("swing.6F")); //$NON-NLS-1$ } if (startIndex < 0 || startIndex >= model.getSize()) { - throw new IllegalArgumentException("Incorrect start index"); + throw new IllegalArgumentException(Messages.getString("swing.6D")); //$NON-NLS-1$ } String ucPrefix = prefix.toUpperCase(); @@ -1139,4 +1141,4 @@ result += box.y; return result; } -} \ No newline at end of file +} Index: modules/swing/src/main/java/common/org/apache/harmony/x/swing/internal/nls/messages.properties =================================================================== --- modules/swing/src/main/java/common/org/apache/harmony/x/swing/internal/nls/messages.properties (revision 512762) +++ modules/swing/src/main/java/common/org/apache/harmony/x/swing/internal/nls/messages.properties (working copy) @@ -17,6 +17,187 @@ # messages for EN locale swing.00=Invalid axis: {0} swing.01=fromIndex must be <= toIndex -swing.02=Invalid verticalScrollBarPolicy -swing.03=Invalid horizontalScrollBarPolicy -swing.04=ComboBox is null +swing.02=Invalid '{0}' +swing.03='{0}' is null +swing.04=Invalid action number found in internal parse table +swing.05=threshhold must be >= 0 +swing.06=Ancestor shouldn't be null +swing.07=Invalid range properties +swing.08=Incorrect selection mode is specified +swing.09=Incorrect range for grayscale factor +swing.0A=Panel to remove can not be found +swing.0B=Cannot modify immutable data model +swing.0C=Selected index should in the range of available indices +swing.0D=For '{0}' condition ComponentInputMap has to be provided +swing.0E={0} was asked to deinstall() {1} when it only knows about {2} +swing.0F=Invalid start position +swing.10=index == {0} +swing.11=Incorrect dialog type is specified +swing.12=Incorrect file selection mode is specified +swing.13=must be one of: +swing.14=Invalid index is specified +swing.15=data model must be not null +swing.16=Model cannot be null +swing.17=Selection model must be not null +swing.18=DnD could not be used in headless environment +swing.19=Incorect layout orientation is specified +swing.1A=Visible region should be not null +swing.1B=Incorrect orientation is specified +swing.1C=Delay must be positive +swing.1D=Incorrect type of the etched border +swing.1E='{0}': parentComponent does not have a valid parent +swing.1F='{0}': type must be one of +swing.20=Illegal Option Type +swing.21=index must be positive +swing.22=index is greater than the number of items +swing.23={0} is not a valid title justification. +swing.24={0} is not a valid title position. +swing.25=Incorrect vertical policy is specified +swing.26=Incorrect key {0} is invalid +swing.27=Not implemented +swing.28=orientation must be one of: VERTICAL, HORIZONTAL +swing.29=argument must be VERTICAL or HORIZONTAL +swing.2A=increment must be > 0 +swing.2B=start is out of range +swing.2C=model not a '{0}' +swing.2D=Illegal startingRow is specified. Must be in the valid range +swing.2E={0} is not supported on this platform. +swing.2F=null model +swing.30=null editor +swing.31=Illegal selection interval is specified. Should be in [0, {0}] +swing.32=Incorrect resize weight is specified +swing.33=Incorrect proportional location is specified +swing.34=Component not found in the tabbed pane +swing.35=index < -1 || index >= tab count +swing.36=invalid tabLayoutPolicy +swing.37=invalid tabPlacement +swing.38=Row height must be positive +swing.39=Column does not exist +swing.3A=Model must be not null +swing.3B=Column model must be not null +swing.3C=rows: {0} +swing.3D=columns: {0} +swing.3E=Negative line +swing.3F=No such line +swing.40=Can't translate offset to line +swing.41=Invalid orientation: {0} +swing.42=Invalid insert +swing.43=Invalid remove +swing.44=end before start +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.4A={0} is not a legal orientation +swing.4B=No next element in enumeration +swing.4C=Prefix must be specified +swing.4D=ComponentInputMap must have a ComponentInputMap parent associated with the same component +swing.4E=focusCycleRoot must not be null +swing.4F=component must not be null +swing.50=Cannot happen +swing.51=can't set +swing.52=Popup content should be specified +swing.53=Factory should be not null +swing.54=Container is not a focus cycle root +swing.55='{0}' must be specified +swing.56=Component must be in a cycle root of the specified container +swing.57=ComponentInputMaps must be associated with a non-null JComponent +swing.58=invalid sequence element +swing.59=(start <= value <= end) is false +swing.5A=invalid calendarField +swing.5B=illegal value +swing.5C=SpinnerListModel(List) expects non-null non-empty List +swing.5D=SpinnerListModel(Object[]) expects non-null non-empty Object[] +swing.5E=value and stepSize must be non-null +swing.5F=(minimum <= value <= maximum) is false +swing.60=null stepSize +swing.61=Cannot convert point from null-component +swing.62=Cannot convert point to null-component +swing.63=Invalid initial delay: {0} +swing.64=Invalid delay: {0} +swing.65=Incorrect initial delay: {0} +swing.66=Incorrect dismiss delay: {0} +swing.67=Incorrect reshow delay: {0} +swing.68=Color should not be null +swing.69=path is not found +swing.6A=index is invalid +swing.6B=null delegate +swing.6C=Singleton +swing.6D=Incorrect start index +swing.6E=Incorrect direction is specified! +swing.6F=Prefix must be not null +swing.70=Incorrect layout orientation +swing.71=Component is not defined yet +swing.72=Null child not allowed +swing.73=illegal argument +swing.74=constraints must be String +swing.75=Index {0} is out of the specified range +swing.76=path in TreePath must not be null +swing.77=not text component +swing.78=Column must be not null +swing.79=Specified index is out of range +swing.7A=Identifier must be not null +swing.7B=Identifier is not found +swing.7C=Model must be not-null +swing.7D=Null model cannot be used +swing.7E=Document cannot be modified from listener handler +swing.7F=Invalid remove position +swing.80=Invalid remove length +swing.81=Invalid axis +swing.82=path in TreePath must be not null and not empty +swing.83=View representing {0} not found +swing.84=Invalid direction +swing.85=Invalid position offset +swing.86=Error creating instance +swing.87=Default painter of GlyphView can't paint composed text. +swing.88=This view doesn't represent offset {0} +swing.89=Invalid position: {0} +swing.8A=Empty attribute set +swing.8B=Not applicable to Layout Pool +swing.8C=Length must be non-negative +swing.8D=Invalid start position +swing.8E=Invalid insert position +swing.8F=the value is outside the min/max +swing.90=Wrong parameters : {0}, {1} +swing.91=bad position: {0} +swing.92=Cann't parse value +swing.93=Cann't parse String +swing.94=stringToValue passed invalid value +swing.95=incorrect position: {0} +swing.96=incorrect positions: +swing.97=row height must be positive value +swing.98=invalid position: +swing.99=The number of characters to remove must be non-negative +swing.9A=The enumeration has no more elements to provide +swing.9B=No attribute set count field. +swing.9C=Invalid tab index {0} +swing.9D=Parser should be set +swing.9E=Can't insert HTML text after start of a leaf element +swing.9F=Not implemented tag: +swing.A0=Document must be HTMLDocument +swing.A1=Editor kit must be HTMLEditorKit +swing.A2=Position cannot be negative +swing.A3=Must insert inside body element +swing.A4=Invalid side {0} +swing.A5=CSS parser required! +swing.A6=Children are not allowed for this node +swing.A7=specified child node is null or an ancestor of the current node +swing.A8=child must be not null +swing.A9=specified child is null or is not a child of this node +swing.AA=no more elements in enumeration +swing.AB=Specified ancestor is not an ancestor of this node +swing.AC=Node has no children +swing.AD=Specified child is not a child of this node +swing.AF=node doesn't have a parent +swing.B0=modification mode is incorrect + +swing.err.01=Illegal request +swing.err.02=BoxLayout should be used for one container only +swing.err.03=OverlayLayout can't be shared +swing.err.04=Invalid axis +swing.err.05=WARNING: HTML/RTF is not supported yet. Plain text will be shown +swing.err.06=ERROR: UIDefaults.getUI() failed: {0} +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 Index: modules/swing/src/main/java/common/javax/swing/JTabbedPane.java =================================================================== --- modules/swing/src/main/java/common/javax/swing/JTabbedPane.java (revision 512762) +++ modules/swing/src/main/java/common/javax/swing/JTabbedPane.java (working copy) @@ -36,6 +36,8 @@ import org.apache.harmony.luni.util.NotImplementedException; import org.apache.harmony.x.swing.StringConstants; +import org.apache.harmony.x.swing.internal.nls.Messages; + /** *
* JTabbedPane @@ -546,7 +548,7 @@ public void setSelectedComponent(Component comp) { int index = indexOfComponent(comp); if (index == NOT_FOUND) { - throw new IllegalArgumentException("Component not found in the tabbed pane"); + throw new IllegalArgumentException(Messages.getString("swing.34")); //$NON-NLS-1$ } setSelectedIndex(index); } @@ -557,7 +559,7 @@ public void setSelectedIndex(int index) { if (index < -1 || index >= getTabCount()) { - throw new IndexOutOfBoundsException("index < -1 || index >= tab count"); + throw new IndexOutOfBoundsException(Messages.getString("swing.35")); //$NON-NLS-1$ } getModel().setSelectedIndex(index); } @@ -568,7 +570,7 @@ public void setTabLayoutPolicy(int tabLayoutPolicy) { if (tabLayoutPolicy != WRAP_TAB_LAYOUT && tabLayoutPolicy != SCROLL_TAB_LAYOUT) { - throw new IllegalArgumentException("invalid tabLayoutPolicy"); + throw new IllegalArgumentException(Messages.getString("swing.36")); //$NON-NLS-1$ } int oldValue = this.tabLayoutPolicy; this.tabLayoutPolicy = tabLayoutPolicy; @@ -582,7 +584,7 @@ public void setTabPlacement(int tabPlacement) { if (tabPlacement != TOP && tabPlacement != BOTTOM && tabPlacement != LEFT && tabPlacement != RIGHT) { - throw new IllegalArgumentException("invalid tabPlacement"); + throw new IllegalArgumentException(Messages.getString("swing.37")); //$NON-NLS-1$ } int oldValue = this.tabPlacement; this.tabPlacement = tabPlacement; Index: modules/swing/src/main/java/common/javax/swing/AbstractButton.java =================================================================== --- modules/swing/src/main/java/common/javax/swing/AbstractButton.java (revision 512762) +++ modules/swing/src/main/java/common/javax/swing/AbstractButton.java (working copy) @@ -50,6 +50,7 @@ import org.apache.harmony.x.swing.ButtonCommons; import org.apache.harmony.x.swing.StringConstants; import org.apache.harmony.x.swing.Utilities; +import org.apache.harmony.x.swing.internal.nls.Messages; /** *
@@ -803,7 +804,7 @@ public void setMultiClickThreshhold(long threshold) { if (threshold < 0) { - throw new IllegalArgumentException("threshhold must be >= 0"); + throw new IllegalArgumentException(Messages.getString("swing.05")); //$NON-NLS-1$ } multiClickThreshhold = threshold; } @@ -853,7 +854,7 @@ public void setDisplayedMnemonicIndex(int index) throws IllegalArgumentException { if (index < -1 || index >= 0 && (text == null || index >= text.length())) { - throw new IllegalArgumentException("index == " + index); + throw new IllegalArgumentException(Messages.getString("swing.10",index)); //$NON-NLS-1$ } int oldValue = mnemonicIndex; mnemonicIndex = index; Index: modules/swing/src/main/java/common/javax/swing/JToolTip.java =================================================================== --- modules/swing/src/main/java/common/javax/swing/JToolTip.java (revision 512762) +++ modules/swing/src/main/java/common/javax/swing/JToolTip.java (working copy) @@ -25,6 +25,8 @@ import javax.accessibility.AccessibleRole; import javax.swing.plaf.ToolTipUI; +import org.apache.harmony.x.swing.internal.nls.Messages; + public class JToolTip extends JComponent implements Accessible { private static final String COMPONENT = "component"; private static final String TIP_TEXT = "tiptext"; @@ -33,10 +35,10 @@ protected class AccessibleJToolTip extends AccessibleJComponent { public String getAccessibleDescription() { - throw new UnsupportedOperationException("Not implemented"); + throw new UnsupportedOperationException(Messages.getString("swing.27")); //$NON-NLS-1$ } public AccessibleRole getAccessibleRole() { - throw new UnsupportedOperationException("Not implemented"); + throw new UnsupportedOperationException(Messages.getString("swing.27")); //$NON-NLS-1$ } } Index: modules/swing/src/main/java/common/javax/swing/GrayFilter.java =================================================================== --- modules/swing/src/main/java/common/javax/swing/GrayFilter.java (revision 512762) +++ modules/swing/src/main/java/common/javax/swing/GrayFilter.java (working copy) @@ -28,6 +28,8 @@ import java.awt.image.FilteredImageSource; import java.awt.image.RGBImageFilter; +import org.apache.harmony.x.swing.internal.nls.Messages; + public class GrayFilter extends RGBImageFilter { private static final float INTERVAL_BOUND = 1f / 3; @@ -41,7 +43,7 @@ public GrayFilter(boolean bright, int grayPercentage) { if (grayPercentage < 0 || grayPercentage > 100) { - throw new IllegalArgumentException("Incorrect range for grayscale factor"); + throw new IllegalArgumentException(Messages.getString("swing.09")); //$NON-NLS-1$ } canFilterIndexColorModel = true; Index: modules/swing/src/main/java/common/javax/swing/JColorChooser.java =================================================================== --- modules/swing/src/main/java/common/javax/swing/JColorChooser.java (revision 512762) +++ modules/swing/src/main/java/common/javax/swing/JColorChooser.java (working copy) @@ -36,6 +36,7 @@ import javax.swing.colorchooser.DefaultColorSelectionModel; import javax.swing.plaf.ColorChooserUI; +import org.apache.harmony.x.swing.internal.nls.Messages; /** *
* JColorChooser @@ -251,7 +252,7 @@ } } if (panelToRemove == null) { - throw new IllegalArgumentException("panel to remove can not be found"); + throw new IllegalArgumentException(Messages.getString("swing.0A")); //$NON-NLS-1$ } AbstractColorChooserPanel[] newChooserPanels = new AbstractColorChooserPanel[chooserPanels.length - 1]; System.arraycopy(chooserPanels, 0, newChooserPanels, 0, index); Index: modules/swing/src/main/java/common/javax/swing/ToolTipManager.java =================================================================== --- modules/swing/src/main/java/common/javax/swing/ToolTipManager.java (revision 512762) +++ modules/swing/src/main/java/common/javax/swing/ToolTipManager.java (working copy) @@ -31,7 +31,9 @@ import org.apache.harmony.x.swing.Utilities; +import org.apache.harmony.x.swing.internal.nls.Messages; + public class ToolTipManager extends MouseAdapter implements MouseMotionListener { protected class insideTimerAction implements ActionListener { public void actionPerformed(final ActionEvent e) { @@ -105,7 +107,7 @@ public void setInitialDelay(final int milliseconds) { if (milliseconds < 0) { - throw new IllegalArgumentException("Incorrect initial delay: " + milliseconds); + throw new IllegalArgumentException(Messages.getString("swing.65", milliseconds)); //$NON-NLS-1$ } initialDelay = milliseconds; } @@ -116,7 +118,7 @@ public void setDismissDelay(final int milliseconds) { if (milliseconds < 0) { - throw new IllegalArgumentException("Incorrect dismiss delay: " + milliseconds); + throw new IllegalArgumentException(Messages.getString("swing.66", milliseconds)); //$NON-NLS-1$ } dismissDelay = milliseconds; } @@ -127,7 +129,7 @@ public void setReshowDelay(final int milliseconds) { if (milliseconds < 0) { - throw new IllegalArgumentException("Incorrect reshow delay: " + milliseconds); + throw new IllegalArgumentException(Messages.getString("swing.67", milliseconds)); //$NON-NLS-1$ } reshowDelay = milliseconds; } Index: modules/swing/src/main/java/common/javax/swing/JViewport.java =================================================================== --- modules/swing/src/main/java/common/javax/swing/JViewport.java (revision 512762) +++ modules/swing/src/main/java/common/javax/swing/JViewport.java (working copy) @@ -46,7 +46,9 @@ import org.apache.harmony.x.swing.BlitSupport; +import org.apache.harmony.x.swing.internal.nls.Messages; + public class JViewport extends JComponent implements Accessible { private static final long serialVersionUID = -633250949788872287L; @@ -142,7 +144,7 @@ @Override public final void setBorder(final Border b) { if (b != null) { - throw new IllegalArgumentException("method is not implemented"); + throw new IllegalArgumentException(Messages.getString("swing.27")); //$NON-NLS-1$ } } @@ -450,4 +452,4 @@ removeAll(); } } -} \ No newline at end of file +} Index: modules/swing/src/main/java/common/javax/swing/JMenuItem.java =================================================================== --- modules/swing/src/main/java/common/javax/swing/JMenuItem.java (revision 512762) +++ modules/swing/src/main/java/common/javax/swing/JMenuItem.java (working copy) @@ -37,7 +37,9 @@ import org.apache.harmony.x.swing.StringConstants; +import org.apache.harmony.x.swing.internal.nls.Messages; + public class JMenuItem extends AbstractButton implements Accessible, MenuElement { // TODO implement @@ -52,7 +54,7 @@ } public void stateChanged(final ChangeEvent e) { - throw new UnsupportedOperationException("not implemented"); + throw new UnsupportedOperationException(Messages.getString("swing.27")); //$NON-NLS-1$ } } Index: modules/swing/src/main/java/common/javax/swing/JTextPane.java =================================================================== --- modules/swing/src/main/java/common/javax/swing/JTextPane.java (revision 512762) +++ modules/swing/src/main/java/common/javax/swing/JTextPane.java (working copy) @@ -41,7 +41,9 @@ import org.apache.harmony.awt.text.TextUtils; +import org.apache.harmony.x.swing.internal.nls.Messages; + public class JTextPane extends JEditorPane implements ImageObserver, MenuContainer, Serializable, Accessible, Scrollable { @@ -63,7 +65,7 @@ if (doc instanceof StyledDocument) { super.setDocument(doc); } else { - throw new IllegalArgumentException("Model must be StyledDocument."); + throw new IllegalArgumentException(Messages.getString("swing.48")); //$NON-NLS-1$ } } @@ -216,7 +218,7 @@ if (kit instanceof StyledEditorKit) { super.setEditorKit(kit); } else { - throw new IllegalArgumentException("Kit isn't a StyledEditorKit"); + throw new IllegalArgumentException(Messages.getString("swing.49")); //$NON-NLS-1$ } } Index: modules/swing/src/main/java/common/javax/swing/LayoutFocusTraversalPolicy.java =================================================================== --- modules/swing/src/main/java/common/javax/swing/LayoutFocusTraversalPolicy.java (revision 512762) +++ modules/swing/src/main/java/common/javax/swing/LayoutFocusTraversalPolicy.java (working copy) @@ -30,6 +30,8 @@ import java.io.Serializable; import java.util.Comparator; +import org.apache.harmony.x.swing.internal.nls.Messages; + public class LayoutFocusTraversalPolicy extends SortingFocusTraversalPolicy implements Serializable { private static final long serialVersionUID = 3761404205428127289L; @@ -41,10 +43,10 @@ public Component getComponentBefore(final Container focusCycleRoot, final Component component) { if (focusCycleRoot == null) { - throw new IllegalArgumentException("focusCycleRoot must not be null"); + throw new IllegalArgumentException(Messages.getString("swing.4E")); //$NON-NLS-1$ } if (component == null) { - throw new IllegalArgumentException("component must not be null"); + throw new IllegalArgumentException(Messages.getString("swing.4F")); //$NON-NLS-1$ } ((LayoutComparator)getComparator()).setOrientation(focusCycleRoot.getComponentOrientation()); return super.getComponentBefore(focusCycleRoot, component); @@ -52,10 +54,10 @@ public Component getComponentAfter(final Container focusCycleRoot, final Component component) { if (focusCycleRoot == null) { - throw new IllegalArgumentException("focusCycleRoot must not be null"); + throw new IllegalArgumentException(Messages.getString("swing.4E")); //$NON-NLS-1$ } if (component == null) { - throw new IllegalArgumentException("component must not be null"); + throw new IllegalArgumentException(Messages.getString("swing.4F")); //$NON-NLS-1$ } ((LayoutComparator)getComparator()).setOrientation(focusCycleRoot.getComponentOrientation()); return super.getComponentAfter(focusCycleRoot, component); @@ -63,7 +65,7 @@ public Component getLastComponent(final Container focusCycleRoot) { if (focusCycleRoot == null) { - throw new IllegalArgumentException("focusCycleRoot must not be null"); + throw new IllegalArgumentException(Messages.getString("swing.4E")); //$NON-NLS-1$ } ((LayoutComparator)getComparator()).setOrientation(focusCycleRoot.getComponentOrientation()); return super.getLastComponent(focusCycleRoot); @@ -71,7 +73,7 @@ public Component getFirstComponent(final Container focusCycleRoot) { if (focusCycleRoot == null) { - throw new IllegalArgumentException("focusCycleRoot must not be null"); + throw new IllegalArgumentException(Messages.getString("swing.4E")); //$NON-NLS-1$ } ((LayoutComparator)getComparator()).setOrientation(focusCycleRoot.getComponentOrientation()); return super.getFirstComponent(focusCycleRoot); @@ -133,7 +135,7 @@ return TRCompare(c1, c2); } - throw new IllegalStateException("Cannot happen"); + throw new IllegalStateException(Messages.getString("swing.50")); //$NON-NLS-1$ } private int LTCompare(final Component c1, final Component c2) { Index: modules/swing/src/main/java/common/javax/swing/JOptionPane.java =================================================================== --- modules/swing/src/main/java/common/javax/swing/JOptionPane.java (revision 512762) +++ modules/swing/src/main/java/common/javax/swing/JOptionPane.java (working copy) @@ -39,7 +39,9 @@ import org.apache.harmony.x.swing.Utilities; +import org.apache.harmony.x.swing.internal.nls.Messages; + public class JOptionPane extends JComponent implements Accessible { protected class AccessibleJOptionPane extends AccessibleJComponent { @@ -400,7 +402,7 @@ JDesktopPane desktop = JOptionPane.getDesktopPaneForComponent(parentComponent); Container parent = (desktop != null) ? desktop : parentComponent.getParent(); if (parent == null) { - throw new RuntimeException("JOptionPane: parentComponent does not have a valid parent"); + throw new RuntimeException(Messages.getString("swing.1E","JOptionPane")); //$NON-NLS-1$ //$NON-NLS-2$ } JInternalFrame frame = new JInternalFrame(title); @@ -512,10 +514,10 @@ firePropertyChange(MESSAGE_TYPE_PROPERTY, oldValue, type); break; default: - throw new RuntimeException("JOptionPane: type must be one of " + - "JOptionPane.ERROR_MESSAGE, JOptionPane.INFORMATION_MESSAGE, " + - "JOptionPane.WARNING_MESSAGE, JOptionPane.QUESTION_MESSAGE " + - "or JOptionPane.PLAIN_MESSAGE"); + throw new RuntimeException(Messages.getString("swing.1F","JOptionPane") + //$NON-NLS-1$ //$NON-NLS-2$ + "JOptionPane.ERROR_MESSAGE, JOptionPane.INFORMATION_MESSAGE, " + //$NON-NLS-1$ + "JOptionPane.WARNING_MESSAGE, JOptionPane.QUESTION_MESSAGE " + //$NON-NLS-1$ + "or JOptionPane.PLAIN_MESSAGE"); //$NON-NLS-1$ } } @@ -534,7 +536,7 @@ firePropertyChange(OPTION_TYPE_PROPERTY, oldValue, newType); break; default: - throw new RuntimeException("Illegal Option Type"); + throw new RuntimeException(Messages.getString("swing.20")); //$NON-NLS-1$ } } @@ -637,4 +639,4 @@ } dialog.getRootPane().setWindowDecorationStyle(messageTypeToRootPaneDecoration(messageType)); } -} \ No newline at end of file +} Index: modules/swing/src/main/java/common/javax/swing/JToggleButton.java =================================================================== --- modules/swing/src/main/java/common/javax/swing/JToggleButton.java (revision 512762) +++ modules/swing/src/main/java/common/javax/swing/JToggleButton.java (working copy) @@ -27,6 +27,8 @@ import javax.accessibility.AccessibleContext; import javax.accessibility.AccessibleRole; +import org.apache.harmony.x.swing.internal.nls.Messages; + public class JToggleButton extends AbstractButton implements Accessible { // TODO implement @@ -39,7 +41,7 @@ } public void itemStateChanged(final ItemEvent e) { - throw new UnsupportedOperationException("Not yet implemented"); + throw new UnsupportedOperationException(Messages.getString("swing.27")); //$NON-NLS-1$ } }; Index: modules/swing/src/main/java/common/javax/swing/JSpinner.java =================================================================== --- modules/swing/src/main/java/common/javax/swing/JSpinner.java (revision 512762) +++ modules/swing/src/main/java/common/javax/swing/JSpinner.java (working copy) @@ -52,6 +52,8 @@ import org.apache.harmony.x.swing.StringConstants; import org.apache.harmony.x.swing.Utilities; +import org.apache.harmony.x.swing.internal.nls.Messages; + /** *
* JSpinner @@ -340,7 +342,7 @@ public DateEditor(JSpinner spinner) { super(spinner); if (!(spinner.getModel() instanceof SpinnerDateModel)) { - throw new IllegalArgumentException("model not a SpinnerDateModel"); + throw new IllegalArgumentException(Messages.getString("swing.2C","SpinnerDateModel")); //$NON-NLS-1$ //$NON-NLS-2$ } format = new SimpleDateFormat(); initTextField(); @@ -349,7 +351,7 @@ public DateEditor(JSpinner spinner, String dateFormatPattern) { super(spinner); if (!(spinner.getModel() instanceof SpinnerDateModel)) { - throw new IllegalArgumentException("model not a SpinnerDateModel"); + throw new IllegalArgumentException(Messages.getString("swing.2C","SpinnerDateModel")); //$NON-NLS-1$ //$NON-NLS-2$ } format = new SimpleDateFormat(dateFormatPattern); initTextField(); @@ -453,7 +455,7 @@ public ListEditor(JSpinner spinner) { super(spinner); if (!(spinner.getModel() instanceof SpinnerListModel)) { - throw new IllegalArgumentException("model not a SpinnerListModel"); + throw new IllegalArgumentException(Messages.getString("swing.2C","SpinnerListModel")); //$NON-NLS-1$ //$NON-NLS-2$ } SpinnerListFormatter formatter = new SpinnerListFormatter(this.getModel(), this .getTextField()); @@ -514,7 +516,7 @@ public NumberEditor(JSpinner spinner) { super(spinner); if (!(spinner.getModel() instanceof SpinnerNumberModel)) { - throw new IllegalArgumentException("model not a SpinnerNumberModel"); + throw new IllegalArgumentException(Messages.getString("swing.2C","SpinnerNumberModel")); //$NON-NLS-1$ //$NON-NLS-2$ } format = new DecimalFormat(); initTextField(); @@ -523,7 +525,7 @@ public NumberEditor(JSpinner spinner, String decimalFormatPattern) { super(spinner); if (!(spinner.getModel() instanceof SpinnerNumberModel)) { - throw new IllegalArgumentException("model not a SpinnerNumberModel"); + throw new IllegalArgumentException(Messages.getString("swing.2C","SpinnerNumberModel")); //$NON-NLS-1$ //$NON-NLS-2$ } format = new DecimalFormat(decimalFormatPattern); initTextField(); @@ -623,7 +625,7 @@ public void setModel(SpinnerModel model) { if (model == null) { - throw new IllegalArgumentException("null model"); + throw new IllegalArgumentException(Messages.getString("swing.2F")); //$NON-NLS-1$ } SpinnerModel oldModel = this.model; oldModel.removeChangeListener(changeListener); @@ -680,7 +682,7 @@ public void setEditor(JComponent editor) { if (editor == null) { - throw new IllegalArgumentException("null editor"); + throw new IllegalArgumentException(Messages.getString("swing.30")); //$NON-NLS-1$ } JComponent oldEditor = this.editor; if (oldEditor == editor) { Index: modules/swing/src/main/java/common/javax/swing/JEditorPane.java =================================================================== --- modules/swing/src/main/java/common/javax/swing/JEditorPane.java (revision 512762) +++ modules/swing/src/main/java/common/javax/swing/JEditorPane.java (working copy) @@ -57,6 +57,8 @@ import org.apache.harmony.luni.util.NotImplementedException; import org.apache.harmony.x.swing.StringConstants; +import org.apache.harmony.x.swing.internal.nls.Messages; + /** *
* JEditorPane @@ -559,7 +561,7 @@ public final void setContentType(final String type) { if (type == null) { - throw new NullPointerException("Content type is null"); + throw new NullPointerException(Messages.getString("swing.03","Content type")); //$NON-NLS-1$ //$NON-NLS-2$ } int index = contentTypes.indexOf(type); @@ -677,7 +679,7 @@ public void setPage(final URL page) throws IOException { if (page == null) { - throw new IOException("Page is null"); + throw new IOException(Messages.getString("swing.03","Page")); //$NON-NLS-1$ //$NON-NLS-2$ } String url = page.toString(); Index: modules/swing/src/main/java/common/javax/swing/DefaultListSelectionModel.java =================================================================== --- modules/swing/src/main/java/common/javax/swing/DefaultListSelectionModel.java (revision 512762) +++ modules/swing/src/main/java/common/javax/swing/DefaultListSelectionModel.java (working copy) @@ -24,6 +24,8 @@ import javax.swing.event.ListSelectionListener; import org.apache.harmony.awt.gl.MultiRectArea; +import org.apache.harmony.x.swing.internal.nls.Messages; + /** *
* DefaultListSelectionModel @@ -326,7 +328,7 @@ public void setSelectionMode(int selectionMode) { if (selectionMode != SINGLE_SELECTION && selectionMode != SINGLE_INTERVAL_SELECTION && selectionMode != MULTIPLE_INTERVAL_SELECTION) { - throw new IllegalArgumentException("Incorrect selection mode is specified"); + throw new IllegalArgumentException(Messages.getString("swing.08")); //$NON-NLS-1$ } this.selectionMode = selectionMode; } Index: modules/swing/src/main/java/common/javax/swing/JFormattedTextField.java =================================================================== --- modules/swing/src/main/java/common/javax/swing/JFormattedTextField.java (revision 512762) +++ modules/swing/src/main/java/common/javax/swing/JFormattedTextField.java (working copy) @@ -41,6 +41,8 @@ import javax.swing.text.NumberFormatter; import javax.swing.text.TextAction; +import org.apache.harmony.x.swing.internal.nls.Messages; + /** *
* JFormattedTextField @@ -455,10 +457,10 @@ public void setFocusLostBehavior(final int behavior) { if (behavior != COMMIT && behavior != COMMIT_OR_REVERT && behavior != PERSIST && behavior != REVERT) { - throw new IllegalArgumentException("setFocusLostBehavior " + "must be one of: " - + "JFormattedTextField.COMMIT, " + "JFormattedTextField.COMMIT_OR_" - + "REVERT, " + "JFormattedTextField.PERSIST " - + "or JFormattedTextField.REVERT"); + throw new IllegalArgumentException("setFocusLostBehavior" + Messages.getString("swing.13") //$NON-NLS-1$ //$NON-NLS-2$ + + "JFormattedTextField.COMMIT, " + "JFormattedTextField.COMMIT_OR_" //$NON-NLS-1$ //$NON-NLS-2$ + + "REVERT, " + "JFormattedTextField.PERSIST " //$NON-NLS-1$ //$NON-NLS-2$ + + "or JFormattedTextField.REVERT"); //$NON-NLS-1$ } focusLostBehaviour = behavior; } @@ -584,4 +586,4 @@ docListener = new DocumentListenerImpl(); } } -} \ No newline at end of file +} Index: modules/swing/src/main/java/common/javax/swing/JTree.java =================================================================== --- modules/swing/src/main/java/common/javax/swing/JTree.java (revision 512762) +++ modules/swing/src/main/java/common/javax/swing/JTree.java (working copy) @@ -73,6 +73,8 @@ import javax.swing.tree.TreeSelectionModel; import org.apache.harmony.luni.util.NotImplementedException; +import org.apache.harmony.x.swing.internal.nls.Messages; + /** *
* JTree
@@ -1007,7 +1009,7 @@
public TreePath nextElement() {
if (nextElement == null) {
- throw new NoSuchElementException("No next element in enumeration");
+ throw new NoSuchElementException(Messages.getString("swing.4B")); //$NON-NLS-1$
}
TreePath currentValue = nextElement;
nextElement = getNextExpandedPath();
@@ -1317,11 +1319,10 @@
public TreePath getNextMatch(String prefix, int startingRow, Position.Bias bias) {
if (prefix == null) {
- throw new IllegalArgumentException("Prefix must be specified");
+ throw new IllegalArgumentException(Messages.getString("swing.4C")); //$NON-NLS-1$
}
if (startingRow < 0 || startingRow >= getRowCount()) {
- throw new IllegalArgumentException(
- "Illegal startingRow is specified. Must be in the valid range");
+ throw new IllegalArgumentException(Messages.getString("swing.2D")); //$NON-NLS-1$
}
if (bias == Position.Bias.Forward) {
int rowCount = getRowCount();
@@ -1440,7 +1441,7 @@
public TreePath nextElement() {
if (nextElement == null) {
- throw new NoSuchElementException("No next element in enumeration");
+ throw new NoSuchElementException(Messages.getString("swing.4B")); //$NON-NLS-1$
}
TreePath currentValue = nextElement;
nextElement = getNextDescendPath();
Index: modules/swing/src/main/java/common/javax/swing/JScrollPane.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/JScrollPane.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/JScrollPane.java (working copy)
@@ -42,7 +42,9 @@
import org.apache.harmony.x.swing.StringConstants;
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
public class JScrollPane extends JComponent implements ScrollPaneConstants, Accessible {
//TODO: implement
protected class AccessibleJScrollPane extends AccessibleJComponent implements ChangeListener, PropertyChangeListener {
@@ -184,7 +186,7 @@
&& policy != VERTICAL_SCROLLBAR_NEVER
&& policy != VERTICAL_SCROLLBAR_ALWAYS) {
- throw new IllegalArgumentException("Incorrect vertical policy is psecified");
+ throw new IllegalArgumentException(Messages.getString("swing.25")); //$NON-NLS-1$
}
if (this.verticalScrollBarPolicy != policy) {
int oldValue = this.verticalScrollBarPolicy;
@@ -202,7 +204,7 @@
&& policy != HORIZONTAL_SCROLLBAR_NEVER
&& policy != HORIZONTAL_SCROLLBAR_ALWAYS) {
- throw new IllegalArgumentException("Incorrect vertical policy is specified");
+ throw new IllegalArgumentException(Messages.getString("swing.25")); //$NON-NLS-1$
}
if (this.horizontalScrollBarPolicy != policy) {
int oldValue = this.horizontalScrollBarPolicy;
@@ -399,7 +401,7 @@
upperRight = corner;
updateComponent(JScrollPane.UPPER_RIGHT_CORNER, oldValue, corner, JScrollPane.UPPER_RIGHT_CORNER);
} else {
- throw new IllegalArgumentException("Incorrect key " + key + " is invalid");
+ throw new IllegalArgumentException(Messages.getString("swing.26", key)); //$NON-NLS-1$
}
}
Index: modules/swing/src/main/java/common/javax/swing/tree/FixedHeightLayoutCache.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/tree/FixedHeightLayoutCache.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/tree/FixedHeightLayoutCache.java (working copy)
@@ -25,6 +25,8 @@
import javax.swing.event.TreeModelEvent;
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
public class FixedHeightLayoutCache extends AbstractLayoutCache {
public FixedHeightLayoutCache() {
setRowHeight(1);
@@ -32,7 +34,7 @@
public void setRowHeight(final int rowHeight) {
if (rowHeight <= 0) {
- throw new IllegalArgumentException("row height must be positive value");
+ throw new IllegalArgumentException(Messages.getString("swing.97")); //$NON-NLS-1$
}
super.setRowHeight(rowHeight);
}
Index: modules/swing/src/main/java/common/javax/swing/tree/TreePath.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/tree/TreePath.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/tree/TreePath.java (working copy)
@@ -24,7 +24,9 @@
import org.apache.harmony.x.swing.Utilities;
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
public class TreePath implements Serializable {
private Object[] elements;
@@ -33,7 +35,7 @@
public TreePath(final Object[] path) {
if (Utilities.isEmptyArray(path)) {
- throw new IllegalArgumentException("path in TreePath must be not null and not empty");
+ throw new IllegalArgumentException(Messages.getString("swing.82")); //$NON-NLS-1$
}
pathCount = path.length;
@@ -44,7 +46,7 @@
public TreePath(final Object singlePath) {
if (singlePath == null) {
- throw new IllegalArgumentException("path in TreePath must not be null");
+ throw new IllegalArgumentException(Messages.getString("swing.76")); //$NON-NLS-1$
}
elements = new Object[] {singlePath};
pathCount = 1;
@@ -66,7 +68,7 @@
protected TreePath(final TreePath parentPath, final Object lastElement) {
if (lastElement == null) {
- throw new IllegalArgumentException("path in TreePath must not be null.");
+ throw new IllegalArgumentException(Messages.getString("swing.76")); //$NON-NLS-1$
}
elements = new Object[] {lastElement};
@@ -129,7 +131,7 @@
public Object getPathComponent(final int element) {
final int pathCount = getPathCount();
if (element < 0 || element >= pathCount) {
- throw new IllegalArgumentException("Index " + element + " is out of the specified range");
+ throw new IllegalArgumentException(Messages.getString("swing.75", element)); //$NON-NLS-1$
}
if (parent == null) {
return elements[element];
@@ -164,7 +166,7 @@
public TreePath pathByAddingChild(final Object child) {
if (child == null) {
- throw new NullPointerException("Null child not allowed");
+ throw new NullPointerException(Messages.getString("swing.72")); //$NON-NLS-1$
}
return new TreePath(this, child);
@@ -188,4 +190,4 @@
return "[" + result + "]";
}
-}
\ No newline at end of file
+}
Index: modules/swing/src/main/java/common/javax/swing/tree/DefaultMutableTreeNode.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/tree/DefaultMutableTreeNode.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/tree/DefaultMutableTreeNode.java (working copy)
@@ -28,6 +28,8 @@
import java.util.NoSuchElementException;
import java.util.Vector;
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
public class DefaultMutableTreeNode implements Cloneable, MutableTreeNode, Serializable {
public static final Enumeration
* Timer
@@ -109,7 +111,7 @@
public void setInitialDelay(final int initialDelay) {
if (initialDelay < 0) {
- throw new IllegalArgumentException("Invalid initial delay: " + initialDelay);
+ throw new IllegalArgumentException(Messages.getString("swing.63", initialDelay)); //$NON-NLS-1$
}
this.initialDelay = initialDelay;
}
@@ -120,7 +122,7 @@
public void setDelay(final int delay) {
if (delay < 0) {
- throw new IllegalArgumentException("Invalid delay: " + delay);
+ throw new IllegalArgumentException(Messages.getString("swing.64", delay)); //$NON-NLS-1$
}
this.delay = delay;
}
@@ -209,4 +211,4 @@
private static int getPositiveDelay(final int d) {
return (d > 0) ? d : 1;
}
-}
\ No newline at end of file
+}
Index: modules/swing/src/main/java/common/javax/swing/ComponentInputMap.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/ComponentInputMap.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/ComponentInputMap.java (working copy)
@@ -17,6 +17,8 @@
package javax.swing;
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
/**
*
* ComponentInputMap
@@ -34,8 +36,7 @@
public ComponentInputMap(JComponent component) {
if (component == null) {
- throw new IllegalArgumentException(
- "ComponentInputMaps must be associated with a non-null JComponent");
+ throw new IllegalArgumentException(Messages.getString("swing.57")); //$NON-NLS-1$
}
this.component = component;
}
@@ -63,8 +64,7 @@
if (parent != null
&& (!(parent instanceof ComponentInputMap) || (((ComponentInputMap) parent)
.getComponent() != component))) {
- throw new IllegalArgumentException(
- "ComponentInputMap must have a ComponentInputMap parent associated with the same component");
+ throw new IllegalArgumentException(Messages.getString("swing.4D")); //$NON-NLS-1$
}
super.setParent(parent);
if (component != null) {
Index: modules/swing/src/main/java/common/javax/swing/DefaultBoundedRangeModel.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/DefaultBoundedRangeModel.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/DefaultBoundedRangeModel.java (working copy)
@@ -22,6 +22,8 @@
import javax.swing.event.ChangeListener;
import javax.swing.event.EventListenerList;
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
/**
*
* DefaultBoundedRangeModel
@@ -57,7 +59,7 @@
public DefaultBoundedRangeModel(int value, int extent, int min, int max) {
if (min > value || value > value + extent || value + extent > max) {
- throw new IllegalArgumentException("invalid range properties");
+ throw new IllegalArgumentException(Messages.getString("swing.07")); //$NON-NLS-1$
}
this.min = min;
this.max = max;
Index: modules/swing/src/main/java/common/javax/swing/BoxLayout.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/BoxLayout.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/BoxLayout.java (working copy)
@@ -24,6 +24,8 @@
import java.awt.LayoutManager2;
import java.io.Serializable;
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
public class BoxLayout implements LayoutManager2, Serializable {
private static final long serialVersionUID = -2474455742719112368L;
@@ -119,7 +121,7 @@
: LayoutParameters.HORIZONTAL_ALIGNMENT;
}
} else {
- throw new AWTError("Invalid axis");
+ throw new AWTError(Messages.getString("swing.err.04")); //$NON-NLS-1$
}
return alignment;
}
@@ -131,7 +133,7 @@
*/
private void checkTarget(final Container target) {
if (this.target != target) {
- throw new AWTError("BoxLayout should be used for one container only");
+ throw new AWTError(Messages.getString("swing.err.02")); //$NON-NLS-1$
}
}
}
Index: modules/swing/src/main/java/common/javax/swing/ScrollPaneLayout.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/ScrollPaneLayout.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/ScrollPaneLayout.java (working copy)
@@ -125,7 +125,7 @@
if (x != ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED &&
x != ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS &&
x != ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER) {
- throw new IllegalArgumentException(Messages.getString("swing.02"));
+ throw new IllegalArgumentException(Messages.getString("swing.02","verticalScrollBarPolicy")); //$NON-NLS-1$ //$NON-NLS-2$
}
vsbPolicy = x;
}
@@ -138,7 +138,7 @@
if (x != ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED &&
x != ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER &&
x != ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS) {
- throw new IllegalArgumentException(Messages.getString("swing.03"));
+ throw new IllegalArgumentException(Messages.getString("swing.02","horizontalScrollBarPolicy")); //$NON-NLS-1$ //$NON-NLS-2$
}
hsbPolicy = x;
}
Index: modules/swing/src/main/java/common/javax/swing/JTextField.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/JTextField.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/JTextField.java (working copy)
@@ -49,6 +49,8 @@
import org.apache.harmony.awt.text.PropertyNames;
import org.apache.harmony.awt.text.TextFieldKit;
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
/**
* Note:
* DefaultFormatter
@@ -280,7 +282,7 @@
}
Object result = stringToValue(string, valueClass);
if (result == null) {
- throw new ParseException("Error creating instance", 0);
+ throw new ParseException(Messages.getString("swing.86"), 0); //$NON-NLS-1$
}
return result;
}
@@ -333,3 +335,4 @@
}
}
+
Index: modules/swing/src/main/java/common/javax/swing/text/ContentPositions.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/text/ContentPositions.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/text/ContentPositions.java (working copy)
@@ -29,6 +29,8 @@
import java.util.List;
import java.util.Vector;
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
abstract class ContentPositions {
public final class DocumentMark implements Position, Comparable {
protected int index;
@@ -131,7 +133,7 @@
throws BadLocationException {
if (offset < 0) {
- throw new BadLocationException("Invalid position offset", offset);
+ throw new BadLocationException(Messages.getString("swing.85"), offset); //$NON-NLS-1$
}
return new WeakPosition(offset);
Index: modules/swing/src/main/java/common/javax/swing/text/StyledEditorKit.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/text/StyledEditorKit.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/text/StyledEditorKit.java (working copy)
@@ -26,6 +26,8 @@
import org.apache.harmony.awt.text.TextUtils;
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
/**
*
* StyledEditorKit
@@ -294,7 +296,7 @@
static final class ViewFactoryImpl implements ViewFactory {
public View create(final Element element) {
// if (true) {
-// throw new UnsupportedOperationException("Not implemented");
+// throw new UnsupportedOperationException(Messages.getString("swing.27")); //$NON-NLS-1$
// }
// return null;
//This code committed-out temporarily (while these views is not
@@ -493,3 +495,4 @@
}
}
+
Index: modules/swing/src/main/java/common/javax/swing/text/CompositeView.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/text/CompositeView.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/text/CompositeView.java (working copy)
@@ -27,7 +27,9 @@
import org.apache.harmony.awt.text.TextUtils;
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
public abstract class CompositeView extends View {
private View[] children;
private final Rectangle rect = new Rectangle();
@@ -125,8 +127,7 @@
getChildAllocation(index, shape), bias);
}
- throw new BadLocationException("View representing " + pos
- + " not found", pos);
+ throw new BadLocationException(Messages.getString("swing.83", pos), pos); //$NON-NLS-1$
}
@Override
@@ -137,14 +138,12 @@
// TODO should throw IllegalArgumentException for invalid bias arg
int index1 = getViewIndex(p1, b1);
if (index1 == -1) {
- throw new BadLocationException("View representing " + p1
- + " not found", p1);
+ throw new BadLocationException(Messages.getString("swing.83", p1), p1); //$NON-NLS-1$
}
int index2 = getViewIndex(p2, b2);
if (index2 == -1) {
- throw new BadLocationException("View representing " + p2
- + " not found", p2);
+ throw new BadLocationException(Messages.getString("swing.83", p2), p2); //$NON-NLS-1$
}
Rectangle rc1;
@@ -220,7 +219,7 @@
direction, biasRet);
}
- throw new IllegalArgumentException("Invalid direction");
+ throw new IllegalArgumentException(Messages.getString("swing.84")); //$NON-NLS-1$
}
protected void loadChildren(final ViewFactory factory) {
@@ -329,7 +328,7 @@
biasRet);
}
- throw new IllegalArgumentException("Invalid direction");
+ throw new IllegalArgumentException(Messages.getString("swing.84")); //$NON-NLS-1$
}
protected int getNextNorthSouthVisualPositionFrom(final int pos,
@@ -346,7 +345,7 @@
biasRet);
}
- throw new IllegalArgumentException("Invalid direction");
+ throw new IllegalArgumentException(Messages.getString("swing.84")); //$NON-NLS-1$
}
protected boolean flipEastAndWestAtEnds(final int position,
Index: modules/swing/src/main/java/common/javax/swing/text/PlainView.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/text/PlainView.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/text/PlainView.java (working copy)
@@ -33,6 +33,7 @@
import org.apache.harmony.awt.text.TextKit;
import org.apache.harmony.awt.text.TextUtils;
+import org.apache.harmony.x.swing.internal.nls.Messages;
public class PlainView extends View implements TabExpander {
protected FontMetrics metrics;
@@ -59,7 +60,7 @@
return metrics.getHeight() * getElement().getElementCount();
default:
- throw new IllegalArgumentException("Invalid axis (" + axis + ")");
+ throw new IllegalArgumentException(Messages.getString("swing.00", axis)); //$NON-NLS-1$
}
}
@@ -91,7 +92,7 @@
throws BadLocationException {
if (pos < 0 || pos > getDocument().getLength() + 1) {
- throw new BadLocationException("Invalid position", pos);
+ throw new BadLocationException(Messages.getString("swing.98"), pos); //$NON-NLS-1$
}
final int lineNo = getElement().getElementIndex(pos);
Index: modules/swing/src/main/java/common/javax/swing/UIManager.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/UIManager.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/UIManager.java (working copy)
@@ -39,6 +39,8 @@
import org.apache.harmony.x.swing.Utilities;
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
/**
*
* UIManager
@@ -243,7 +245,7 @@
return;
}
if (!laf.isSupportedLookAndFeel()) {
- throw new UnsupportedLookAndFeelException(laf + " is not supported on this platform.");
+ throw new UnsupportedLookAndFeelException(Messages.getString("swing.2E",laf)); //$NON-NLS-1$
}
LookAndFeel oldValue = lookAndFeel;
if (lookAndFeel != null) {
@@ -458,3 +460,4 @@
}
}
+
Index: modules/swing/src/main/java/common/javax/swing/JSplitPane.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/JSplitPane.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/JSplitPane.java (working copy)
@@ -32,6 +32,8 @@
import javax.accessibility.AccessibleValue;
import javax.swing.plaf.SplitPaneUI;
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
public class JSplitPane extends JComponent implements Accessible {
public static final String BOTTOM = "bottom";
public static final String TOP = "top";
@@ -52,27 +54,27 @@
protected class AccessibleJSplitPane extends AccessibleJComponent implements AccessibleValue {
public AccessibleStateSet getAccessibleStateSet() {
- throw new UnsupportedOperationException("Not implemented yet");
+ throw new UnsupportedOperationException(Messages.getString("swing.27")); //$NON-NLS-1$
}
public AccessibleValue getAccessibleValue() {
- throw new UnsupportedOperationException("Not implemented yet");
+ throw new UnsupportedOperationException(Messages.getString("swing.27")); //$NON-NLS-1$
}
public Number getCurrentAccessibleValue() {
- throw new UnsupportedOperationException("Not implemented yet");
+ throw new UnsupportedOperationException(Messages.getString("swing.27")); //$NON-NLS-1$
}
public boolean setCurrentAccessibleValue(final Number n) {
- throw new UnsupportedOperationException("Not implemented yet");
+ throw new UnsupportedOperationException(Messages.getString("swing.27")); //$NON-NLS-1$
}
public Number getMinimumAccessibleValue() {
- throw new UnsupportedOperationException("Not implemented yet");
+ throw new UnsupportedOperationException(Messages.getString("swing.27")); //$NON-NLS-1$
}
public Number getMaximumAccessibleValue() {
- throw new UnsupportedOperationException("Not implemented yet");
+ throw new UnsupportedOperationException(Messages.getString("swing.27")); //$NON-NLS-1$
}
public AccessibleRole getAccessibleRole() {
@@ -240,7 +242,7 @@
public void setResizeWeight(final double weight) {
if (weight < 0 || weight > 1) {
- throw new IllegalArgumentException("Incorrect resize weight is specified");
+ throw new IllegalArgumentException(Messages.getString("swing.32")); //$NON-NLS-1$
}
if (resizeWeight != weight) {
double oldValue = resizeWeight;
@@ -259,7 +261,7 @@
public void setDividerLocation(final double proportionalLocation) {
if (proportionalLocation < 0 || proportionalLocation > 1) {
- throw new IllegalArgumentException("Incorrect proportional location is specified");
+ throw new IllegalArgumentException(Messages.getString("swing.33")); //$NON-NLS-1$
}
int size;
@@ -375,7 +377,7 @@
private void checkOrientation(final int orientation) {
if (orientation != HORIZONTAL_SPLIT && orientation != VERTICAL_SPLIT) {
- throw new IllegalArgumentException("Incorrect orientation is specified");
+ throw new IllegalArgumentException(Messages.getString("swing.1B")); //$NON-NLS-1$
}
}
Index: modules/swing/src/main/java/common/javax/swing/JComponent.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/JComponent.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/JComponent.java (working copy)
@@ -82,6 +82,7 @@
import javax.swing.plaf.ComponentUI;
import org.apache.harmony.awt.ClipRegion;
import org.apache.harmony.awt.gl.MultiRectArea;
+import org.apache.harmony.x.swing.internal.nls.Messages;
import org.apache.harmony.x.swing.StringConstants;
import org.apache.harmony.x.swing.Utilities;
@@ -681,8 +682,7 @@
public final void setInputMap(int condition, InputMap map) {
if (condition == WHEN_IN_FOCUSED_WINDOW && !(map instanceof ComponentInputMap)
&& map != null) {
- throw new IllegalArgumentException("For WHEN_IN_FOCUSED_WINDOW condition "
- + "ComponentInputMap has to be provided");
+ throw new IllegalArgumentException(Messages.getString("swing.0D","WHEN_IN_FOCUSED_WINDOW")); //$NON-NLS-1$ //$NON-NLS-2$
}
if (condition < FIRST_INPUT_MAP_INDEX || condition > LAST_INPUT_MAP_INDEX) {
throw new IllegalArgumentException(ILLEGAL_CONDITION_MESSAGE);
Index: modules/swing/src/main/java/common/javax/swing/OverlayLayout.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/OverlayLayout.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/OverlayLayout.java (working copy)
@@ -27,6 +27,8 @@
import java.awt.LayoutManager2;
import java.io.Serializable;
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
public class OverlayLayout implements LayoutManager2, Serializable {
private final Container target;
@@ -101,9 +103,10 @@
*/
private void checkTarget(final Container target) {
if (this.target != target) {
- throw new AWTError("OverlayLayout can't be shared");
+ throw new AWTError(Messages.getString("swing.err.03")); //$NON-NLS-1$
}
}
}
+
Index: modules/swing/src/main/java/common/javax/swing/SwingUtilities.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/SwingUtilities.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/SwingUtilities.java (working copy)
@@ -47,7 +47,9 @@
import org.apache.harmony.x.swing.Utilities;
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
public class SwingUtilities implements SwingConstants {
private static final Rectangle auxRect = new Rectangle();
@@ -116,14 +118,14 @@
public static void convertPointToScreen(final Point point, final Component component) {
if (component == null) {
- throw new NullPointerException("Cannot convert point from null-component");
+ throw new NullPointerException(Messages.getString("swing.61")); //$NON-NLS-1$
}
translateRelatedPoint(point, component, 1, false);
}
public static void convertPointFromScreen(final Point point, final Component component) {
if (component == null) {
- throw new NullPointerException("Cannot convert point to null-component");
+ throw new NullPointerException(Messages.getString("swing.62")); //$NON-NLS-1$
}
translateRelatedPoint(point, component, -1, false);
}
Index: modules/swing/src/main/java/common/javax/swing/BequestedFocusTraversalPolicy.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/BequestedFocusTraversalPolicy.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/BequestedFocusTraversalPolicy.java (working copy)
@@ -21,6 +21,8 @@
import java.awt.Container;
import java.awt.FocusTraversalPolicy;
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
class BequestedFocusTraversalPolicy extends FocusTraversalPolicy {
private final FocusTraversalPolicy ancestor;
@@ -41,7 +43,7 @@
super();
this.ancestor = ancestor;
if (this.ancestor == null) {
- throw new IllegalArgumentException("Ancestor shouldn't be null");
+ throw new IllegalArgumentException(Messages.getString("swing.06")); //$NON-NLS-1$
}
this.fixedComponent = fixedComponent;
this.fixedNextComponent = fixedNextComponent;
Index: modules/swing/src/main/java/common/javax/swing/border/TitledBorder.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/border/TitledBorder.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/border/TitledBorder.java (working copy)
@@ -36,7 +36,9 @@
import org.apache.harmony.awt.gl.MultiRectArea;
import org.apache.harmony.x.swing.Utilities;
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
public class TitledBorder extends AbstractBorder {
public static final int DEFAULT_POSITION = 0;
@@ -284,7 +286,7 @@
public void setTitlePosition(final int pos) {
if (pos < DEFAULT_POSITION || BELOW_BOTTOM < pos) {
- throw new IllegalArgumentException(pos + " is not a valid title position.");
+ throw new IllegalArgumentException(Messages.getString("swing.24",pos)); //$NON-NLS-1$
}
titlePosition = pos;
}
@@ -295,7 +297,7 @@
public void setTitleJustification(final int justification) {
if (justification < DEFAULT_JUSTIFICATION || TRAILING < justification) {
- throw new IllegalArgumentException(justification + " is not a valid title justification.");
+ throw new IllegalArgumentException(Messages.getString("swing.23",justification)); //$NON-NLS-1$
}
titleJustification = justification;
}
Index: modules/swing/src/main/java/common/javax/swing/border/EtchedBorder.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/border/EtchedBorder.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/border/EtchedBorder.java (working copy)
@@ -26,6 +26,8 @@
import java.awt.Insets;
import java.security.InvalidParameterException;
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
public class EtchedBorder extends AbstractBorder {
public static final int RAISED = 0;
@@ -36,7 +38,7 @@
protected Color shadow;
private static final int INSETS_SIZE = 2;
- private static final String INCORRECT_BORDER_TYPE_EXCEPTION_TEXT = "Incorrect type of the etched border";
+ private static final String INCORRECT_BORDER_TYPE_EXCEPTION_TEXT = Messages.getString("swing.1D"); //$NON-NLS-1$
public EtchedBorder() {
}
@@ -113,3 +115,4 @@
}
+
Index: modules/swing/src/main/java/common/javax/swing/border/BevelBorder.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/border/BevelBorder.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/border/BevelBorder.java (working copy)
@@ -25,7 +25,9 @@
import java.awt.Graphics;
import java.awt.Insets;
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
public class BevelBorder extends AbstractBorder {
public static final int RAISED = 0;
@@ -49,7 +51,7 @@
if (highlightOuterColor == null || highlightInnerColor == null ||
shadowOuterColor == null || shadowInnerColor == null) {
- throw new NullPointerException("Color should not be null");
+ throw new NullPointerException(Messages.getString("swing.68")); //$NON-NLS-1$
}
highlightOuter = highlightOuterColor;
highlightInner = highlightInnerColor;
@@ -177,4 +179,4 @@
return bevelType;
}
-}
\ No newline at end of file
+}
Index: modules/swing/src/main/java/common/javax/swing/JTable.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/JTable.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/JTable.java (working copy)
@@ -78,6 +78,8 @@
import org.apache.harmony.luni.util.NotImplementedException;
import org.apache.harmony.x.swing.StringConstants;
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
/**
*
* JTable
@@ -857,7 +859,7 @@
public void setRowHeight(int rowHeight) {
if (rowHeight <= 0) {
- throw new IllegalArgumentException("Row height must be positive");
+ throw new IllegalArgumentException(Messages.getString("swing.38")); //$NON-NLS-1$
}
int oldValue = this.rowHeight;
this.rowHeight = rowHeight;
@@ -870,7 +872,7 @@
public void setRowHeight(int row, int height) {
if (height <= 0) {
- throw new IllegalArgumentException("Row height must be positive");
+ throw new IllegalArgumentException(Messages.getString("swing.38")); //$NON-NLS-1$
}
if (rowHeights.size() <= row) {
rowHeights.setSize(row + 1);
@@ -1193,7 +1195,7 @@
public TableColumn getColumn(Object identifier) {
int index = getColumnModel().getColumnIndex(identifier);
if (index == -1) {
- throw new IllegalArgumentException("Column does not exist");
+ throw new IllegalArgumentException(Messages.getString("swing.39")); //$NON-NLS-1$
}
return getColumnModel().getColumn(index);
}
@@ -1435,7 +1437,7 @@
public void setModel(TableModel model) {
if (model == null) {
- throw new IllegalArgumentException("Model must be not null");
+ throw new IllegalArgumentException(Messages.getString("swing.3A")); //$NON-NLS-1$
}
TableModel oldValue = dataModel;
if (oldValue != null) {
@@ -1457,7 +1459,7 @@
public void setColumnModel(TableColumnModel model) {
if (model == null) {
- throw new IllegalArgumentException("Column model must be not null");
+ throw new IllegalArgumentException(Messages.getString("swing.3B")); //$NON-NLS-1$
}
TableColumnModel oldValue = columnModel;
if (oldValue != null) {
@@ -1478,7 +1480,7 @@
public void setSelectionModel(ListSelectionModel model) {
if (model == null) {
- throw new IllegalArgumentException("Selection model must be not null");
+ throw new IllegalArgumentException(Messages.getString("swing.17")); //$NON-NLS-1$
}
ListSelectionModel oldValue = selectionModel;
if (oldValue != null) {
@@ -1870,9 +1872,7 @@
private void checkSelectionInterval(int start, int end, int bound) {
if (start < 0 || end < 0 || start >= bound || end >= bound) {
- throw new IllegalArgumentException(
- "Illegal selection interval is specified. Should be in [0, " + (bound - 1)
- + "]");
+ throw new IllegalArgumentException(Messages.getString("swing.31", (bound - 1))); //$NON-NLS-1$
}
}
Index: modules/swing/src/main/java/common/javax/swing/UIDefaults.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/UIDefaults.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/UIDefaults.java (working copy)
@@ -44,6 +44,8 @@
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.UIResource;
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
public class UIDefaults extends HashtableserialVersionUID fields in this class and its inner
* classes are added as a performance optimization but not as a guarantee of
@@ -200,7 +202,7 @@
public JTextField(final Document doc, final String text, final int c) {
super();
if (c < 0) {
- throw new IllegalArgumentException("columns less than zero.");
+ throw new IllegalArgumentException(Messages.getString("swing.45")); //$NON-NLS-1$
}
Document document = doc;
if (doc == null) {
@@ -455,7 +457,7 @@
public void setColumns(final int c) {
if (c < 0) {
- throw new IllegalArgumentException("columns less than zero.");
+ throw new IllegalArgumentException(Messages.getString("swing.45")); //$NON-NLS-1$
}
columns = c;
invalidate();
@@ -480,7 +482,7 @@
public void setHorizontalAlignment(final int alignment) {
if (alignment != LEFT && alignment != RIGHT && alignment != CENTER
&& alignment != LEADING && alignment != TRAILING) {
- throw new IllegalArgumentException("horizontalAlignment");
+ throw new IllegalArgumentException("horizontalAlignment"); //$NON-NLS-1$
}
int old = horizontalAlignment;
horizontalAlignment = alignment;
@@ -495,4 +497,4 @@
getHorizontalVisibility().setValue(scrollOffset);
}
-}
\ No newline at end of file
+}
Index: modules/swing/src/main/java/common/javax/swing/text/ParagraphView.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/text/ParagraphView.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/text/ParagraphView.java (working copy)
@@ -29,7 +29,9 @@
import org.apache.harmony.awt.text.TextUtils;
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
public class ParagraphView extends FlowView implements TabExpander {
private static final int DEFAULT_TAB = 72;
private static final int MIN_TEXT_CHUNK = 10;
@@ -269,7 +271,7 @@
final int rowIndex,
final int x)
throws BadLocationException {
- throw new UnsupportedOperationException("Not implemented");
+ throw new UnsupportedOperationException(Messages.getString("swing.27")); //$NON-NLS-1$
}
protected float getPartialSize(final int startOffset,
@@ -341,7 +343,7 @@
final Bias[] biasRet)
throws BadLocationException {
if (true) {
- throw new UnsupportedOperationException("Not implemented");
+ throw new UnsupportedOperationException(Messages.getString("swing.27")); //$NON-NLS-1$
}
return TextUtils.getNextVisualPositionFrom(getTextKit(), this,
pos, b, a,
@@ -350,7 +352,7 @@
protected boolean flipEastAndWestAtEnds(final int position,
final Bias bias) {
- throw new UnsupportedOperationException("Not implemented");
+ throw new UnsupportedOperationException(Messages.getString("swing.27")); //$NON-NLS-1$
}
protected TabSet getTabSet() {
Index: modules/swing/src/main/java/common/javax/swing/text/StringContent.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/text/StringContent.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/text/StringContent.java (working copy)
@@ -29,11 +29,12 @@
import javax.swing.text.AbstractDocument.Content;
import javax.swing.undo.UndoableEdit;
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
public final class StringContent
implements Content, Serializable {
- private static final String INVALID_START_POSITION_MESSAGE =
- "Invalid start position";
+ private static final String INVALID_START_POSITION_MESSAGE = Messages.getString("swing.0F"); //$NON-NLS-1$
private final class StringContentEdit
extends AbstractContentUndoableEdit implements UndoableEdit {
@@ -160,8 +161,7 @@
private void checkInvalidOnRemove(final int where, final int nitems)
throws BadLocationException {
if (nitems < 0) {
- throw new BadLocationException("The number of characters to remove "
- + "must be non-negative",
+ throw new BadLocationException(Messages.getString("swing.99"), //$NON-NLS-1$
length);
}
@@ -174,7 +174,7 @@
private void checkInvalidOnGetChars(final int where, final int len)
throws BadLocationException {
if (len < 0) {
- throw new BadLocationException("Length must be non-negative",
+ throw new BadLocationException(Messages.getString("swing.8C"), //$NON-NLS-1$
length);
}
@@ -271,4 +271,4 @@
private void writeObject(final ObjectOutputStream oos) throws IOException {
oos.defaultWriteObject();
}
-}
\ No newline at end of file
+}
Index: modules/swing/src/main/java/common/javax/swing/text/Segment.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/text/Segment.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/text/Segment.java (working copy)
@@ -18,6 +18,8 @@
import java.text.CharacterIterator;
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
public class Segment implements Cloneable, CharacterIterator {
public char[] array;
@@ -121,7 +123,7 @@
public char setIndex(final int position) {
if (position < 0 || position > offset + count) {
- throw new IllegalArgumentException("invalid position: " + position);
+ throw new IllegalArgumentException(Messages.getString("swing.89", position)); //$NON-NLS-1$
}
pos = position;
Index: modules/swing/src/main/java/common/javax/swing/text/AbstractDocument.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/text/AbstractDocument.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/text/AbstractDocument.java (working copy)
@@ -51,7 +51,9 @@
import org.apache.harmony.awt.text.TextUtils;
import org.apache.harmony.x.swing.StringConstants;
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
public abstract class AbstractDocument implements Document, Serializable {
public abstract class AbstractElement
@@ -878,8 +880,7 @@
public final synchronized void writeLock() {
if (callingListeners) {
- throw new IllegalStateException("Document cannot be modified "
- + "from listener handler");
+ throw new IllegalStateException(Messages.getString("swing.7E")); //$NON-NLS-1$
}
final Thread thread = Thread.currentThread();
@@ -1368,11 +1369,11 @@
}
if (offset < 0 || offset > getLength()) {
- throw new BadLocationException("Invalid remove position", offset);
+ throw new BadLocationException(Messages.getString("swing.7F"), offset); //$NON-NLS-1$
}
if (offset + length > getLength()) {
- throw new BadLocationException("Invalid remove length",
+ throw new BadLocationException(Messages.getString("swing.80"), //$NON-NLS-1$
offset + length);
}
Index: modules/swing/src/main/java/common/javax/swing/text/InternationalFormatter.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/text/InternationalFormatter.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/text/InternationalFormatter.java (working copy)
@@ -34,8 +34,10 @@
import org.apache.harmony.awt.text.TextUtils;
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
public class InternationalFormatter extends DefaultFormatter {
private static final String DECREMENT_ACTION_NAME = "decrement";
private static final String INCREMENT_ACTION_NAME = "increment";
@@ -179,7 +181,7 @@
}
if (!checkRange(result)) {
- throw new ParseException("the value is outside the min/max ", 0);
+ throw new ParseException(Messages.getString("swing.8F"), 0); //$NON-NLS-1$
}
return result;
}
@@ -217,3 +219,4 @@
}
}
+
Index: modules/swing/src/main/java/common/javax/swing/text/PasswordView.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/text/PasswordView.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/text/PasswordView.java (working copy)
@@ -29,7 +29,9 @@
import org.apache.harmony.awt.text.TextFieldKit;
import org.apache.harmony.awt.text.TextUtils;
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
public class PasswordView extends FieldView {
private static final char DEFAULT_ECHO_CHAR = '*';
@@ -82,7 +84,7 @@
if (echoCharIsSet()) {
String text = getText();
if (pos < 0 || pos > text.length()) {
- throw new BadLocationException("incorrect position: " + pos,
+ throw new BadLocationException(Messages.getString("swing.95", pos), //$NON-NLS-1$
pos);
}
if (shape == null) {
@@ -151,9 +153,9 @@
final int y) throws BadLocationException {
int length = getTextLength();
if (p0 < 0) {
- throw new BadLocationException("incorrect positions: ", p0);
+ throw new BadLocationException(Messages.getString("swing.96"), p0); //$NON-NLS-1$
} else if (p1 < p0 || p1 > length) {
- throw new BadLocationException("incorrect positions: ", p1);
+ throw new BadLocationException(Messages.getString("swing.96"), p1); //$NON-NLS-1$
}
Color old = g.getColor();
Index: modules/swing/src/main/java/common/javax/swing/text/PlainViewI18N.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/text/PlainViewI18N.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/text/PlainViewI18N.java (working copy)
@@ -34,7 +34,9 @@
import org.apache.harmony.awt.text.TextKit;
import org.apache.harmony.awt.text.TextUtils;
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
/**
* Represents view for displaying bidirectional text.
*/
@@ -59,7 +61,7 @@
final int end = getEndOffset();
if (pos < start || pos > end) {
- throw new BadLocationException("Invalid position", pos);
+ throw new BadLocationException(Messages.getString("swing.98"), pos); //$NON-NLS-1$
}
getDocument().getText(pos, end - pos, paintParams.buffer);
@@ -160,7 +162,7 @@
final int start = getStartOffset();
if (pos < start || pos > getEndOffset()) {
- throw new BadLocationException("Invalid position", pos);
+ throw new BadLocationException(Messages.getString("swing.98"), pos); //$NON-NLS-1$
}
getDocument().getText(start, pos - start, paintParams.buffer);
Index: modules/swing/src/main/java/common/javax/swing/text/DefaultCaret.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/text/DefaultCaret.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/text/DefaultCaret.java (working copy)
@@ -58,6 +58,8 @@
import org.apache.harmony.awt.text.TextUtils;
import org.apache.harmony.x.swing.StringConstants;
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
public class DefaultCaret extends Rectangle implements Caret, FocusListener,
MouseListener, MouseMotionListener {
@@ -983,7 +985,7 @@
*/
public void setBlinkRate(final int i) {
if (i < 0) {
- throw new IllegalArgumentException("Invalid delay: " + i);
+ throw new IllegalArgumentException(Messages.getString("swing.64", i)); //$NON-NLS-1$
}
blinkRate = i;
stopTimer(blinkTimer);
Index: modules/swing/src/main/java/common/javax/swing/text/DefaultGlyphPainter.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/text/DefaultGlyphPainter.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/text/DefaultGlyphPainter.java (working copy)
@@ -43,6 +43,8 @@
import org.apache.harmony.awt.text.TextKit;
import org.apache.harmony.awt.text.TextUtils;
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
/**
* Default GlyphPainter which is used when a GlyphView needs a painter but
* none was set.
@@ -86,10 +88,7 @@
throws BadLocationException {
if (true) {
- throw new UnsupportedOperationException("Default painter of "
- + "GlyphView can't "
- + "paint composed "
- + "text.");
+ throw new UnsupportedOperationException(Messages.getString("swing.87")); //$NON-NLS-1$
}
return x;
}
@@ -161,8 +160,7 @@
throws BadLocationException {
if (offset < v.getStartOffset() || offset > v.getEndOffset()) {
- throw new BadLocationException("This view doesn't represent "
- + "offset " + offset, offset);
+ throw new BadLocationException(Messages.getString("swing.88", offset), offset); //$NON-NLS-1$
}
final Segment text = v.getText(v.getStartOffset(), offset);
Index: modules/swing/src/main/java/common/javax/swing/text/MaskFormatter.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/text/MaskFormatter.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/text/MaskFormatter.java (working copy)
@@ -28,7 +28,9 @@
import javax.swing.text.DocumentFilter.FilterBypass;
import javax.swing.text.Position.Bias;
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
public class MaskFormatter extends DefaultFormatter {
private String mask;
private String placeholder;
@@ -211,7 +213,7 @@
if (maskLength - escapeLength
- (valueContainsLiteralCharacters ? 0 : literalsLength)
< length) {
- throw new ParseException("Cann't parse value", 0);
+ throw new ParseException(Messages.getString("swing.92"), 0); //$NON-NLS-1$
}
int index = 0;
int maskIndex = 0;
@@ -243,7 +245,7 @@
if (!acceptCharacter(maskCharacter,
textCharacter,
isLiteral)) {
- throw new ParseException("Cann't parse String", index);
+ throw new ParseException(Messages.getString("swing.93"), index); //$NON-NLS-1$
}
}
@@ -300,7 +302,7 @@
int maskLength = mask.length();
int index = 0;
if (maskLength - length != escapeMask.cardinality()) {
- throw new ParseException("stringToValue passed invalid value", 0);
+ throw new ParseException(Messages.getString("swing.94"), 0); //$NON-NLS-1$
}
int accumulator = 0;
String result = "";
@@ -460,3 +462,4 @@
}
}
+
Index: modules/swing/src/main/java/common/javax/swing/text/JTextComponent.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/text/JTextComponent.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/text/JTextComponent.java (working copy)
@@ -92,7 +92,9 @@
import org.apache.harmony.awt.text.TextUtils;
import org.apache.harmony.x.swing.StringConstants;
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
public abstract class JTextComponent extends JComponent implements Scrollable,
Accessible {
@@ -159,8 +161,7 @@
private void checkPositions(final int i1, final int i2,
final int length) {
if (i1 < 0 || i2 < i1 || i2 > length) {
- throw new IllegalArgumentException("Wrong parameters :"
- + i1 + ", " + i2);
+ throw new IllegalArgumentException(Messages.getString("swing.90",i1, i2)); //$NON-NLS-1$
}
}
@@ -1138,8 +1139,7 @@
} else if (orientation == SwingConstants.VERTICAL) {
return rect.height;
} else {
- throw new IllegalArgumentException("Invalid orientation: "
- + orientation);
+ throw new IllegalArgumentException(Messages.getString("swing.41", orientation)); //$NON-NLS-1$
}
}
@@ -1170,8 +1170,7 @@
} else if (orientation == SwingConstants.VERTICAL) {
return rect.height / DEFAULT_UNIT_NUMBER;
} else {
- throw new IllegalArgumentException("Invalid orientation: "
- + orientation);
+ throw new IllegalArgumentException(Messages.getString("swing.41", orientation)); //$NON-NLS-1$
}
}
@@ -1242,7 +1241,7 @@
return;
}
if (pos < 0 || pos > document.getLength()) {
- throw new IllegalArgumentException("bad position: " + pos);
+ throw new IllegalArgumentException(Messages.getString("swing.91", pos)); //$NON-NLS-1$
}
caret.moveDot(pos);
}
@@ -1369,7 +1368,7 @@
return;
}
if (pos < 0 || pos > document.getLength()) {
- throw new IllegalArgumentException("bad position: " + pos);
+ throw new IllegalArgumentException(Messages.getString("swing.91", pos)); //$NON-NLS-1$
}
caret.setDot(pos);
}
Index: modules/swing/src/main/java/common/javax/swing/text/WrappedPlainView.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/text/WrappedPlainView.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/text/WrappedPlainView.java (working copy)
@@ -32,6 +32,8 @@
import org.apache.harmony.awt.text.TextKit;
import org.apache.harmony.awt.text.TextUtils;
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
public class WrappedPlainView extends BoxView implements TabExpander {
private class LineView extends View {
@@ -72,7 +74,7 @@
int end = getEndOffset() - 1;
if (pos < start || pos > end) {
- throw new BadLocationException("Invalid position", pos);
+ throw new BadLocationException(Messages.getString("swing.98"), pos); //$NON-NLS-1$
}
int lineNo = 0;
Index: modules/swing/src/main/java/common/javax/swing/text/DefaultHighlighter.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/text/DefaultHighlighter.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/text/DefaultHighlighter.java (working copy)
@@ -30,8 +30,10 @@
import org.apache.harmony.awt.text.TextKit;
import org.apache.harmony.awt.text.TextUtils;
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
public class DefaultHighlighter extends LayeredHighlighter {
// This vector contains all highlights
@@ -379,10 +381,10 @@
private void checkBoundaries(final int start, final int end)
throws BadLocationException {
if (start < 0) {
- throw new BadLocationException("Invalid position: " + start, end);
+ throw new BadLocationException(Messages.getString("swing.89", start), end); //$NON-NLS-1$
}
if (end < start) {
- throw new BadLocationException("Invalid position: " + start, end);
+ throw new BadLocationException(Messages.getString("swing.89", start), end); //$NON-NLS-1$
}
}
@@ -432,3 +434,4 @@
}
+
Index: modules/swing/src/main/java/common/javax/swing/text/StyleContext.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/text/StyleContext.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/text/StyleContext.java (working copy)
@@ -44,6 +44,8 @@
import javax.swing.event.ChangeListener;
import javax.swing.event.EventListenerList;
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
public class StyleContext
implements Serializable, AbstractDocument.AttributeContext {
@@ -300,9 +302,7 @@
public Object nextElement() {
if (count >= attributes.length) {
- new NoSuchElementException("The enumeration has "
- + "no more elements "
- + "to provide");
+ new NoSuchElementException(Messages.getString("swing.9A")); //$NON-NLS-1$
}
Object next = attributes[count++];
@@ -729,7 +729,7 @@
if (key instanceof Integer) {
count = ((Integer)key).intValue();
} else {
- throw new IOException("No attribute set count field.");
+ throw new IOException(Messages.getString("swing.9B")); //$NON-NLS-1$
}
while (count-- > 0) {
@@ -884,3 +884,4 @@
}
+
Index: modules/swing/src/main/java/common/javax/swing/text/TabSet.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/text/TabSet.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/text/TabSet.java (working copy)
@@ -24,7 +24,9 @@
import org.apache.harmony.misc.HashCode;
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
public class TabSet implements Serializable {
private TabStop[] tabs;
@@ -52,7 +54,7 @@
public TabStop getTab(final int i) {
if (i < 0 || i >= tabs.length) {
- throw new IllegalArgumentException("Invalid tab index " + i);
+ throw new IllegalArgumentException(Messages.getString("swing.9C", i)); //$NON-NLS-1$
}
return tabs[i];
}
@@ -112,3 +114,4 @@
}
}
+
Index: modules/swing/src/main/java/common/javax/swing/text/IconView.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/text/IconView.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/text/IconView.java (working copy)
@@ -29,6 +29,8 @@
import org.apache.harmony.awt.text.TextUtils;
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
public class IconView extends View {
public IconView(final Element element) {
@@ -74,7 +76,7 @@
private void isAxisValid(final int axis) {
if (axis != X_AXIS && axis != Y_AXIS) {
- throw new IllegalArgumentException("Invalid axis: " + axis);
+ throw new IllegalArgumentException(Messages.getString("swing.00", axis)); //$NON-NLS-1$
}
}
- }
\ No newline at end of file
+ }
Index: modules/swing/src/main/java/common/javax/swing/text/BoxView.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/text/BoxView.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/text/BoxView.java (working copy)
@@ -29,6 +29,8 @@
import org.apache.harmony.x.swing.SizeRequirementsHelper;
import org.apache.harmony.x.swing.Utilities;
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
public class BoxView extends CompositeView {
private static final int[] EMPTY_INT_ARRAY = new int[0];
private static final SizeRequirements[] EMPTY_REQUIREMENTS_ARRAY =
@@ -484,7 +486,7 @@
private void isAxisValid(final int axis) {
if (axis != X_AXIS && axis != Y_AXIS) {
- throw new IllegalArgumentException("Invalid axis");
+ throw new IllegalArgumentException(Messages.getString("swing.81")); //$NON-NLS-1$
}
}
Index: modules/swing/src/main/java/common/javax/swing/text/html/MinimalHTMLWriter.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/text/html/MinimalHTMLWriter.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/text/html/MinimalHTMLWriter.java (working copy)
@@ -39,6 +39,8 @@
import javax.swing.text.StyleContext;
import javax.swing.text.StyledDocument;
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
public class MinimalHTMLWriter extends AbstractWriter {
private static final AttributeSet EMPTY_ATTR_SET = new SimpleAttributeSet();
private Vector openEmbeddedTags = new Vector();
@@ -222,7 +224,7 @@
protected void writeStyles() throws IOException {
if (!(getDocument() instanceof DefaultStyledDocument)) {
// XXX: it's not clear what to do in this case
- throw new UnsupportedOperationException("Not implemented");
+ throw new UnsupportedOperationException(Messages.getString("swing.9F")); //$NON-NLS-1$
}
StyledDocument styledDocument = (StyledDocument)getDocument();
Index: modules/swing/src/main/java/common/javax/swing/text/html/CascadedStyle.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/text/html/CascadedStyle.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/text/html/CascadedStyle.java (working copy)
@@ -33,6 +33,8 @@
import javax.swing.text.Style;
import javax.swing.text.StyleConstants;
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
/**
* Storage for all the attributes applicable for the
* {@link javax.swing.text.Element} for which CascadedStyle
@@ -124,27 +126,27 @@
}
public void removeAttribute(final Object arg0) {
-// throw new UnsupportedOperationException("Not implemented yet");
+// throw new UnsupportedOperationException(Messages.getString("swing.27")); //$NON-NLS-1$
}
public void removeAttributes(final Enumeration arg0) {
-// throw new UnsupportedOperationException("Not implemented yet");
+// throw new UnsupportedOperationException(Messages.getString("swing.27")); //$NON-NLS-1$
}
public void addAttributes(final AttributeSet arg0) {
-// throw new UnsupportedOperationException("Not implemented yet");
+// throw new UnsupportedOperationException(Messages.getString("swing.27")); //$NON-NLS-1$
}
public void removeAttributes(final AttributeSet arg0) {
-// throw new UnsupportedOperationException("Not implemented yet");
+// throw new UnsupportedOperationException(Messages.getString("swing.27")); //$NON-NLS-1$
}
public void setResolveParent(final AttributeSet arg0) {
-// throw new UnsupportedOperationException("Not implemented yet");
+// throw new UnsupportedOperationException(Messages.getString("swing.27")); //$NON-NLS-1$
}
public void addAttribute(final Object arg0, final Object arg1) {
-// throw new UnsupportedOperationException("Not implemented yet");
+// throw new UnsupportedOperationException(Messages.getString("swing.27")); //$NON-NLS-1$
}
public int getAttributeCount() {
@@ -223,7 +225,7 @@
}
public AttributeSet copyAttributes() {
- throw new UnsupportedOperationException("Not implemented yet");
+ throw new UnsupportedOperationException(Messages.getString("swing.27")); //$NON-NLS-1$
}
public AttributeSet getResolveParent() {
Index: modules/swing/src/main/java/common/javax/swing/text/html/StyleSheet.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/text/html/StyleSheet.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/text/html/StyleSheet.java (working copy)
@@ -71,6 +71,8 @@
import org.apache.harmony.x.swing.text.html.cssparser.metamodel.RuleSet;
import org.apache.harmony.x.swing.text.html.cssparser.metamodel.Sheet;
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
/**
* Implementation of this class is based on CSS1.
*/
@@ -132,7 +134,7 @@
updateProperties();
if (!(g instanceof Graphics2D)) {
- System.err.println("Graphics is not instance of Graphics2D");
+ System.err.println(Messages.getString("swing.err.09")); //$NON-NLS-1$
}
Graphics2D g2d = (Graphics2D)g;
@@ -307,7 +309,7 @@
return CSS.LEFT_SIDE;
default:
- throw new IllegalArgumentException("Invalid side " + side);
+ throw new IllegalArgumentException(Messages.getString("swing.A4", side)); //$NON-NLS-1$
}
}
@@ -1148,7 +1150,7 @@
}
private void parseSheet(final boolean asResolver) {
-// throw new UnsupportedOperationException("CSS parser required!");
+// throw new UnsupportedOperationException(Messages.getString("swing.A5")); //$NON-NLS-1$
Sheet ss = null;
try {
ss = parser.parse();
Index: modules/swing/src/main/java/common/javax/swing/text/html/ObjectView.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/text/html/ObjectView.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/text/html/ObjectView.java (working copy)
@@ -24,14 +24,17 @@
import javax.swing.text.ComponentView;
import javax.swing.text.Element;
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
public class ObjectView extends ComponentView {
public ObjectView(final Element elem) {
super(elem);
- throw new UnsupportedOperationException("Not implemented");
+ throw new UnsupportedOperationException(Messages.getString("swing.9F")); //$NON-NLS-1$
}
protected Component createComponent() {
- throw new UnsupportedOperationException("Not implemented");
+ throw new UnsupportedOperationException(Messages.getString("swing.9F")); //$NON-NLS-1$
}
}
+
Index: modules/swing/src/main/java/common/javax/swing/text/html/HTMLDocument.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/text/html/HTMLDocument.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/text/html/HTMLDocument.java (working copy)
@@ -59,6 +59,8 @@
import org.apache.harmony.x.swing.text.html.form.FormTextModel;
import org.apache.harmony.x.swing.text.html.form.FormToggleButtonModel;
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
public class HTMLDocument extends DefaultStyledDocument {
public class BlockElement extends BranchElement {
@@ -1226,7 +1228,7 @@
int numRemovingElements = elem.getElementCount();
insertHTMLText(elem, elem.getStartOffset(), htmlText);
removeElements(elem, elem.getElementCount() - numRemovingElements, numRemovingElements);
- throw new UnsupportedOperationException("Not implemented");
+ throw new UnsupportedOperationException(Messages.getString("swing.27")); //$NON-NLS-1$
}
public void setOuterHTML(final Element elem, final String htmlText)
@@ -1242,7 +1244,7 @@
final int numElementsBefore = parent.getElementCount();
insertHTMLText(elem.getParentElement(), elem.getStartOffset(), htmlText);
removeElements(parent, indexBefore + (parent.getElementCount() - numElementsBefore), 1);
- throw new UnsupportedOperationException("Not implemented");
+ throw new UnsupportedOperationException(Messages.getString("swing.27")); //$NON-NLS-1$
}
public void processHTMLFrameHyperlinkEvent(final HTMLFrameHyperlinkEvent event) {
@@ -1383,13 +1385,13 @@
private void checkParser() {
if (parser == null) {
- throw new IllegalStateException("Parser should be set");
+ throw new IllegalStateException(Messages.getString("swing.9D")); //$NON-NLS-1$
}
}
private void checkLeaf(final Element elem) {
if (elem.isLeaf()) {
- throw new IllegalArgumentException("Can't insert HTML text after start of a leaf element");
+ throw new IllegalArgumentException(Messages.getString("swing.9E")); //$NON-NLS-1$
}
}
Index: modules/swing/src/main/java/common/javax/swing/text/html/parser/ParserCup.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/text/html/parser/ParserCup.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/text/html/parser/ParserCup.java (working copy)
@@ -28,6 +28,8 @@
import java.util.List;
import java.math.BigInteger;
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
/** CUP v0.11a beta 20060102 generated parser.
* @version Wed Dec 20 21:02:26 ART 2006
*/
@@ -1144,10 +1146,10 @@
/* . . . . . .*/
default:
- throw new Exception(
- "Invalid action number found in internal parse table");
+ throw new Exception(Messages.getString("swing.04")); //$NON-NLS-1$
}
}
}
+
Index: modules/swing/src/main/java/common/javax/swing/text/html/parser/Parser.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/text/html/parser/Parser.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/text/html/parser/Parser.java (working copy)
@@ -30,6 +30,8 @@
import javax.swing.text.html.HTML.Tag;
import javax.swing.tree.DefaultMutableTreeNode;
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
/**
* This class attempts to read and parse an HTML file, which it gets via an
* Input Stream. The parsing is based on a Documet Type Definition
@@ -123,7 +125,7 @@
* @param omitted determines whether the end tag may be omitted or not.
*/
protected void endTag(final boolean omitted) {
- throw new UnsupportedOperationException("not implemented");
+ throw new UnsupportedOperationException(Messages.getString("swing.27")); //$NON-NLS-1$
// XXX: Perhaps depending on the boolean value, an endtag.missing
// error may be thrown
//handleEndTag(currentTag);
@@ -302,7 +304,7 @@
*
*/
protected void handleEOFInComment() {
- throw new UnsupportedOperationException("Not implemented");
+ throw new UnsupportedOperationException(Messages.getString("swing.9F")); //$NON-NLS-1$
}
/**
@@ -375,7 +377,7 @@
*/
protected void markFirstTime(final Element elem) {
// TODO review this
- throw new UnsupportedOperationException("Not implemented");
+ throw new UnsupportedOperationException(Messages.getString("swing.9F")); //$NON-NLS-1$
}
/**
@@ -1428,4 +1430,4 @@
}
}
}
-}
\ No newline at end of file
+}
Index: modules/swing/src/main/java/common/javax/swing/text/html/HTMLEditorKit.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/text/html/HTMLEditorKit.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/text/html/HTMLEditorKit.java (working copy)
@@ -67,6 +67,8 @@
import org.apache.harmony.awt.text.TextUtils;
import org.apache.harmony.x.swing.StringConstants;
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
public class HTMLEditorKit extends StyledEditorKit implements Accessible {
public static class HTMLFactory implements ViewFactory {
@@ -146,7 +148,7 @@
// TODO: uncomment the next line and remove throw
// when all tags are supported
// return new LabelView(elem);
- throw new UnsupportedOperationException("Not implemented tag: " + tag);
+ throw new UnsupportedOperationException(Messages.getString("swing.9F") + tag); //$NON-NLS-1$
}
}
@@ -201,7 +203,7 @@
if (doc instanceof HTMLDocument) {
return (HTMLDocument)doc;
}
- throw new IllegalArgumentException("Document must be HTMLDocument");
+ throw new IllegalArgumentException(Messages.getString("swing.A0")); //$NON-NLS-1$
}
protected HTMLEditorKit getHTMLEditorKit(final JEditorPane pane) {
@@ -209,7 +211,7 @@
if (editorKit instanceof HTMLEditorKit) {
return (HTMLEditorKit)editorKit;
}
- throw new IllegalArgumentException("Editor kit must be HTMLEditorKit");
+ throw new IllegalArgumentException(Messages.getString("swing.A1")); //$NON-NLS-1$
}
}
@@ -569,7 +571,7 @@
final Bias[] biasRet) throws BadLocationException {
if (direction != NORTH && direction != SOUTH
&& direction != EAST && direction != WEST) {
- throw new IllegalArgumentException("Invalid direction");
+ throw new IllegalArgumentException(Messages.getString("swing.84")); //$NON-NLS-1$
}
biasRet[0] = Position.Bias.Forward;
return getEndOffset();
@@ -621,7 +623,7 @@
public AccessibleContext getAccessibleContext() {
// TODO: implement
- throw new UnsupportedOperationException("Not implemented");
+ throw new UnsupportedOperationException(Messages.getString("swing.9F")); //$NON-NLS-1$
}
public Action[] getActions() {
@@ -706,7 +708,7 @@
final int pushDepth, final HTML.Tag insertTag)
throws BadLocationException, IOException {
if (offset > doc.getLength()) {
- throw new BadLocationException("Invalid position", offset);
+ throw new BadLocationException(Messages.getString("swing.98"), offset); //$NON-NLS-1$
}
ParserCallback htmlReader = doc.getReader(offset, popDepth,
@@ -783,17 +785,17 @@
private static void checkReadPosition(final HTMLDocument doc, final int pos)
throws BadLocationException {
if (pos < 0) {
- throw new RuntimeException("Position cannot be negative");
+ throw new RuntimeException(Messages.getString("swing.A2")); //$NON-NLS-1$
}
if (pos > doc.getLength()) {
- throw new BadLocationException("Invalid position", pos);
+ throw new BadLocationException(Messages.getString("swing.98"), pos); //$NON-NLS-1$
}
if (doc.getLength() != 0) {
Element body = doc.getElement(doc.getDefaultRootElement(),
StyleConstants.NameAttribute,
HTML.Tag.BODY);
if (pos < body.getStartOffset() || pos > body.getEndOffset()) {
- throw new RuntimeException("Must insert inside body element");
+ throw new RuntimeException(Messages.getString("swing.A3")); //$NON-NLS-1$
}
}
}
Index: modules/swing/src/main/java/common/javax/swing/text/html/CSS.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/text/html/CSS.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/text/html/CSS.java (working copy)
@@ -42,6 +42,7 @@
import javax.swing.text.View;
import org.apache.harmony.x.swing.Utilities;
+import org.apache.harmony.x.swing.internal.nls.Messages;
public class CSS implements Serializable {
public static final class Attribute {
@@ -1689,8 +1690,7 @@
return new Integer(fontSize * 120 / 100);
default:
- System.err.println("font-size: can't resolve relative value. "
- + "Unknown relative unit");
+ System.err.println(Messages.getString("swing.err.07")); //$NON-NLS-1$
}
return getDefaultValue();
}
@@ -2163,8 +2163,7 @@
return new Float(width * theValue.floatValue() / 100);
default:
- System.err.println("FloatValue: can't resolve relative value. "
- + "Unknown relative unit");
+ System.err.println(Messages.getString("swing.err.07")); //$NON-NLS-1$
}
return ZERO;
}
Index: modules/swing/src/main/java/common/javax/swing/text/html/FormView.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/text/html/FormView.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/text/html/FormView.java (working copy)
@@ -49,12 +49,14 @@
import org.apache.harmony.x.swing.text.html.form.FormToggleButtonModel;
import org.apache.harmony.x.swing.internal.nls.Messages;
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
public class FormView extends ComponentView implements ActionListener {
private static final int EMPTY_SPAN = 0;
protected class MouseEventListener extends MouseAdapter {
public void mouseReleased(final MouseEvent evt) {
- throw new UnsupportedOperationException("Not implemented");
+ throw new UnsupportedOperationException(Messages.getString("swing.27")); //$NON-NLS-1$
}
}
@@ -76,7 +78,7 @@
public float getMaximumSpan(final int axis) {
if (axis != View.X_AXIS && axis != View.Y_AXIS) {
- throw new IllegalArgumentException(Messages.getString("swing.00", axis)); //$NON-NLS-1$
+ throw new IllegalArgumentException(Messages.getString("swing.00", axis)); //$NON-NLS-1$
}
if (getComponent() == null || getParent() == null) {
return EMPTY_SPAN;
@@ -253,12 +255,12 @@
protected void imageSubmit(final String imageData) {
// TODO implement imageSubmit
- throw new UnsupportedOperationException("Not implemented");
+ throw new UnsupportedOperationException(Messages.getString("swing.27")); //$NON-NLS-1$
}
protected void submitData(final String data) {
// TODO implement submitData
- throw new UnsupportedOperationException("Not implemented");
+ throw new UnsupportedOperationException(Messages.getString("swing.27")); //$NON-NLS-1$
}
private void determineValidControls(final Form form) {
@@ -280,7 +282,7 @@
case FormAttributes.TEXTAREA_TYPE_INDEX :
case FormAttributes.SELECT_LIST_TYPE_INDEX :
case FormAttributes.SELECT_COMBOBOX_TYPE_INDEX :
- throw new UnsupportedOperationException("Not implemented");
+ throw new UnsupportedOperationException(Messages.getString("swing.27")); //$NON-NLS-1$
default :
// Do nothing
break;
@@ -355,4 +357,4 @@
//CHECKED
model.setSelected(attrs.getAttribute(HTML.Attribute.CHECKED) != null);
}
-}
\ No newline at end of file
+}
Index: modules/swing/src/main/java/common/javax/swing/text/ComponentView.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/text/ComponentView.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/text/ComponentView.java (working copy)
@@ -33,6 +33,8 @@
import org.apache.harmony.awt.text.TextUtils;
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
public class ComponentView extends View {
private static final class ComponentViewLayout implements LayoutManager {
@@ -185,9 +187,9 @@
private void isAxisValid(final int axis) {
if (axis != X_AXIS && axis != Y_AXIS) {
- throw new IllegalArgumentException("Invalid axis: " + axis);
+ throw new IllegalArgumentException(Messages.getString("swing.00", axis)); //$NON-NLS-1$
}
}
-}
\ No newline at end of file
+}
Index: modules/swing/src/main/java/common/javax/swing/text/EmptyAttributeSet.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/text/EmptyAttributeSet.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/text/EmptyAttributeSet.java (working copy)
@@ -24,6 +24,8 @@
import java.util.Enumeration;
import java.util.NoSuchElementException;
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
/**
* Implementation of empty attribute set.
*
@@ -65,7 +67,7 @@
return false;
}
public Object nextElement() {
- throw new NoSuchElementException("Empty attribute set");
+ throw new NoSuchElementException(Messages.getString("swing.8A")); //$NON-NLS-1$
}
};
}
Index: modules/swing/src/main/java/common/javax/swing/text/FlowView.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/text/FlowView.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/text/FlowView.java (working copy)
@@ -29,6 +29,8 @@
import javax.swing.event.DocumentEvent;
import javax.swing.text.Position.Bias;
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
public abstract class FlowView extends BoxView {
public static class FlowStrategy {
private static FlowStrategy sharedStrategy;
@@ -232,8 +234,7 @@
}
public void paint(final Graphics g, final Shape shape) {
- throw new UnsupportedOperationException("Not applicable to "
- + "Layout Pool");
+ throw new UnsupportedOperationException(Messages.getString("swing.8B")); //$NON-NLS-1$
}
public void preferenceChanged(final View child,
@@ -272,8 +273,7 @@
protected View getViewAtPoint(final int x, final int y,
final Rectangle alloc) {
- throw new UnsupportedOperationException("Not applicable to "
- + "Layout Pool");
+ throw new UnsupportedOperationException(Messages.getString("swing.8B")); //$NON-NLS-1$
}
protected int getViewIndexAtPosition(final int pos) {
@@ -285,14 +285,12 @@
protected boolean isAfter(final int x, final int y,
final Rectangle rc) {
- throw new UnsupportedOperationException("Not applicable to "
- + "Layout Pool");
+ throw new UnsupportedOperationException(Messages.getString("swing.8B")); //$NON-NLS-1$
}
protected boolean isBefore(final int x, final int y,
final Rectangle rc) {
- throw new UnsupportedOperationException("Not applicable to "
- + "Layout Pool");
+ throw new UnsupportedOperationException(Messages.getString("swing.8B")); //$NON-NLS-1$
}
private float getSpanX() {
Index: modules/swing/src/main/java/common/javax/swing/text/GapContent.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/text/GapContent.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/text/GapContent.java (working copy)
@@ -29,6 +29,8 @@
import javax.swing.text.ContentPositions.DocumentMark;
import javax.swing.undo.UndoableEdit;
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
@SuppressWarnings("serial")
public class GapContent
implements AbstractDocument.Content, Serializable {
@@ -140,11 +142,11 @@
throws BadLocationException {
if (length < 0) {
- throw new BadLocationException("Length must be non-negative",
+ throw new BadLocationException(Messages.getString("swing.8C"), //$NON-NLS-1$
length);
}
if (offset < 0 || length > length() - offset) {
- throw new BadLocationException("Invalid start position", offset);
+ throw new BadLocationException(Messages.getString("swing.8D"), offset); //$NON-NLS-1$
}
if (offset + length <= gapStart) {
@@ -366,7 +368,7 @@
throws BadLocationException {
if (where < 0 || where > length()) {
- throw new BadLocationException("Invalid insert position", where);
+ throw new BadLocationException(Messages.getString("swing.8E"), where); //$NON-NLS-1$
}
shiftGap(where);
@@ -396,7 +398,7 @@
if (where < 0 || where + nitems >= length()) {
- throw new BadLocationException("Invalid remove position", where);
+ throw new BadLocationException(Messages.getString("swing.7F"), where); //$NON-NLS-1$
}
if (where + nitems == gapStart) {
Index: modules/swing/src/main/java/common/javax/swing/text/DefaultFormatter.java
===================================================================
--- modules/swing/src/main/java/common/javax/swing/text/DefaultFormatter.java (revision 512762)
+++ modules/swing/src/main/java/common/javax/swing/text/DefaultFormatter.java (working copy)
@@ -26,6 +26,8 @@
import javax.swing.SwingUtilities;
import javax.swing.text.DocumentFilter.FilterBypass;
+import org.apache.harmony.x.swing.internal.nls.Messages;
+
/**
*