int (RadComponent component, boolean horizontal) { CellConstraints cc = (CellConstraints) component.getCustomLayoutConstraints(); CellConstraints.Alignment al = horizontal ? cc.hAlign : cc.vAlign; if (al == CellConstraints.DEFAULT) { FormLayout formLayout = (FormLayout) component.getParent().getLayout(); FormSpec formSpec = horizontal ? formLayout.getColumnSpec(component.getConstraints().getColumn()+1) : formLayout.getRowSpec(component.getConstraints().getRow()+1); final FormSpec.DefaultAlignment defaultAlignment = formSpec.getDefaultAlignment(); if (defaultAlignment.equals(RowSpec.FILL)) { return GridConstraints.ALIGN_FILL; } if (defaultAlignment.equals(RowSpec.TOP) || defaultAlignment.equals(ColumnSpec.LEFT)) { return GridConstraints.ALIGN_LEFT; } if (defaultAlignment.equals(RowSpec.CENTER)) { return GridConstraints.ALIGN_CENTER; } return GridConstraints.ALIGN_RIGHT; } return Utils.alignFromConstraints(component.getConstraints(), horizontal); }