Search in sources :

Example 1 with TransferColumnCommand

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);
}
Also used : ERTableColumn(com.cubrid.common.ui.er.model.ERTableColumn) TablePart(com.cubrid.common.ui.er.part.TablePart) TransferColumnCommand(com.cubrid.common.ui.er.commands.TransferColumnCommand) ColumnPart(com.cubrid.common.ui.er.part.ColumnPart) ERTable(com.cubrid.common.ui.er.model.ERTable)

Aggregations

TransferColumnCommand (com.cubrid.common.ui.er.commands.TransferColumnCommand)1 ERTable (com.cubrid.common.ui.er.model.ERTable)1 ERTableColumn (com.cubrid.common.ui.er.model.ERTableColumn)1 ColumnPart (com.cubrid.common.ui.er.part.ColumnPart)1 TablePart (com.cubrid.common.ui.er.part.TablePart)1