eclipse / nebula

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

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

Closed christianmichaelis closed 1 month ago

christianmichaelis commented 1 month 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 1 month 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.