use of com.archimatetool.model.IProfile in project archi by archimatetool.
the class ArchimateConceptTests method testGetPrimaryProfile.
@Test
public void testGetPrimaryProfile() {
assertNull(concept.getPrimaryProfile());
IProfile profile1 = IArchimateFactory.eINSTANCE.createProfile();
IProfile profile2 = IArchimateFactory.eINSTANCE.createProfile();
concept.getProfiles().add(profile1);
concept.getProfiles().add(profile2);
assertSame(profile1, concept.getPrimaryProfile());
}
use of com.archimatetool.model.IProfile in project archi by archimatetool.
the class ModelChecker method checkProfiles.
List<String> checkProfiles(IProfiles profilesObject) {
List<String> messages = new ArrayList<String>();
for (IProfile profile : profilesObject.getProfiles()) {
// $NON-NLS-1$
String name = " " + profile.getId();
// Profile must exist in this model
if (profile.getArchimateModel() != ((IArchimateModelObject) profilesObject).getArchimateModel()) {
messages.add(Messages.ModelChecker_28 + name);
}
// Profile must have matching concept type
EClass eClass = profile.getConceptClass();
if (eClass == null || eClass != profilesObject.eClass()) {
messages.add(Messages.ModelChecker_29 + name);
}
}
return messages;
}
use of com.archimatetool.model.IProfile in project archi by archimatetool.
the class Profile method getCopy.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT
*/
@Override
public EObject getCopy() {
IProfile newObject = EcoreUtil.copy(this);
// need a new ID
newObject.setId(UUIDFactory.createID(newObject));
return newObject;
}
use of com.archimatetool.model.IProfile in project archi by archimatetool.
the class CSVExporterTests method testCreateRelationshipRow.
@Test
public void testCreateRelationshipRow() {
IArchimateElement elementSource = IArchimateFactory.eINSTANCE.createBusinessActor();
elementSource.setId("cfde5463e");
IArchimateElement elementTarget = IArchimateFactory.eINSTANCE.createBusinessActor();
elementTarget.setId("b1234dff");
IArchimateRelationship relation = IArchimateFactory.eINSTANCE.createAccessRelationship();
relation.setId("56435fd6");
relation.setName("My relation");
relation.setDocumentation("This is the Documentation");
relation.setSource(elementSource);
relation.setTarget(elementTarget);
IProfile profile = IArchimateFactory.eINSTANCE.createProfile();
profile.setName("Profile");
relation.getProfiles().add(profile);
assertEquals("\"56435fd6\",\"AccessRelationship\",\"My relation\",\"This is the Documentation\",\"cfde5463e\",\"b1234dff\",\"Profile\"", exporter.createRelationshipRow(relation));
}
use of com.archimatetool.model.IProfile in project archi by archimatetool.
the class SpecializationSection method update.
@Override
protected void update() {
IArchimateModelObject firstSelected = getFirstSelectedObject();
// Check also if the selected object has been deleted in case the Properties View is still showing the object if it has the focus
if (fIsExecutingCommand || !isAlive(getFirstSelectedObject())) {
return;
}
fComboViewer.refresh();
if (firstSelected instanceof IArchimateConcept) {
// A Viewer will get a selectionChanged event when setting it
fIsRefreshing = true;
EList<IProfile> profiles = ((IArchimateConcept) firstSelected).getProfiles();
if (!profiles.isEmpty()) {
fComboViewer.setSelection(new StructuredSelection(profiles.get(0)));
} else {
fComboViewer.setSelection(new StructuredSelection(NONE_PROFILE));
}
fIsRefreshing = false;
}
}
Aggregations