data binding - e4 databinding converter exception not catch -
i have created custom converter convert string date.
public object convert(object fromobject){ if (fromobject != null && fromobject.tostring().trim().length() == 0){ return null; } (dateformat f : formats){ try{ return f.parse(fromobject.tostring()); }catch (parseexception e){ // ignore } } throw new runtimeexception(message); }
basically, if string not parsable runtimeexception thrown.
i have added converter update strategy in data-dinding , being called.
the issue when exception thrown. (for example when start type date in textfiled). instead of appearing decorator field indicated error in input, exception not catch.
the exception appears in console log (the error in logs @ end of question) seems nobody catching it.
what missing? exception in converter should catch within updatestrategy , display error, shouldn't it?
!entry org.eclipse.core.databinding 4 0 2017-08-18 15:16:27.816 !message invalid time format !stack 0 java.lang.runtimeexception: invalid time format @ com.lsespace.earthcare.tds.gui.util.databinding.conversion.stringtojavatimetagconverter.convert(stringtojavatimetagconverter.java:21) @ org.eclipse.core.databinding.updatestrategy.convert(updatestrategy.java:715) @ org.eclipse.core.databinding.updatevaluestrategy.convert(updatevaluestrategy.java:1) @ org.eclipse.core.databinding.valuebinding$3.run(valuebinding.java:175) @ org.eclipse.core.databinding.observable.realm$1.run(realm.java:149) @ org.eclipse.core.runtime.saferunner.run(saferunner.java:42) @ org.eclipse.core.databinding.observable.realm.saferun(realm.java:153) @ org.eclipse.core.databinding.observable.realm.exec(realm.java:171) @ org.eclipse.core.databinding.valuebinding.doupdate(valuebinding.java:158) @ org.eclipse.core.databinding.valuebinding.access$4(valuebinding.java:147) @ org.eclipse.core.databinding.valuebinding$1.handlevaluechange(valuebinding.java:46) @ org.eclipse.core.databinding.observable.value.valuechangeevent.dispatch(valuechangeevent.java:70) @ org.eclipse.core.databinding.observable.changemanager.fireevent(changemanager.java:117) @ org.eclipse.core.databinding.observable.value.decoratingobservablevalue.firevaluechange(decoratingobservablevalue.java:61) @ org.eclipse.core.databinding.observable.value.decoratingobservablevalue.handlevaluechange(decoratingobservablevalue.java:103) @ org.eclipse.core.databinding.observable.value.decoratingobservablevalue$1.handlevaluechange(decoratingobservablevalue.java:76) @ org.eclipse.core.databinding.observable.value.valuechangeevent.dispatch(valuechangeevent.java:70) @ org.eclipse.core.databinding.observable.changemanager.fireevent(changemanager.java:117) @ org.eclipse.core.databinding.observable.value.abstractobservablevalue.firevaluechange(abstractobservablevalue.java:82) @ org.eclipse.core.internal.databinding.property.value.simplepropertyobservablevalue.notifyifchanged(simplepropertyobservablevalue.java:126) @ org.eclipse.core.internal.databinding.property.value.simplepropertyobservablevalue.access$3(simplepropertyobservablevalue.java:118) @ org.eclipse.core.internal.databinding.property.value.simplepropertyobservablevalue$1$1.run(simplepropertyobservablevalue.java:70) @ org.eclipse.core.databinding.observable.realm$1.run(realm.java:149) @ org.eclipse.core.runtime.saferunner.run(saferunner.java:42) @ org.eclipse.core.databinding.observable.realm.saferun(realm.java:153) @ org.eclipse.core.databinding.observable.realm.exec(realm.java:171) @ org.eclipse.core.internal.databinding.property.value.simplepropertyobservablevalue$1.handleevent(simplepropertyobservablevalue.java:66) @ org.eclipse.core.databinding.property.nativepropertylistener.firechange(nativepropertylistener.java:69) @ org.eclipse.jface.internal.databinding.swt.widgetlistener.handleevent(widgetlistener.java:56) @ org.eclipse.swt.widgets.eventtable.sendevent(eventtable.java:84) @ org.eclipse.swt.widgets.display.sendevent(display.java:4410) @ org.eclipse.swt.widgets.widget.sendevent(widget.java:1079) @ org.eclipse.swt.widgets.widget.sendevent(widget.java:1103) @ org.eclipse.swt.widgets.widget.sendevent(widget.java:1084) @ org.eclipse.swt.widgets.text.wmcommandchild(text.java:3117) @ org.eclipse.swt.widgets.control.wm_command(control.java:4939) @ org.eclipse.swt.widgets.control.windowproc(control.java:4794) @ org.eclipse.swt.widgets.display.windowproc(display.java:5115) @ org.eclipse.swt.internal.win32.os.callwindowprocw(native method) @ org.eclipse.swt.internal.win32.os.callwindowproc(os.java:2446) @ org.eclipse.swt.widgets.text.callwindowproc(text.java:262) @ org.eclipse.swt.widgets.control.windowproc(control.java:4889) @ org.eclipse.swt.widgets.text.windowproc(text.java:2704) @ org.eclipse.swt.widgets.display.windowproc(display.java:5102) @ org.eclipse.swt.internal.win32.os.dispatchmessagew(native method) @ org.eclipse.swt.internal.win32.os.dispatchmessage(os.java:2552) @ org.eclipse.swt.widgets.display.readanddispatch(display.java:3814) @ org.eclipse.jface.window.window.runeventloop(window.java:818) @ org.eclipse.jface.window.window.open(window.java:794) @ com.lsespace.earthcare.tds.gui.jface.actions.editconfigaction.run(editconfigaction.java:39) @ org.eclipse.jface.action.action.runwithevent(action.java:473) @ org.eclipse.jface.action.actioncontributionitem.handlewidgetselection(actioncontributionitem.java:565) @ org.eclipse.jface.action.actioncontributionitem.lambda$5(actioncontributionitem.java:436) @ org.eclipse.jface.action.actioncontributionitem$$lambda$57/765702264.handleevent(unknown source) @ org.eclipse.swt.widgets.eventtable.sendevent(eventtable.java:84) @ org.eclipse.swt.widgets.display.sendevent(display.java:4410) @ org.eclipse.swt.widgets.widget.sendevent(widget.java:1079) @ org.eclipse.swt.widgets.display.rundeferredevents(display.java:4228) @ org.eclipse.swt.widgets.display.readanddispatch(display.java:3816) @ org.eclipse.e4.ui.internal.workbench.swt.partrenderingengine$4.run(partrenderingengine.java:1121) @ org.eclipse.core.databinding.observable.realm.runwithdefault(realm.java:336) @ org.eclipse.e4.ui.internal.workbench.swt.partrenderingengine.run(partrenderingengine.java:1022) @ org.eclipse.e4.ui.internal.workbench.e4workbench.createandrunui(e4workbench.java:150) @ org.eclipse.e4.ui.internal.workbench.swt.e4application.start(e4application.java:161) @ org.eclipse.equinox.internal.app.eclipseapphandle.run(eclipseapphandle.java:196) @ org.eclipse.core.runtime.internal.adaptor.eclipseapplauncher.runapplication(eclipseapplauncher.java:134) @ org.eclipse.core.runtime.internal.adaptor.eclipseapplauncher.start(eclipseapplauncher.java:104) @ org.eclipse.core.runtime.adaptor.eclipsestarter.run(eclipsestarter.java:388) @ org.eclipse.core.runtime.adaptor.eclipsestarter.run(eclipsestarter.java:243) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:62) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:497) @ org.eclipse.equinox.launcher.main.invokeframework(main.java:673) @ org.eclipse.equinox.launcher.main.basicrun(main.java:610) @ org.eclipse.equinox.launcher.main.run(main.java:1519) @ org.eclipse.equinox.launcher.main.main(main.java:1492)
Comments
Post a Comment