blob: 325d88029909cf0b3debae0ccab16a09d348da86 [file] [log] [blame]
/**
*
* Copyright (c) 2011, 2016 - Lunifera GmbH (Gross Enzersdorf), Loetz GmbH&Co.KG (69115 Heidelberg, Germany)
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Florian Pirchner (Lunifera GmbH) - initial implementation
*/
package org.eclipse.osbp.tools.graphical.entity.lib;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Map;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.osbp.dsl.semantic.entity.LBean;
import org.eclipse.sirius.business.api.helper.SiriusUtil;
import org.eclipse.sirius.business.api.session.Session;
import org.eclipse.sirius.business.api.session.SessionManager;
import org.eclipse.sirius.tools.api.ui.IExternalJavaAction;
public class LBeanDeletion implements IExternalJavaAction {
public LBeanDeletion() {
}
@Override
public void execute(Collection<? extends EObject> selections,
Map<String, Object> parameters) {
LBean bean = (LBean) new ArrayList<EObject>(selections).get(0);
Session session = SessionManager.INSTANCE.getSession(bean);
SiriusUtil.delete(bean, session);
}
@Override
public boolean canExecute(Collection<? extends EObject> selections) {
return true;
}
}