use of org.palladiosimulator.pcm.repository.EventGroup in project Palladio-Editors-Sirius by PalladioSimulator.
the class AddSourceRole method getEventGroup.
private EventGroup getEventGroup(SourceRole role) {
Collection<Object> filter = new ArrayList<Object>();
filter.add(Repository.class);
filter.add(EventGroup.class);
// Additional Child References
Collection<EReference> additionalChildReferences = new ArrayList<EReference>();
// Creating the dialog
PalladioSelectEObjectDialog dialog = new PalladioSelectEObjectDialog(SHELL, filter, additionalChildReferences, role.eResource().getResourceSet());
// Setting the needed object type
dialog.setProvidedService(EventGroup.class);
dialog.open();
return (EventGroup) dialog.getResult();
}
use of org.palladiosimulator.pcm.repository.EventGroup in project Palladio-Editors-Sirius by PalladioSimulator.
the class AddSourceRole method execute.
@Override
public void execute(Collection<? extends EObject> selection, Map<String, Object> parameters) {
SourceRole role = (SourceRole) parameters.get("instance");
EventGroup eventGroup = getEventGroup(role);
role.setEventGroup__SourceRole(eventGroup);
}
use of org.palladiosimulator.pcm.repository.EventGroup in project Palladio-Editors-Sirius by PalladioSimulator.
the class EventGroupTableLifecycleManager method setPropertySection.
@Override
protected void setPropertySection(Composite parent) {
editorSection = new EventTypesEditorSection(parent);
editorSection.setViewerContentProvider(new AdapterFactoryContentProvider(adapterFactory));
editorSection.setViewerLabelProvider(new AdapterFactoryLabelProvider(new EventTypesTabItemProviderAdapterFactory(new PalladioItemProviderAdapterFactory(adapterFactory))));
EventGroup input = (EventGroup) controller.getValue();
editorSection.setViewerInput(input);
((EventTypesEditorSection) editorSection).getAddButtonListener().setSelectedInterface((EventGroup) input);
}
use of org.palladiosimulator.pcm.repository.EventGroup in project Palladio-Editors-Sirius by PalladioSimulator.
the class AddEmitEventAction method getEventType.
private EventType getEventType(EmitEventAction emitEventAction) {
Collection<Object> filter = new ArrayList<Object>();
filter.add(Repository.class);
filter.add(EventGroup.class);
filter.add(EventType.class);
Collection<EReference> additionalChildReferences = new ArrayList<EReference>();
PalladioSelectEObjectDialog dialog = new PalladioSelectEObjectDialog(SHELL, filter, additionalChildReferences, emitEventAction.eResource().getResourceSet());
dialog.setProvidedService(EventType.class);
// Only show EventTypes from EventGroups from SourceRoles of the parent BasicComponent
for (Object o : dialog.getTreeViewer().getExpandedElements()) {
if (!(o instanceof EventGroup))
continue;
ServiceEffectSpecification seff = SEFFUtil.getEnclosingSEFF(emitEventAction.getResourceDemandingBehaviour_AbstractAction());
BasicComponent parent = seff.getBasicComponent_ServiceEffectSpecification();
boolean found = false;
for (RequiredRole r : parent.getRequiredRoles_InterfaceRequiringEntity()) {
if (!(r instanceof SourceRole))
continue;
SourceRole sourceRole = (SourceRole) r;
if (sourceRole.getEventGroup__SourceRole().equals(o)) {
found = true;
emitEventAction.setSourceRole__EmitEventAction(sourceRole);
}
}
if (!found)
dialog.getTreeViewer().remove(o);
}
dialog.open();
return (EventType) dialog.getResult();
}
use of org.palladiosimulator.pcm.repository.EventGroup in project Palladio-Editors-Sirius by PalladioSimulator.
the class AddSinkRole method execute.
@Override
public void execute(Collection<? extends EObject> selection, Map<String, Object> parameters) {
SinkRole role = (SinkRole) parameters.get("instance");
EventGroup eventGroup = getEventGroup(role);
role.setEventGroup__SinkRole(eventGroup);
}
Aggregations