Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Workaround for TreeViewer bug(Relatively inexperienced in RCP. I'm having difficulty getting this to work)
Workaround for TreeViewer bug [message #774331] Tue, 03 January 2012 18:12
g.z.white is currently offline g.z.white
Messages: 5
Registered: May 2011
Junior Member
Hi,

I'm seeing the following exception when selecting tree items in my RAP application's View in Indigo on a Mac..
(It doesn't seem to happen in the RCP version)

Quote:
2011-12-20 15:15:31.365:WARN:/:ERROR: Failed to execute PhaseListener after phase 'PROCESS_ACTION'.
java.lang.ClassCastException: org.eclipse.swt.layout.GridLayout cannot be cast to org.eclipse.swt.layout.FillData
at org.eclipse.swt.layout.FillLayout.flushCache(FillLayout.java:165)
at org.eclipse.swt.widgets.Composite.changed(Composite.java:610)
at org.eclipse.rwt.internal.textsize.ClearLayoutBuffersVisitor.doVisit(ClearLayoutBuffersVisitor.java:22)
at org.eclipse.swt.internal.widgets.WidgetTreeVisitor$AllWidgetTreeVisitor.visit(WidgetTreeVisitor.java:34)
at org.eclipse.swt.internal.widgets.WidgetTreeVisitor.accept(WidgetTreeVisitor.java:48)
at org.eclipse.swt.internal.widgets.WidgetTreeVisitor.accept(WidgetTreeVisitor.java:55)
at org.eclipse.swt.internal.widgets.WidgetTreeVisitor.accept(WidgetTreeVisitor.java:55)
at org.eclipse.swt.internal.widgets.WidgetTreeVisitor.accept(WidgetTreeVisitor.java:55)
at org.eclipse.swt.internal.widgets.WidgetTreeVisitor.accept(WidgetTreeVisitor.java:55)
at org.eclipse.rwt.internal.textsize.TextSizeRecalculation.clearLayoutBuffers(TextSizeRecalculation.java:51)
at org.eclipse.rwt.internal.textsize.TextSizeRecalculation.forceShellRecalculations(TextSizeRecalculation.java:36)
at org.eclipse.rwt.internal.textsize.TextSizeRecalculation.execute(TextSizeRecalculation.java:29)
at org.eclipse.rwt.internal.textsize.MeasurementListener.handleMeasurementResults(MeasurementListener.java:61)
at org.eclipse.rwt.internal.textsize.MeasurementListener.afterPhase(MeasurementListener.java:33)
at org.eclipse.rwt.internal.lifecycle.PhaseListenerManager.notifyAfterPhase(PhaseListenerManager.java:85)
at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.continueLifeCycle(RWTLifeCycle.java:168)
at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.sleep(RWTLifeCycle.java:253)
at org.eclipse.swt.widgets.Display.sleep(Display.java:1174)
at org.eclipse.ui.application.WorkbenchAdvisor.eventLoopIdle(WorkbenchAdvisor.java:361)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2734)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2694)
at org.eclipse.ui.internal.Workbench.access$5(Workbench.java:2530)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:702)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:685)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:157)
at com.inpses.read.rap.Application.start(Application.java:18)
at org.eclipse.rap.ui.internal.application.EntrypointApplicationWrapper.createUI(EntrypointApplicationWrapper.java:25)
at org.eclipse.rwt.internal.lifecycle.EntryPointManager.createUI(EntryPointManager.java:81)
at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWTLifeCycle.java:204)
at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadController.run(RWTLifeCycle.java:88)
at java.lang.Thread.run(Thread.java:680)
at org.eclipse.rwt.internal.lifecycle.UIThread.run(UIThread.java:101)



It looks like bug 325788 might be the cause..


..so, as suggested by the above bug report's workaround, I've tried wrapping the TreeViewer in a composite and setting the composite's layout to GridLayout, as detailed in the code below.


	public void createPartControl(Composite parent) {
				
		Composite c = new Composite(parent, SWT.DEFAULT);
		c.setLayout(new GridLayout());
		viewer = new TreeViewer(c, SWT.VIRTUAL | SWT.MULTI | SWT.H_SCROLL
				| SWT.V_SCROLL);
		viewer.getTree().setLayoutData(new GridData());



This has no effect. I am missing something, aren't I?
I often do.

Any help would be much appreciated.


G
Previous Topic:Re: JMeter | Popups | Added Sample TestCase
Next Topic:Workaround for TreeViewer bug
Goto Forum:
  


Current Time: Fri Oct 24 17:04:33 GMT 2014

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

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