Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » OwnerDrawLabelProvider#paint receives lots of FocusOut events(OwnerDrawLabelProvider#paint receives lots of FocusOut events)
OwnerDrawLabelProvider#paint receives lots of FocusOut events [message #990950] Sat, 15 December 2012 11:05
Volker Fervers is currently offline Volker FerversFriend
Messages: 1
Registered: December 2012
Junior Member

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(
	at org.eclipse.jface.viewers.OwnerDrawLabelProvider$OwnerDrawListener.handleEvent(
	at org.eclipse.swt.widgets.EventTable.sendEvent(
	at org.eclipse.swt.widgets.Widget.sendEvent(
	at org.eclipse.swt.widgets.Widget.sendEvent(
	at org.eclipse.swt.widgets.Widget.sendEvent(
	at org.eclipse.swt.widgets.Tree.rendererRenderProc(
	at org.eclipse.swt.widgets.Display.rendererRenderProc(
	at org.eclipse.swt.internal.gtk.OS._gtk_main_do_event(Native Method)
	at org.eclipse.swt.internal.gtk.OS.gtk_main_do_event(
	at org.eclipse.swt.widgets.Display.eventProc(
	at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native Method)
	at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(
	at org.eclipse.swt.widgets.Display.readAndDispatch(
	at org.eclipse.ui.application.WorkbenchAdvisor.openWindows(
	at org.eclipse.ui.internal.Workbench$33.runWithException(
	at org.eclipse.ui.internal.StartupThreading$
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(
	at org.eclipse.swt.widgets.Display.runAsyncMessages(
	at org.eclipse.swt.widgets.Display.readAndDispatch(
	at org.eclipse.ui.internal.Workbench.runUI(
	at org.eclipse.ui.internal.Workbench.access$4(
	at org.eclipse.ui.internal.Workbench$
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(
	at lan.yggdrasil.devel.edvbvf.pas.bewo.uvp.Application.start(

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?

Previous Topic:TableViewer SWT.VIRTUAL or not ?
Next Topic:Jface SQLite
Goto Forum:

Current Time: Tue Oct 06 01:52:35 GMT 2015

Powered by FUDForum. Page generated in 0.01563 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software