Search in sources :

Example 16 with BusinessAssignment

use of org.talend.designer.business.model.business.BusinessAssignment 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;
}
Also used : BusinessAssignment(org.talend.designer.business.model.business.BusinessAssignment) UnassignTalendItemsFromBusinessAssignmentCommand(org.talend.designer.business.diagram.custom.commands.UnassignTalendItemsFromBusinessAssignmentCommand) Iterator(java.util.Iterator) BusinessItem(org.talend.designer.business.model.business.BusinessItem)

Aggregations

BusinessAssignment (org.talend.designer.business.model.business.BusinessAssignment)16 List (java.util.List)9 TalendItem (org.talend.designer.business.model.business.TalendItem)8 ArrayList (java.util.ArrayList)6 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)6 BusinessItem (org.talend.designer.business.model.business.BusinessItem)6 Routine (org.talend.designer.business.model.business.Routine)5 SQLPattern (org.talend.designer.business.model.business.SQLPattern)5 Iterator (java.util.Iterator)4 EObject (org.eclipse.emf.ecore.EObject)4 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)4 PersistenceException (org.talend.commons.exception.PersistenceException)4 MetadataTable (org.talend.core.model.metadata.builder.connection.MetadataTable)4 SAPFunctionUnit (org.talend.core.model.metadata.builder.connection.SAPFunctionUnit)4 View (org.eclipse.gmf.runtime.notation.View)3 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)3 Query (org.talend.core.model.metadata.builder.connection.Query)3 RepositoryNode (org.talend.repository.model.RepositoryNode)3 HashMap (java.util.HashMap)2 EStructuralFeature (org.eclipse.emf.ecore.EStructuralFeature)2