use of com.cubrid.common.ui.er.commands.TransferColumnCommand in project cubrid-manager by CUBRID.
the class TableLayoutEditPolicy method createAddCommand.
@Override
protected Command createAddCommand(EditPart child, EditPart after) {
if (!(child instanceof ColumnPart) || !(after instanceof ColumnPart)) {
return null;
}
ERTableColumn toMove = (ERTableColumn) child.getModel();
ERTableColumn afterModel = (ERTableColumn) after.getModel();
TablePart originalTablePart = (TablePart) child.getParent();
ERTable originalTable = (ERTable) originalTablePart.getModel();
TablePart newTablePart = (TablePart) after.getParent();
ERTable newTable = newTablePart.getTable();
int oldIndex = originalTablePart.getChildren().indexOf(child);
int newIndex = newTablePart.getChildren().indexOf(after);
return new TransferColumnCommand(toMove, afterModel, originalTable, newTable, oldIndex, newIndex);
}
Aggregations