PDA

View Full Version : BorderLayout possible bug



eugenparaschiv
26 Nov 2008, 3:22 AM
GXT 1.1.4

I have been working with the BorderLayout in my app, and there is something I don't get from the code (BorderLayout line 224):



if (east != null) {
if (east.getData("init") == null) {
initPanel(east);
}
BorderLayoutData data = (BorderLayoutData) getLayoutData(east);
if (data.isSplit()) {
initSplitBar(LayoutRegion.WEST, east, data);
} else {
removeSplitBar(LayoutRegion.WEST);
}
...

The simple question is why, when dealing with east, the initSplitBar is called with LayoutRegion.WEST??? Is this a bug?
That line does throw an exception in my app, so I figure it must be. Any ideas?
Cheers.
Eugen.

LINEMAN78
26 Nov 2008, 9:24 AM
Move this to the bug forum.

eugenparaschiv
26 Nov 2008, 11:58 AM
I will, but I wasn't a 100% sure it was a bug.

dijimon
1 Dec 2008, 7:22 AM
Is this definitely a bug?

Looking at the code in 1.1.4, I can see that the opposite region is used in all cases.



if (north.getData("init") == null) {
initPanel(north);
}
if (data.isSplit()) {
initSplitBar(Style.LayoutRegion.SOUTH, north, data);
} else {
removeSplitBar(Style.LayoutRegion.SOUTH);
}


if (south.getData("init") == null) {
initPanel(south);
}
if (data.isSplit()) {
initSplitBar(Style.LayoutRegion.NORTH, south, data);
} else {
removeSplitBar(Style.LayoutRegion.NORTH);
}


if (east != null) {
if (east.getData("init") == null) {
initPanel(east);
}
BorderLayoutData data = (BorderLayoutData) getLayoutData(east);
if (data.isSplit()) {
initSplitBar(Style.LayoutRegion.WEST, east, data);
} else {
removeSplitBar(Style.LayoutRegion.WEST);
}

eugenparaschiv
1 Dec 2008, 7:38 AM
That is the reason I didn't know for sure, but my code still throw an exception there and more to the point, why would the regions be reversed?

dijimon
1 Dec 2008, 7:47 AM
There is definitely a bug with BorderLayout and splits (dragging a split causes my app to freeze) introduced with 1.1.4 and this is confirmed in the Premium forum.

I compared BorderLayout from 1.1.2 with the latest from 1.1.4 and that particular code is no different, so I'm fairly sure that's not the bug.

However, it would be great if someone who knows what the bug is can share with us here in the community forum, so that we can apply a temporary fix until the next release is publicly available.

eugenparaschiv
1 Dec 2008, 8:25 AM
I'll try to post a test case tomorrow, and I still think that the bug is related to the reversal, because my exception is thrown at that exact line.