Hello!
I implemented (Eclipse 3.7, Ubuntu 12.04 on x86) an eight column treeviewer with an OwnerDrawLabelProvider. Although only three parent items with 5-10 children items each are shown the performance of the UI is not acceptable. Scrolling is delayed by seconds. The cells are editable on click and show a context menu on right click. These functions are delayed, too.
I exported the program to win_x86. The responsiveness was equally bad.
My first try was to cache the database access (db4o) in array lists but this only gave a small improvement. So the db access seems not to be the cause.
I then timed the paint function of the label provider and noticed massive amounts of
event=`Event {type=42 Tree {} time=132242066 data=null x=31 y=207 width=4 height=23 detail=16}`
event: detail=`16`
These FocusOut(detail=16?) events are produced for all shown cells when calling a context menu or selecting an item of the menu.
If I move the mouse cursor across the displayed tree FocusOut events are received for all cells in a row and not only for the cells the mouse traverses.
I thought my program's treeviwer.refresh(...) would cause this behaviour so I commented out all calls to refresh() but the paint(...) still receives these events.
At last I caught the events with
new Exception().printStackTrace(System.err);
which resulted in
at lan.yggdrasil.devel.edvbvf.pas.bewo.uvp.provider.LabelProvider.paint(LabelProvider.java:161)
at org.eclipse.jface.viewers.OwnerDrawLabelProvider$OwnerDrawListener.handleEvent(OwnerDrawLabelProvider.java:59)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1282)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1267)
at org.eclipse.swt.widgets.Tree.rendererRenderProc(Tree.java:2774)
at org.eclipse.swt.widgets.Display.rendererRenderProc(Display.java:1369)
at org.eclipse.swt.internal.gtk.OS._gtk_main_do_event(Native Method)
at org.eclipse.swt.internal.gtk.OS.gtk_main_do_event(OS.java:8422)
at org.eclipse.swt.widgets.Display.eventProc(Display.java:1245)
at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native Method)
at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java:2276)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3207)
at org.eclipse.ui.application.WorkbenchAdvisor.openWindows(WorkbenchAdvisor.java:803)
at org.eclipse.ui.internal.Workbench$33.runWithException(Workbench.java:1600)
at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:31)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3563)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3212)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2609)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at lan.yggdrasil.devel.edvbvf.pas.bewo.uvp.Application.start(Application.java:21)
...
Is this an expected bahaviour? Where should I go from here to find out the source of the events to control them? May be I should change to a tableviewer implementation?
Thanks!
GV