Search in sources :

Example 1 with PassiveResource

use of org.palladiosimulator.pcm.repository.PassiveResource in project Palladio-Editors-Sirius by PalladioSimulator.

the class AddAcquireAction method getPassiveResource.

private PassiveResource getPassiveResource(AcquireAction acquireAction) {
    Collection<Object> filter = new ArrayList<Object>();
    filter.add(Repository.class);
    filter.add(BasicComponent.class);
    filter.add(PassiveResource.class);
    // Additional Child References
    Collection<EReference> additionalChildReferences = new ArrayList<EReference>();
    // additionalChildReferences.add(RepositoryPackage.Literals.PASSIVE_RESOURCE__BASIC_COMPONENT_PASSIVE_RESOURCE);
    // Creating the dialog
    PalladioSelectEObjectDialog dialog = new PalladioSelectEObjectDialog(SHELL, filter, additionalChildReferences, acquireAction.eResource().getResourceSet());
    // Setting the needed object type
    dialog.setProvidedService(PassiveResource.class);
    dialog.open();
    return (PassiveResource) dialog.getResult();
}
Also used : PassiveResource(org.palladiosimulator.pcm.repository.PassiveResource) PalladioSelectEObjectDialog(org.palladiosimulator.editors.commons.dialogs.selection.PalladioSelectEObjectDialog) ArrayList(java.util.ArrayList) EObject(org.eclipse.emf.ecore.EObject) EReference(org.eclipse.emf.ecore.EReference)

Example 2 with PassiveResource

use of org.palladiosimulator.pcm.repository.PassiveResource in project Palladio-Editors-Sirius by PalladioSimulator.

the class AddReleaseAction method getPassiveResource.

private PassiveResource getPassiveResource(ReleaseAction releaseAction) {
    Collection<Object> filter = new ArrayList<Object>();
    filter.add(Repository.class);
    filter.add(BasicComponent.class);
    filter.add(PassiveResource.class);
    // Additional Child References
    Collection<EReference> additionalChildReferences = new ArrayList<EReference>();
    // Creating the dialog
    PalladioSelectEObjectDialog dialog = new PalladioSelectEObjectDialog(SHELL, filter, additionalChildReferences, releaseAction.eResource().getResourceSet());
    // Setting the needed object type
    dialog.setProvidedService(PassiveResource.class);
    dialog.open();
    return (PassiveResource) dialog.getResult();
}
Also used : PassiveResource(org.palladiosimulator.pcm.repository.PassiveResource) PalladioSelectEObjectDialog(org.palladiosimulator.editors.commons.dialogs.selection.PalladioSelectEObjectDialog) ArrayList(java.util.ArrayList) EObject(org.eclipse.emf.ecore.EObject) EReference(org.eclipse.emf.ecore.EReference)

Example 3 with PassiveResource

use of org.palladiosimulator.pcm.repository.PassiveResource in project Palladio-Editors-Sirius by PalladioSimulator.

the class AddAcquireAction method execute.

@Override
public void execute(Collection<? extends EObject> selections, Map<String, Object> parameters) {
    AcquireAction acquireAction = (AcquireAction) parameters.get("instance");
    PassiveResource passiveResource = getPassiveResource(acquireAction);
    acquireAction.setPassiveresource_AcquireAction(passiveResource);
}
Also used : AcquireAction(org.palladiosimulator.pcm.seff.AcquireAction) PassiveResource(org.palladiosimulator.pcm.repository.PassiveResource)

Example 4 with PassiveResource

use of org.palladiosimulator.pcm.repository.PassiveResource in project Palladio-Editors-Sirius by PalladioSimulator.

the class AddReleaseAction method execute.

@Override
public void execute(Collection<? extends EObject> selections, Map<String, Object> parameters) {
    ReleaseAction releaseAction = (ReleaseAction) parameters.get("instance");
    PassiveResource passiveResource = getPassiveResource(releaseAction);
    releaseAction.setPassiveResource_ReleaseAction(passiveResource);
}
Also used : PassiveResource(org.palladiosimulator.pcm.repository.PassiveResource) ReleaseAction(org.palladiosimulator.pcm.seff.ReleaseAction)

Aggregations

PassiveResource (org.palladiosimulator.pcm.repository.PassiveResource)4 ArrayList (java.util.ArrayList)2 EObject (org.eclipse.emf.ecore.EObject)2 EReference (org.eclipse.emf.ecore.EReference)2 PalladioSelectEObjectDialog (org.palladiosimulator.editors.commons.dialogs.selection.PalladioSelectEObjectDialog)2 AcquireAction (org.palladiosimulator.pcm.seff.AcquireAction)1 ReleaseAction (org.palladiosimulator.pcm.seff.ReleaseAction)1