eclipse / nebula

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

TableComboViewer: Dropdown not showing when detached as Eclipse View #480

Closed F8Fabe closed 8 months ago

F8Fabe commented 2 years ago

In our software project, we are using the nebula TableComboViewer in an Eclipse View. When detaching the view from the main Eclipse Window, the Dropdown of the ComboBox is not shown.

My Code is like this:

    List<String> testList = List.of("1", "2", "3");
    TableComboViewer comboViewer = new TableComboViewer(parent, SWT.READ_ONLY | SWT.BORDER);
    comboViewer.setContentProvider(ArrayContentProvider.getInstance());
    comboViewer.setInput(testList.toArray());

with parent being the parent composite . If needed I can provide a full example, but I would need to create an example eclipse plugin only containing the example.

I have recorded a video of the behavior (see Attachment).

https://user-images.githubusercontent.com/6065487/180792436-efb528c7-efd8-4aac-aa4b-0f33cdbea138.mp4

.

lcaron commented 2 years ago

Hi Fabian,

Thank you for your report. Can you give me some extra information please a) Which platform do you use ? (Eclipse version) b) Which JDK ? c) Which OS ?

I'll try to reproduce also on my side.

Laurent

F8Fabe commented 2 years ago

Thanks for the fast reply!

a) Eclipse Version: 2022-06 (4.24), Build id: I20220607-0700 Nebula TableCombo Plugin 1.2.0.202207031059 b) jdk-11.0.15.10-hotspot c) Windows 10 Pro (21H1)

If you cannot reproduce it, I can provide an empty plugin containing my code example. Just let me know ;)

lcaron commented 2 years ago

I did not reproduced this bug but I think I found something interesting. Can you please make a try with this patched version of the plugin ? (extension is zip because GitHub does not accept JAR extensions)

org.eclipse.nebula.widgets.tablecombo_1.2.0.202207281644.zip

(@F8Fabe I've patched the wrong file, this zip is ok)

lcaron commented 2 years ago

Hi @F8Fabe

Did you tried the patch ?

F8Fabe commented 2 years ago

Hi @lcaron

Sorry for the late response - I was on vacation last week.

I tried to but in our software project I don't know how to to insert the jar file into the target platform since we only use update sites and maven. Is there any chance that you could upload the patch with a eclipse update site? Else I will make an empty plugin project from scratch and try to insert it this way (or try to host it on my own).

lcaron commented 2 years ago

Hi Fabian,

No problem, you have the right to be on vacation ;)

You can try the latest repo : https://download.eclipse.org/nebula/snapshot/

If this is fine for you, I'll release a 2.7.2 version of Nebula.

Take care,

Laurent

F8Fabe commented 2 years ago

Hi, I did some testing. At first I thought the bug is now fixed, but i could reproduce the bug in another way now.

It works now fine when detached first time 👍 BUT when i later drop the detached view into Eclipse again. The Dropdown is not showing again (does not happen always). If this glitch happens it may also keep not showing the dropdown when detaching or attaching again.

The key to reproduce the bug is to have two tablecombo dropdowns open at the same time and fiddeling around with the detached one. (I can record a video of behavior if you cannot reproduce it.)

F8Fabe commented 2 years ago

By the way you can release the 2.7.2 version if you want, since it already improved the behavior!

Greetings, Fabian.

lcaron commented 2 years ago

Ok thank you. I will release the V2.7.2 and I keep working on this topic

[Edit] Nebula 2.7.2 is now available

F8Fabe commented 2 years ago

Hi Icaron,

I managed to reliable reproduce the bug. It occurs when reattaching a detached view with a tablecombo which has an openend dropdown menu. I attached a recording of the behavior. Please let me know if you can reproduce the bug or else I will provide a repository containing a sample plugin.

F8Fabe commented 2 years ago

Greetings @lcaron

I created a simple sample plugin, which can be used to reproduce the bug reliably.

https://github.com/F8Fabe/org.plugin.bugreport_nebula

You just need to run the plugin.xml as Eclipse Application and add the view (name is Sample View). Then detach the view, open the dropdown menu and reattach the view. I even noticed this Exception in the console:

!ENTRY org.eclipse.ui 4 0 2022-08-22 14:48:01.797 !MESSAGE Unhandled event loop exception !STACK 0 org.eclipse.swt.SWTException: Widget is disposed at org.eclipse.swt.SWT.error(SWT.java:4918) at org.eclipse.swt.SWT.error(SWT.java:4833) at org.eclipse.swt.SWT.error(SWT.java:4804) at org.eclipse.swt.widgets.Widget.error(Widget.java:450) at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:369) at org.eclipse.swt.widgets.Control.getVisible(Control.java:1710) at org.eclipse.nebula.widgets.tablecombo.TableCombo.isDropped(TableCombo.java:1481) at org.eclipse.nebula.widgets.tablecombo.TableCombo.arrowEvent(TableCombo.java:521) at org.eclipse.nebula.widgets.tablecombo.TableCombo.lambda$2(TableCombo.java:277) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4251) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1066) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4068) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3645) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1155) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1046) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155) at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:402) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596) at org.eclipse.equinox.launcher.Main.run(Main.java:1467) at org.eclipse.equinox.launcher.Main.main(Main.java:1440)

Please let me know if you can reproduce the issue.

https://user-images.githubusercontent.com/6065487/185925487-bd19e4b4-5a2b-4dbf-a7a0-84aaf900559b.mp4

Greetings, Fabian.

lcaron commented 2 years ago

Thank you fabian for the sample plugin, I'll work on this problem the next days.

Take care,

Laurent

lcaron commented 8 months ago

After a long long time, this bug is fixed for release 3.1.1