Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » CCE: o.e.s.l.GridData cannot be cast to o.e.s.l.FillData
CCE: o.e.s.l.GridData cannot be cast to o.e.s.l.FillData [message #1717673] Tue, 15 December 2015 16:57
Daniel Mising name is currently offline Daniel Mising nameFriend
Messages: 34
Registered: July 2014
Member
Dear all,

i hope this is the most fitting subforum-section-thingy, please feel free to shove around if you have the power and see a better fit!

While working on migrationstuff i am currently working on some occurences of this (i bluntly suppose) rather well known "challenge".

 java.lang.ClassCastException: org.eclipse.swt.layout.GridData cannot be cast to org.eclipse.swt.layout.FillData


After having studied [1] and [2] ... my conclusion is as follows:

There may be a corresponding layout data class for the parents layout that i can use in the child.setLayoutData(). If parent is layouting FillLayout then i will get the CCE if i set child.setLayoutData(GridData) ... i do not have to use child.setLayoutData() if parent is using FillData (i could not even use FillData as it is not visible for usage ... in contrast to RowData or GridData which are easily usable)

At least i do not get the CCE's any more when removing the child.setLayoutData()'s ... i am just fearing that this solution is only a thin bandaid.

Am i creating problems in other spaces resolving my occuring CCE's this way? Am i to somehow use FillData in child.setLayoutData()'s?

Or am i doin' it rite? Smile

Thank you for reading this far!
Daniel


[1]: http://stackoverflow.com/questions/29127117/nested-swt-composites-with-conflicting-gridlayout

[2]: Citation of http://www.eclipse.org/articles/article.php?file=Article-Understanding-Layouts/index.html:
Quote:
A layout class may have a corresponding layout data class: a subclass of Object that contains layout data for a specific child. By convention, layout data classes are identified by substituting "Data" for "Layout" in the class name. For example, the standard layout class RowLayout has a layout data class called RowData, the layout class GridLayout uses a layout data class called GridData, and the layout class FormLayout has a layout data class called FormData.


Previous Topic:Session restore in eclipse rcp application
Next Topic:Widget is disposed error when migrating RCP3 application to RCP4.
Goto Forum:
  


Current Time: Sun Nov 29 23:32:29 GMT 2020

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

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

Back to the top