eclipse / nebula

Nebula Project
https://eclipse.org/nebula
Eclipse Public License 2.0
85 stars 98 forks source link

CDateTime does not correctly display selected date when using dropdown after typing a single digit #593

Closed christianmichaelis closed 5 months ago

christianmichaelis commented 6 months ago

Using a CDateTime configured for date selection like this:

CDateTime cDateTime = new CDateTime(content, CDT.BORDER | CDT.DROP_DOWN | CDT.DATE_MEDIUM);
cDateTime.addSelectionListener(new SelectionListener() {
   @Override
   public void widgetSelected(SelectionEvent e) {
      System.out.println(cDateTime.getSelection());
   }

   @Override
   public void widgetDefaultSelected(SelectionEvent e) {
   }
});
christianmichaelis commented 5 months ago

Related issue found during fixing the first: Using a CDateTime in text-only mode (neither SIMPLE nor DROP_DOWN), hitting CTRL-Space with focus in the widget triggers an NPE as createPicker() is invoked via setOpen(true) from the BaseCombo.textListener.