harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apetre...@apache.org
Subject svn commit: r568614 - in /harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing: JOptionPane.java plaf/basic/BasicOptionPaneUI.java
Date Wed, 22 Aug 2007 14:03:00 GMT
Author: apetrenko
Date: Wed Aug 22 07:02:59 2007
New Revision: 568614

URL: http://svn.apache.org/viewvc?rev=568614&view=rev
Log:
Refix for HARMONY-4613 "[classlib][swing] SetOptions/SetMessage of JOptionPane not implemented"

Modified:
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JOptionPane.java
    harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicOptionPaneUI.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JOptionPane.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JOptionPane.java?rev=568614&r1=568613&r2=568614&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JOptionPane.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/JOptionPane.java
Wed Aug 22 07:02:59 2007
@@ -456,7 +456,6 @@
         Object oldValue = message;
         message = newMessage;
         firePropertyChange(MESSAGE_PROPERTY, oldValue, newMessage);
-		updateUI();
     }
 
     public Object getMessage() {
@@ -467,7 +466,6 @@
         Icon oldValue = icon;
         icon = newIcon;
         firePropertyChange(ICON_PROPERTY, oldValue, newIcon);
-		updateUI();
     }
 
     public Icon getIcon() {
@@ -478,7 +476,6 @@
         Object oldValue = value;
         value = newValue;
         firePropertyChange(VALUE_PROPERTY, oldValue, newValue);
-		updateUI();
     }
 
     public Object getValue() {
@@ -489,7 +486,6 @@
         Object[] oldValue = options;
         options = newOptions;
         firePropertyChange(OPTIONS_PROPERTY, oldValue, newOptions);
-		updateUI();
     }
 
     public Object[] getOptions() {
@@ -500,7 +496,6 @@
         Object oldValue = initialValue;
         initialValue = newValue;
         firePropertyChange(INITIAL_VALUE_PROPERTY, oldValue, newValue);
-		updateUI();
     }
 
     public Object getInitialValue() {
@@ -524,7 +519,6 @@
                     "JOptionPane.WARNING_MESSAGE, JOptionPane.QUESTION_MESSAGE " + //$NON-NLS-1$
                     "or JOptionPane.PLAIN_MESSAGE"); //$NON-NLS-1$
         }
-		updateUI();
     }
 
     public int getMessageType() {
@@ -544,7 +538,6 @@
         default:
             throw new RuntimeException(Messages.getString("swing.20")); //$NON-NLS-1$
         }
-		updateUI();
     }
 
     public int getOptionType() {
@@ -556,7 +549,6 @@
         selectionValues = newValues;
         firePropertyChange(SELECTION_VALUES_PROPERTY, oldSelectionValues, newValues);
         setWantsInput(selectionValues != null);
-		updateUI();
     }
 
     public Object[] getSelectionValues() {
@@ -567,7 +559,6 @@
         Object oldInitialSelectionValue = initialSelectionValue;
         initialSelectionValue = newValue;
         firePropertyChange(INITIAL_SELECTION_VALUE_PROPERTY, oldInitialSelectionValue, newValue);
-		updateUI();
     }
 
     public Object getInitialSelectionValue() {
@@ -578,7 +569,6 @@
         Object oldValue = inputValue;
         inputValue = newValue;
         firePropertyChange(INPUT_VALUE_PROPERTY, oldValue, newValue);
-		updateUI();
     }
 
     public Object getInputValue() {
@@ -593,7 +583,6 @@
         boolean oldValue = wantsInput;
         wantsInput = newValue;
         firePropertyChange(WANTS_INPUT_PROPERTY, oldValue, newValue);
-		updateUI();
     }
 
     public boolean getWantsInput() {
@@ -649,6 +638,5 @@
             return;
         }
         dialog.getRootPane().setWindowDecorationStyle(messageTypeToRootPaneDecoration(messageType));
-		//updateUI();
     }
 }

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicOptionPaneUI.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicOptionPaneUI.java?rev=568614&r1=568613&r2=568614&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicOptionPaneUI.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/main/java/common/javax/swing/plaf/basic/BasicOptionPaneUI.java
Wed Aug 22 07:02:59 2007
@@ -194,21 +194,25 @@
                 return;
             }
 
-            JOptionPane pane = BasicOptionPaneUI.this.optionPane;
-            if (JOptionPane.ICON_PROPERTY.equals(event.getPropertyName()) ||
-                JOptionPane.MESSAGE_PROPERTY.equals(event.getPropertyName()) ||
-                JOptionPane.OPTIONS_PROPERTY.equals(event.getPropertyName()) ||
-                JOptionPane.INITIAL_VALUE_PROPERTY.equals(event.getPropertyName())) {
+            final JOptionPane pane = BasicOptionPaneUI.this.optionPane;
+            final String propName = event.getPropertyName();
+            
+            if (JOptionPane.ICON_PROPERTY.equals(propName) ||
+                JOptionPane.MESSAGE_PROPERTY.equals(propName) ||
+                JOptionPane.OPTIONS_PROPERTY.equals(propName) ||
+                JOptionPane.INITIAL_VALUE_PROPERTY.equals(propName)) {
 
+                uninstallComponents();
+                installComponents();
                 pane.revalidate();
-            } else if (JOptionPane.SELECTION_VALUES_PROPERTY.equals(event.getPropertyName())
||
-                       JOptionPane.WANTS_INPUT_PROPERTY.equals(event.getPropertyName()))
{
+            } else if (JOptionPane.SELECTION_VALUES_PROPERTY.equals(propName) ||
+                       JOptionPane.WANTS_INPUT_PROPERTY.equals(propName)) {
 
                 initValues(pane);
                 pane.revalidate();
-            } else if (JOptionPane.INITIAL_SELECTION_VALUE_PROPERTY.equals(event.getPropertyName()))
{
+            } else if (JOptionPane.INITIAL_SELECTION_VALUE_PROPERTY.equals(propName)) {
                 setInputValue(event.getNewValue());
-            } else if (StringConstants.ANCESTOR_PROPERTY_NAME.equals(event.getPropertyName())
+            } else if (StringConstants.ANCESTOR_PROPERTY_NAME.equals(propName)
                     && (event.getOldValue() == null)) {
 
                 selectInitialValue(pane);



Mime
View raw message