use of org.talend.sqlbuilder.erdiagram.ui.commands.DeleteTableCommand in project tdi-studio-se by Talend.
the class TableEditPolicy method createDeleteCommand.
@Override
protected Command createDeleteCommand(GroupRequest deleteRequest) {
Object parent = getHost().getParent().getModel();
if (!(parent instanceof ErDiagram)) {
return null;
}
List<Table> nodeList = new ArrayList<Table>();
for (int i = 0; i < deleteRequest.getEditParts().size(); i++) {
if (deleteRequest.getEditParts().get(i) instanceof TablePart) {
nodeList.add((Table) ((TablePart) deleteRequest.getEditParts().get(i)).getModel());
}
}
DeleteTableCommand command = new DeleteTableCommand((ErDiagram) parent, nodeList);
return command;
}
Aggregations