CCE: o.e.s.l.GridData cannot be cast to o.e.s.l.FillData [message #1717673] |
Tue, 15 December 2015 11:57 |
Eclipse User |
|
|
|
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? 
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.
|
|
|
Powered by
FUDForum. Page generated in 0.24726 seconds