use of org.palladiosimulator.editors.commons.dialogs.selection.PalladioSelectEObjectDialog in project Palladio-Editors-Sirius by PalladioSimulator.
the class AddProcessingResourceSpecification method getResourceType.
private ProcessingResourceType getResourceType(final ProcessingResourceSpecification processingResourceSpecification) {
// positive filter
final ArrayList<Object> filterList = new ArrayList<Object>();
// Set types to show and their super types
filterList.add(ProcessingResourceType.class);
filterList.add(ResourceRepository.class);
final ArrayList<EReference> additionalReferences = new ArrayList<EReference>();
// set EReference that should be set (in this case: active resource type)
additionalReferences.add(ResourceenvironmentPackage.eINSTANCE.getProcessingResourceSpecification_ActiveResourceType_ActiveResourceSpecification());
final PalladioSelectEObjectDialog dialog = new PalladioSelectEObjectDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), filterList, additionalReferences, processingResourceSpecification.getResourceContainer_ProcessingResourceSpecification().eResource().getResourceSet());
dialog.setProvidedService(ProcessingResourceType.class);
dialog.open();
if (dialog.getResult() == null || !(dialog.getResult() instanceof ProcessingResourceType)) {
return null;
}
return (ProcessingResourceType) dialog.getResult();
}
use of org.palladiosimulator.editors.commons.dialogs.selection.PalladioSelectEObjectDialog in project Palladio-Editors-Sirius by PalladioSimulator.
the class AddCollectionIteratorAction method getParameter.
private Parameter getParameter(CollectionIteratorAction action, ServiceEffectSpecification seff) {
Collection<Object> filter = new ArrayList<Object>();
filter.add(Repository.class);
filter.add(Interface.class);
filter.add(Signature.class);
filter.add(Parameter.class);
Collection<EReference> additionalChildReferences = new ArrayList<EReference>();
PalladioSelectEObjectDialog dialog = new PalladioSelectEObjectDialog(SHELL, filter, additionalChildReferences, action.eResource().getResourceSet());
dialog.setProvidedService(Parameter.class);
for (Object o : dialog.getTreeViewer().getExpandedElements()) {
if (o instanceof Signature) {
if (!o.equals(seff.getDescribedService__SEFF())) {
dialog.getTreeViewer().remove(o);
continue;
}
EList<Parameter> parameters = null;
if (o instanceof OperationSignature)
parameters = ((OperationSignature) o).getParameters__OperationSignature();
else if (o instanceof InfrastructureSignature) {
parameters = ((InfrastructureSignature) o).getParameters__InfrastructureSignature();
}
for (Parameter p : parameters) {
if (!(p.getDataType__Parameter() instanceof CollectionDataType))
dialog.getTreeViewer().remove(p);
}
}
}
dialog.open();
return (Parameter) dialog.getResult();
}
use of org.palladiosimulator.editors.commons.dialogs.selection.PalladioSelectEObjectDialog in project Palladio-Editors-Sirius by PalladioSimulator.
the class SetRequiredResource method getProcessingResourceType.
private ProcessingResourceType getProcessingResourceType(ParametricResourceDemand rd) {
Collection<Object> filter = new ArrayList<Object>();
filter.add(ResourceRepository.class);
filter.add(ProcessingResourceType.class);
// Additional Child References
Collection<EReference> additionalChildReferences = new ArrayList<EReference>();
// Creating the dialog
PalladioSelectEObjectDialog dialog = new PalladioSelectEObjectDialog(SHELL, filter, additionalChildReferences, rd.eResource().getResourceSet());
// Setting the needed object type
dialog.setProvidedService(ProcessingResourceType.class);
dialog.open();
return (ProcessingResourceType) dialog.getResult();
}
use of org.palladiosimulator.editors.commons.dialogs.selection.PalladioSelectEObjectDialog in project Palladio-Editors-Sirius by PalladioSimulator.
the class SetResourceCallRequiredRole method getSignature.
private ResourceRequiredRole getSignature(final ResourceCall call) {
Collection<Object> filter = new ArrayList<Object>();
filter.add(Repository.class);
filter.add(ResourceRequiredRole.class);
filter.add(BasicComponent.class);
filter.add(ResourceInterface.class);
Collection<EReference> additionalChildReferences = new ArrayList<EReference>();
PalladioSelectEObjectDialog dialog = new PalladioSelectEObjectDialog(SHELL, filter, additionalChildReferences, call.eResource().getResourceSet());
dialog.setProvidedService(ResourceRequiredRole.class);
dialog.open();
return (ResourceRequiredRole) dialog.getResult();
}
use of org.palladiosimulator.editors.commons.dialogs.selection.PalladioSelectEObjectDialog in project Palladio-Editors-Sirius by PalladioSimulator.
the class EntryLevelSystemCallDialog method getOperationSignature.
private OperationSignature getOperationSignature(EntryLevelSystemCall element) {
Collection<Object> filter = new ArrayList<Object>();
filter.add(Repository.class);
filter.add(OperationInterface.class);
filter.add(OperationSignature.class);
Collection<EReference> additionalChildReferences = new ArrayList<EReference>();
PalladioSelectEObjectDialog dialog = new PalladioSelectEObjectDialog(SHELL, filter, additionalChildReferences, element.eResource().getResourceSet());
dialog.setProvidedService(OperationSignature.class);
for (Object o : dialog.getTreeViewer().getExpandedElements()) {
if (!(o instanceof OperationInterface))
continue;
OperationInterface oi = (OperationInterface) o;
if (!element.getProvidedRole_EntryLevelSystemCall().getProvidedInterface__OperationProvidedRole().equals(oi))
dialog.getTreeViewer().remove(o);
}
dialog.open();
return (OperationSignature) dialog.getResult();
}
Aggregations