return oldanchor.equals(anchor);
}
public void run() {
if (!shouldChecked()) {
IUndoableOperation operation = null;
CompositeAdapter containerAdapter = (CompositeAdapter) WidgetAdapter
.getWidgetAdapter(container);
Constraints constraints = (Constraints) containerAdapter
.getChildConstraints(child);
if (horizontal) {
Alignment alignment = constraints.getHorizontal();
if (alignment instanceof Leading) {
if (anchor.equals("bilateral")) {
operation = new HorizontalLeadingToBilateral(
constraints, container, child);
} else if (anchor.equals("trailing")) {
operation = new HorizontalLeadingToTrailing(constraints, container, child);
}
} else if (alignment instanceof Bilateral) {
if (anchor.equals("leading")) {
operation = new HorizontalBilateralToLeading(constraints, container, child);
} else if (anchor.equals("trailing")) {
operation = new HorizontalBilateralToTrailing(constraints, container, child);
}
} else if (alignment instanceof Trailing) {
if (anchor.equals("leading")) {
operation = new HorizontalTrailingToLeading(constraints, container, child);
} else if (anchor.equals("bilateral")) {
operation = new HorizontalTrailingToBilteral(constraints, container, child);
}
}
} else {
Alignment alignment = constraints.getVertical();
if (alignment instanceof Leading) {
if (anchor.equals("bilateral")) {
operation = new VerticalLeadingToBilateral(
constraints, container, child);
} else if (anchor.equals("trailing")) {
operation = new VerticalLeadingToTrailing(constraints, container, child);
}
} else if (alignment instanceof Bilateral) {
if (anchor.equals("leading")) {
operation = new VerticalBilateralToLeading(constraints, container, child);
} else if (anchor.equals("trailing")) {
operation = new VerticalBilateralToTrailing(constraints, container, child);
}
} else if (alignment instanceof Trailing) {
if (anchor.equals("leading")) {
operation = new VerticalTrailingToLeading(constraints, container, child);
} else if (anchor.equals("bilateral")) {
operation = new VerticalTrailingToBilteral(constraints, container, child);
}
}
}
if (operation != null) {
WidgetAdapter adapter = WidgetAdapter
.getWidgetAdapter(container);
operation.addContext(adapter.getUndoContext());
IOperationHistory operationHistory = PlatformUI.getWorkbench()
.getOperationSupport().getOperationHistory();
try {
operationHistory.execute(operation, null, null);
} catch (ExecutionException e) {