public void performAction() {
// TF:11/05/2009:Changed this to rely on the layout managers
Set<Container> containersToValidate = new HashSet<Container>();
JComponent thisComponent = (JComponent)this._component;
GridCell cell = GridCell.get(thisComponent);
// First, remove this component from it's old chain, if there is one.
JComponent currentPartner = LayoutManagerHelper.getHeightPartner(thisComponent);
if (currentPartner != null) {
if (currentPartner == this.partner) {
// do nothing
return;
}
else {
JComponent lastInChain = null;
for (JComponent comp = currentPartner; comp != null && comp != thisComponent; comp = LayoutManagerHelper.getHeightPartner(comp)) {
lastInChain = comp;
// Also add the parent of the component to the containers needing laying out
Container parent = comp.getParent();
if (parent != null) {
containersToValidate.add(parent);
}
}
if (lastInChain != null) {
// We need to set the partner of the last in the chain to the current partner, skipping this component
LayoutManagerHelper.setHeightPartner(lastInChain, currentPartner);
}
}
}
// We now need to run around the partnership chain, possibly inserting this element in the chain,
// setting all the size policies to TO_PARTNER and marking all the containers to be validated
cell.setHeightPolicy(Constants.SP_TO_PARTNER);
LayoutManagerHelper.setHeightPartner(thisComponent, this.partner);
JComponent lastInChain = null;
for (JComponent comp = this.partner; comp != null && comp != thisComponent; comp = LayoutManagerHelper.getHeightPartner(comp)) {
lastInChain = comp;
// Also add the parent of the component to the containers needing laying out