use of org.talend.designer.business.diagram.custom.commands.UnassignTalendItemsFromBusinessAssignmentCommand in project tdi-studio-se by Talend.
the class AssignmentPropertySection method executeDeleteCommand.
private void executeDeleteCommand(IStructuredSelection structuredSelection) {
UnassignTalendItemsFromBusinessAssignmentCommand command = new UnassignTalendItemsFromBusinessAssignmentCommand(getEditingDomain(), true);
for (Iterator iter = structuredSelection.iterator(); iter.hasNext(); ) {
Object object = (Object) iter.next();
if (object instanceof BusinessAssignment) {
BusinessAssignment businessAssignment = (BusinessAssignment) object;
command.addBusinessAssignment(businessAssignment);
}
}
List<ICommand> commands = new ArrayList<ICommand>();
commands.add(command);
//$NON-NLS-1$
executeAsCompositeCommand(Messages.getString("AssignmentPropertySection.DeleteAssignment"), commands);
}
use of org.talend.designer.business.diagram.custom.commands.UnassignTalendItemsFromBusinessAssignmentCommand in project tdi-studio-se by Talend.
the class BusinessBaseEditHelper method getDestroyElementCommand.
/**
* @generated NOT
*/
protected ICommand getDestroyElementCommand(DestroyElementRequest req) {
if (req.getElementToDestroy() != null) {
if (req.getElementToDestroy() instanceof BusinessItem) {
BusinessItem businessItem = (BusinessItem) req.getElementToDestroy();
if (businessItem.getAssignments().size() > 0) {
UnassignTalendItemsFromBusinessAssignmentCommand command = new UnassignTalendItemsFromBusinessAssignmentCommand(req.getEditingDomain(), false);
for (Iterator iter = businessItem.getAssignments().iterator(); iter.hasNext(); ) {
BusinessAssignment businessAssignment = (BusinessAssignment) iter.next();
command.addBusinessAssignment(businessAssignment);
}
return command;
}
}
}
return null;
}
Aggregations