Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] Eclipse 3.0 and FormData classcastexception:


It looks like one (or more) of your widgets that is inside a GridLayout has a FormData associated with it.
Widgets in a GridLayout must have a GridData object associated with them - not a FormData object.
When the widgets in your GridLayout are being analyzed, the following line of code is failing:
        GridData spec = (GridData) child.getLayoutData();
You will need to make sure that widgets inside a GridLayout all have a GridData set into them using setLayoutData()
(or don't set anything, which defaults to a GridData).

I have absolutely no clue how it could have worked in eclipse 2.1 - the compiler must have been less strict or something.

Hope this helps.
Carolyn



ram_krishnamurthy@xxxxxxxxxx
Sent by: platform-swt-dev-admin@xxxxxxxxxxx

03/09/2004 10:56 AM

Please respond to
platform-swt-dev

To
platform-swt-dev@xxxxxxxxxxx
cc
Subject
[platform-swt-dev] Eclipse 3.0 and FormData classcastexception:






Hello,


We are trying to run our client which works on eclipse 2.1 to run on eclipse 3.0. With code unchanged in the UI, we get this exception :


java.lang.ClassCastException: org.eclipse.swt.layout.FormData

       at org.eclipse.swt.layout.GridLayout.createGrid(GridLayout.java:430)

       at org.eclipse.swt.layout.GridLayout.computeLayoutSize(GridLayout.java:330)

       at org.eclipse.swt.layout.GridLayout.computeSize(GridLayout.java:376)

       at org.eclipse.swt.widgets.Composite.computeSize(Composite.java:157)

       at org.eclipse.swt.layout.FormLayout.computeSize(FormLayout.java:206)

       at org.eclipse.swt.layout.FormLayout.layout(FormLayout.java:242)

       at org.eclipse.swt.layout.FormLayout.layout(FormLayout.java:235)

       at org.eclipse.swt.widgets.Composite.WM_SIZE(Composite.java:859)

       at org.eclipse.swt.widgets.Control.windowProc(Control.java(Compiled Code))

       at org.eclipse.swt.widgets.Display.windowProc(Display.java(Compiled Code))

       at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)

       at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java(Inlined Compiled Code))

       at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java(Compiled Code))

       at org.eclipse.swt.widgets.Control.windowProc(Control.java(Compiled Code))

       at org.eclipse.swt.widgets.Display.windowProc(Display.java(Compiled Code))

       at org.eclipse.swt.internal.win32.OS.EndDeferWindowPos(Native Method)

       at org.eclipse.swt.widgets.Composite.resizeChildren(Composite.java:432)

       at org.eclipse.swt.widgets.Composite.resizeChildren(Composite.java:398)

       at org.eclipse.swt.widgets.Composite.setResizeChildren(Composite.java:499)

       at org.eclipse.swt.widgets.Composite.WM_SIZE(Composite.java:862)

       at org.eclipse.swt.widgets.Control.windowProc(Control.java(Compiled Code))

       at org.eclipse.swt.widgets.Display.windowProc(Display.java(Compiled Code))

       at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)

       at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java(Inlined Compiled Code))

       at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable.java(Compiled Code))




Any suggestions, anyone seen this problem before. The same code works on eclipse 2.1.



-Ram


Back to the top