Search in sources :

Example 1 with MoveColumnCommand

use of com.cubrid.common.ui.er.commands.MoveColumnCommand in project cubrid-manager by CUBRID.

the class TableLayoutEditPolicy method createMoveChildCommand.

@SuppressWarnings("rawtypes")
@Override
protected Command createMoveChildCommand(EditPart child, EditPart after) {
    if (after == null) {
        return null;
    }
    ERTableColumn childModel = (ERTableColumn) child.getModel();
    ERTable parentTable = (ERTable) getHost().getModel();
    List hostParts = getHost().getChildren();
    int oldIndex = hostParts.indexOf(child);
    int newIndex = hostParts.indexOf(after);
    return new MoveColumnCommand(childModel, parentTable, oldIndex, newIndex);
}
Also used : ERTableColumn(com.cubrid.common.ui.er.model.ERTableColumn) ERTable(com.cubrid.common.ui.er.model.ERTable) List(java.util.List) MoveColumnCommand(com.cubrid.common.ui.er.commands.MoveColumnCommand)

Aggregations

MoveColumnCommand (com.cubrid.common.ui.er.commands.MoveColumnCommand)1 ERTable (com.cubrid.common.ui.er.model.ERTable)1 ERTableColumn (com.cubrid.common.ui.er.model.ERTableColumn)1 List (java.util.List)1