else if (index != -1) {
// Verify for locked index
Component[] components = toolWindowBarContainer.getComponents();
for (Component component : components) {
TableLayoutConstraints constraints = toolWindowBarContainerLayout.getConstraints(component);
if (constraints.col1 >= finalCol) {
if (((RepresentativeAnchorWrapper) component).getDockableDescriptor().isAnchorPositionLocked()) {
finalCol += 2;
index++;
}
}
}
}
if (index >= 0) {
Component[] components = toolWindowBarContainer.getComponents();
Map<Integer, Double> olds = new Hashtable<Integer, Double>();
for (Component component : components) {
TableLayoutConstraints constraints = toolWindowBarContainerLayout.getConstraints(component);
if (constraints.col1 >= finalCol) {
int newCol1 = constraints.col1 + 2;
toolWindowBarContainerLayout.setConstraints(component,
new TableLayoutConstraints(
newCol1 + ",1,"
));
olds.put(newCol1, toolWindowBarContainerLayout.getColumn(newCol1));
Double colSize = olds.get(constraints.col1);
if (colSize == null)
colSize = toolWindowBarContainerLayout.getColumn(constraints.col1);
toolWindowBarContainerLayout.setColumn(newCol1, colSize);
}
}
toolWindowBarContainerLayout.setColumn(finalCol, TableLayout.PREFERRED);
toolWindowBarContainer.add(representativeAnchor, (index * 2 + 2) + ",1");
} else
toolWindowBarContainer.add(representativeAnchor, (toolWindowBarContainerLayout.getNumColumn() - 1) + ",1");
} else {
toolWindowBarContainerLayout.insertRow(toolWindowBarContainerLayout.getNumRow(),
toolWindowBarContainerLayout.getNumRow() > 0 ? 5 : 1);
toolWindowBarContainerLayout.insertRow(toolWindowBarContainerLayout.getNumRow(),
TableLayout.PREFERRED);
// validate index...
int finalRow = (index * 2 + 2);
if (finalRow >= toolWindowBarContainerLayout.getNumRow())
index = -1;
else if (index != -1) {
// Verify for locked index
Component[] components = toolWindowBarContainer.getComponents();
for (Component component : components) {
TableLayoutConstraints constraints = toolWindowBarContainerLayout.getConstraints(component);
if (constraints.row1 >= finalRow) {
if (((RepresentativeAnchorWrapper) component).getDockableDescriptor().isAnchorPositionLocked()) {
finalRow += 2;
index++;
}
}
}
}
if (index >= 0) {
Component[] components = toolWindowBarContainer.getComponents();
Map<Integer, Double> olds = new Hashtable<Integer, Double>();
for (Component component : components) {
TableLayoutConstraints constraints = toolWindowBarContainerLayout.getConstraints(component);
if (constraints.row1 >= finalRow) {
int newRow1 = constraints.row1 + 2;
toolWindowBarContainerLayout.setConstraints(component,
new TableLayoutConstraints(
"1," + newRow1
));
olds.put(newRow1, toolWindowBarContainerLayout.getRow(newRow1));
Double rowSize = olds.get(constraints.row1);