Search in sources :

Example 1 with Profile

use of org.modelversioning.emfprofile.Profile in project Palladio-Editors-Sirius by PalladioSimulator.

the class ApplyUnapplyProfileAction method execute.

@SuppressWarnings("unchecked")
@Override
public void execute(final Collection<? extends EObject> selections, final Map<String, Object> parameters) {
    final EObject target = ((DSemanticDecorator) selections.iterator().next()).getTarget();
    final Resource targetResource = target.eResource();
    final FeatureEditorDialog profileSelectionDialog = new FeatureEditorDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), LABEL_PROVIDER, target, target.eClass().getEAllStructuralFeatures().get(0).getEType(), ProfileAPI.getAppliedProfiles(targetResource), SELECT_APPLIED_PROFILES_MESSAGE, ProfileAPI.getApplicableProfiles(), false, true, true);
    if (profileSelectionDialog.open() == Dialog.OK) {
        ProfileAPI.updateProfileApplications(targetResource, (EList<Profile>) profileSelectionDialog.getResult());
    }
}
Also used : DSemanticDecorator(org.eclipse.sirius.viewpoint.DSemanticDecorator) FeatureEditorDialog(org.eclipse.emf.edit.ui.celleditor.FeatureEditorDialog) EObject(org.eclipse.emf.ecore.EObject) Resource(org.eclipse.emf.ecore.resource.Resource) Profile(org.modelversioning.emfprofile.Profile)

Aggregations

EObject (org.eclipse.emf.ecore.EObject)1 Resource (org.eclipse.emf.ecore.resource.Resource)1 FeatureEditorDialog (org.eclipse.emf.edit.ui.celleditor.FeatureEditorDialog)1 DSemanticDecorator (org.eclipse.sirius.viewpoint.DSemanticDecorator)1 Profile (org.modelversioning.emfprofile.Profile)1