Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 290555 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/emf/common/ui/celleditor/ExtendedComboBoxCellEditor.java (-6 / +21 lines)
Lines 212-222 Link Here
212
    CCombo combo = (CCombo)getControl();
212
    CCombo combo = (CCombo)getControl();
213
    if (combo != null && (!combo.isDisposed()))
213
    if (combo != null && (!combo.isDisposed()))
214
    {
214
    {
215
      String[] items = createItems(list = new ArrayList<Object>(originalList), labelProvider, filter, sorted);
215
      ArrayList<Object> newList = new ArrayList<Object>(originalList);
216
      combo.setItems(items);
216
      String[] items = createItems(newList, labelProvider, filter, sorted);
217
      if (items.length > 0)
217
      if (!newList.equals(list))
218
      {
218
      {
219
        combo.select(0);
219
        final Object previousValue = getValue();
220
        list = newList;
221
        combo.setItems(items);
222
        if (list.contains(previousValue))
223
        {
224
          // Set it immediately and set it again later because something insists on changing the selection again.
225
          setValue(previousValue);
226
          combo.getDisplay().asyncExec
227
            (new Runnable()
228
             {
229
               public void run()
230
               {
231
                 setValue(previousValue);
232
               }
233
             });
234
        }
220
      }
235
      }
221
    }
236
    }
222
  }
237
  }
Lines 238-244 Link Here
238
    int index = list.indexOf(value);
253
    int index = list.indexOf(value);
239
    if (index != -1)
254
    if (index != -1)
240
    {
255
    {
241
      super.doSetValue(list.indexOf(value));
256
      super.doSetValue(index);
242
    }
257
    }
243
  }
258
  }
244
259

Return to bug 290555