| Summary: | SWT dispose exception with <if><then> constraint | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Naga <naga_cit> |
| Component: | Sapphire | Assignee: | Konstantin Komissarchik <konstantin> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | konstantin, ling.hao |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
Do you observe any other adverse effects besides the exception in the log? Note that this bug is likely exposed by the specific combination of using a property listener to clear values of properties that are simultaneously being hidden by if/else construct. A temporary workaround would be to disable clearing of properties. I removed the listeners, still getting the exception.
I think, in the boolean evaluate function, I am accessing the values to return true or false. That might be the reason I guess.
@Override
public boolean evaluate()
{
....
return true;
}
I reproduced and fixed this issue. I have added demonstration of the if-then-else construct use to the gallery sample as part of the fix. Please verify the fix. This can be verified via the gallery sample. Verified in sapphire-gallery.xml |
SWT dispose exception with <if><then> constraint org.eclipse.swt.SWTException: Widget is disposed at org.eclipse.swt.SWT.error(SWT.java:4083) at org.eclipse.swt.SWT.error(SWT.java:3998) at org.eclipse.swt.SWT.error(SWT.java:3969) at org.eclipse.swt.widgets.Widget.error(Widget.java:468) at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:340) at org.eclipse.swt.widgets.Combo.getItemCount(Combo.java:690) at org.eclipse.sapphire.ui.internal.binding.ComboBinding.removeMalformedItem(ComboBinding.java:103) at org.eclipse.sapphire.ui.internal.binding.AbstractEnumBinding.doUpdateModel(AbstractEnumBinding.java:75) at org.eclipse.sapphire.ui.internal.binding.AbstractBinding.updateModel(AbstractBinding.java:105) at org.eclipse.sapphire.ui.internal.binding.ComboBinding$1.widgetSelected(ComboBinding.java:64) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:234) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438) at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574) at org.eclipse.equinox.launcher.Main.run(Main.java:1407) at org.eclipse.equinox.launcher.Main.main(Main.java:1383) Sdef File Content: ================== <if> <condition> <class>ColumnScaleCondition</class> </condition> <then> <property-editor>prop1</property-editor> <property-editor> <property>prop2</property> <hint> <name>prefer.combo</name> <value>true</value> </hint> </property-editor> </then> </if> ColumnScaleCondition Class: =========================== public final class ColumnScaleCondition extends SapphireModelCondition { @Override public boolean evaluate() { return true; } //@Override public List<String> getDependencies() { return Collections.singletonList( ITst.PROP_ITEM1.getName() ); } }