Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » JFace Dialog - get ClassCastException when opening a JFace Dialog from a RCP application
JFace Dialog - get ClassCastException when opening a JFace Dialog from a RCP application [message #334662] Mon, 23 February 2009 21:36 Go to next message
Eclipse UserFriend
Originally posted by: james.towers.siemens.com

I am trying to create a simple test case that shows a strange AIX only
problem we are getting in our RCP application (I will post the AIX
question in a separate post). In my Application class I create and open
a dialog that extends JFace dialog. In the configureShell() method
I call super.configureShell() and set the title. The Shell gets a
GridLayout from the super. In the createDialogArea() method I create a
new Composite to hold my Controls. I give this new Composite a
FormLayout...the added controls have FormData. When I open our dialog I
get the ClassCastException...below is a snippet of the exception that
originates from dlg.open().

Is it incorrect to have a GridLayout() on the Shell and a FormLayout()
for the DialogArea?

Thanks and regards,
Jim

java.lang.ClassCastException: org.eclipse.swt.layout.FormData
at org.eclipse.swt.layout.GridLayout.layout(GridLayout.java:201 )
at org.eclipse.swt.layout.GridLayout.computeSize(GridLayout.jav a:159)
at org.eclipse.swt.widgets.Composite.computeSize(Composite.java :219)
at org.eclipse.swt.layout.GridData.computeSize(GridData.java:47 8)
at org.eclipse.swt.layout.GridLayout.layout(GridLayout.java:214 )
Re: JFace Dialog - get ClassCastException when opening a JFace Dialog from a RCP application [message #334669 is a reply to message #334662] Tue, 24 February 2009 06:48 Go to previous messageGo to next message
Prakash G.R. is currently offline Prakash G.R.Friend
Messages: 621
Registered: July 2009
Senior Member
I guess in one of the controls, you are wrong passing the shell as parent
rather than the composite.

- Prakash
--

http://blog.eclipse-tips.com
Re: JFace Dialog - get ClassCastException when opening a JFace Dialog from a RCP application [message #334674 is a reply to message #334669] Tue, 24 February 2009 12:27 Go to previous message
Eclipse UserFriend
Originally posted by: james.towers.siemens.com

Prakash G.R. wrote:
> I guess in one of the controls, you are wrong passing the shell as parent
> rather than the composite.
>
> - Prakash
Thank you Prakash. You are correct. I fixed the control and all is
fine now.
Regards,
Jim
Previous Topic:How do I activate the Quick Fix command in a context menu?
Next Topic:core.tools on 3.4?
Goto Forum:
  


Current Time: Thu Apr 25 12:03:52 GMT 2024

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

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

Back to the top