Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Nebula » Switching from TableViewer to GridViewer
Switching from TableViewer to GridViewer [message #633271] Fri, 15 October 2010 19:13 Go to next message
Jon Svede is currently offline Jon Svede
Messages: 83
Registered: July 2009
Member
I have a requirement to to be able to allow users to navigate with the arrow keys and such as well as allowing to select a grid of cells in a table. I was using the TableViewer but after reading the forums it seems like a no brainer to use the Grid instead.

I successfully switched over without trouble. However when I go to run my app I now get the following exception and the app dies before it ever really starts. The stack doesn't reference anything in my code except the place in the application class where I call PlatformUI.createAndRunWorkbench(). I tried running it through the debugger without success.

Any suggestions? Does being on a Mac require me to do something specific? Is there some additional plugin I need for SWT support or something?

java.lang.ClassCastException: org.eclipse.nebula.widgets.grid.Grid cannot be cast to org.eclipse.swt.widgets.Table
at org.eclipse.jface.viewers.TableLayout.getColumns(TableLayout .java:247)
at org.eclipse.jface.viewers.TableLayout.layout(TableLayout.jav a:146)
at org.eclipse.swt.widgets.Composite.updateLayout(Composite.jav a:994)
at org.eclipse.swt.widgets.Composite.resized(Composite.java:774 )
at org.eclipse.swt.widgets.Control.setFrameSize(Control.java:33 08)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4645 )
at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
at org.eclipse.swt.internal.cocoa.NSView.setFrame(NSView.java:2 43)
at org.eclipse.swt.widgets.Control.setBounds(Control.java:3043)
<truncated for brevity>
Re: Switching from TableViewer to GridViewer [message #633278 is a reply to message #633271] Fri, 15 October 2010 19:33 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas Schindl
Messages: 5008
Registered: July 2009
Senior Member
You can't use a TableLayout and we have no replacement so the only
possibility is to copy the JFace code and adjust the calls to use
Grid/GridColumn instead of Table/TableColumn

Tom

Am 16.10.10 01:14, schrieb Jon Svede:
> I have a requirement to to be able to allow users to navigate with the
> arrow keys and such as well as allowing to select a grid of cells in a
> table. I was using the TableViewer but after reading the forums it
> seems like a no brainer to use the Grid instead.
>
> I successfully switched over without trouble. However when I go to run
> my app I now get the following exception and the app dies before it ever
> really starts. The stack doesn't reference anything in my code except
> the place in the application class where I call
> PlatformUI.createAndRunWorkbench(). I tried running it through the
> debugger without success.
>
> Any suggestions? Does being on a Mac require me to do something
> specific? Is there some additional plugin I need for SWT support or
> something?
>
> java.lang.ClassCastException: org.eclipse.nebula.widgets.grid.Grid
> cannot be cast to org.eclipse.swt.widgets.Table
> at org.eclipse.jface.viewers.TableLayout.getColumns(TableLayout
> .java:247)
> at org.eclipse.jface.viewers.TableLayout.layout(TableLayout.jav a:146)
> at org.eclipse.swt.widgets.Composite.updateLayout(Composite.jav a:994)
> at org.eclipse.swt.widgets.Composite.resized(Composite.java:774 )
> at org.eclipse.swt.widgets.Control.setFrameSize(Control.java:33 08)
> at org.eclipse.swt.widgets.Display.windowProc(Display.java:4645 )
> at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
> at org.eclipse.swt.internal.cocoa.NSView.setFrame(NSView.java:2 43)
> at org.eclipse.swt.widgets.Control.setBounds(Control.java:3043)
> <truncated for brevity>
Re: Switching from TableViewer to GridViewer [message #633644 is a reply to message #633278] Mon, 18 October 2010 12:18 Go to previous messageGo to next message
Jon Svede is currently offline Jon Svede
Messages: 83
Registered: July 2009
Member
Thanks for the pointer, Tom. I need to look at my code more closely to understand what impact this has to fix. I think using Grid/GridViewer will help me in the long term - so thanks to the Nebula team!

How could I have figured this out on my own? I tried setting a break point at the place in the code where the stack pointed to my code, but it's reflective - here's the tail end of the stack trace:

at org.something.sera.gui.SeraApplication.start(SeraApplication .java:23)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:194)
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(EclipseS tarter.java:368)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
at org.eclipse.equinox.launcher.Main.main(Main.java:1287)

Just curious if this was something I could have diagnosed on my own.....

Thanks,

Jon
Re: Switching from TableViewer to GridViewer [message #633653 is a reply to message #633644] Mon, 18 October 2010 12:34 Go to previous message
Thomas Schindl is currently offline Thomas Schindl
Messages: 5008
Registered: July 2009
Senior Member
The original exception you showed is much better:

> java.lang.ClassCastException: org.eclipse.nebula.widgets.grid.Grid cannot be cast to org.eclipse.swt.widgets.Table
> at org.eclipse.jface.viewers.TableLayout.getColumns(TableLayout .java:247)
> at org.eclipse.jface.viewers.TableLayout.layout(TableLayout.jav a:146)
> at org.eclipse.swt.widgets.Composite.updateLayout(Composite.jav a:994)
> at org.eclipse.swt.widgets.Composite.resized(Composite.java:774 )
> at org.eclipse.swt.widgets.Control.setFrameSize(Control.java:33 08)
> at org.eclipse.swt.widgets.Display.windowProc(Display.java:4645 )
> at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
> at org.eclipse.swt.internal.cocoa.NSView.setFrame(NSView.java:2 43)
> at org.eclipse.swt.widgets.Control.setBounds(Control.java:3043)



Tom

Am 18.10.10 18:18, schrieb Jon Svede:
> Thanks for the pointer, Tom. I need to look at my code more closely to
> understand what impact this has to fix. I think using Grid/GridViewer
> will help me in the long term - so thanks to the Nebula team!
>
> How could I have figured this out on my own? I tried setting a break
> point at the place in the code where the stack pointed to my code, but
> it's reflective - here's the tail end of the stack trace:
>
> at org.something.sera.gui.SeraApplication.start(SeraApplication
> .java:23)
> at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips
> eAppHandle.java:194)
> 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(EclipseS
> tarter.java:368)
> at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS
> tarter.java:179)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
> ssorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
> thodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 559)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
> at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
> Just curious if this was something I could have diagnosed on my own.....
>
> Thanks,
>
> Jon
>
Previous Topic:Gantt Chart - select events connections
Next Topic:XViewer with Xtext/EMF/Databinding
Goto Forum:
  


Current Time: Thu Apr 17 05:39:39 EDT 2014

Powered by FUDForum. Page generated in 0.09290 seconds