fix bug on icon in listbox and combobox 83/13983/2
Antoine ELIAS [Tue, 11 Mar 2014 16:53:49 +0000 (17:53 +0100)]
Change-Id: Iad2eaa2c69ccc1dae1a9e48f027a16110a70f02e

scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/listbox/SwingScilabListBox.java
scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/popupmenu/SwingScilabPopupMenu.java

index d7fddec..a56e2c9 100644 (file)
@@ -435,10 +435,7 @@ public class SwingScilabListBox extends JScrollPane implements SwingViewObject,
                     for (int i = 0; i < iconOffset; i++) {
                         String iconFile = FindIconHelper.findIcon((text[iconOffset + i]), false);
                         if (iconFile == null) {
-                            model.clear();
-                            iconBox = false;
-                            colorBox = false;
-                            break;
+                            iconFile = "";
                         }
 
                         //add item in listbox
@@ -446,10 +443,7 @@ public class SwingScilabListBox extends JScrollPane implements SwingViewObject,
                         if (file.exists() == false) {
                             String filename = FindIconHelper.findImage(iconFile, false);
                             if (filename == null) {
-                                model.clear();
-                                iconBox = false;
-                                colorBox = false;
-                                break;
+                                filename = "";
                             }
 
                             file = new File(filename);
index c7bffff..ea71f4a 100644 (file)
@@ -384,10 +384,7 @@ public class SwingScilabPopupMenu extends JComboBox implements SwingViewObject,
                     for (int i = 0; i < iconOffset; i++) {
                         String iconFile = FindIconHelper.findIcon((text[iconOffset + i]), false);
                         if (iconFile == null) {
-                            removeAllItems();
-                            iconBox = false;
-                            colorBox = false;
-                            break;
+                            iconFile = "";
                         }
 
                         //add item in combobox
@@ -395,10 +392,7 @@ public class SwingScilabPopupMenu extends JComboBox implements SwingViewObject,
                         if (file.exists() == false) {
                             String filename = FindIconHelper.findImage(iconFile, false);
                             if (filename == null) {
-                                removeAllItems();
-                                iconBox = false;
-                                colorBox = false;
-                                break;
+                                filename = "";
                             }
 
                             file = new File(filename);