use of org.palladiosimulator.pcm.repository.Repository in project Palladio-Editors-Sirius by PalladioSimulator.
the class RepositoryCreationWizard method init.
@Override
protected void init(IStructuredSelection selection) {
String viewpointName = Activator.VIEWPOINT_NAME;
viewpoint = Activator.getDefault().getViewpoint();
String ext = Activator.getDefault().getViewpoint().getModelFileExtension();
modelCreationPage = new ModelCreationPage(selection, viewpointName + " Creation Wizard", "new" + viewpointName, ext);
representationDescription = Activator.getDefault().getRepresentationDescription();
String defaultRepresentationName = "new " + Activator.REPRESENTATION_NAME;
this.representationCreationPage.setDefaultRepresentationName(defaultRepresentationName);
Repository obj = RepositoryFactory.eINSTANCE.createRepository();
obj.setEntityName("New Repository");
modelObject = obj;
}
use of org.palladiosimulator.pcm.repository.Repository in project Palladio-Editors-Sirius by PalladioSimulator.
the class SetFailureType method execute.
@Override
public void execute(Collection<? extends EObject> selections, Map<String, Object> parameters) {
InternalFailureOccurrenceDescription element = (InternalFailureOccurrenceDescription) parameters.get("instance");
EObjectQuery query = new EObjectQuery(element);
Collection<Resource> resources = query.getSession().getSemanticResources();
boolean found = false;
Resource resource = null;
for (Resource r : resources) {
if (r.getURI().equals(URI.createURI("pathmap://PCM_MODELS/FailureTypes.repository"))) {
found = true;
resource = r;
break;
}
}
if (found) {
Repository rep = (Repository) resource.getContents().iterator().next();
for (EObject o : rep.eContents()) {
FailureType failureType = (FailureType) o;
if (failureType.getEntityName().equals("SoftwareInducedFailure")) {
element.setSoftwareInducedFailureType__InternalFailureOccurrenceDescription(((SoftwareInducedFailureType) failureType));
break;
}
}
}
}
Aggregations