use of com.archimatetool.model.IArchimateElement in project archi by archimatetool.
the class ZestViewerContentProvider method getElements.
@Override
public Object[] getElements(Object inputElement) {
if (inputElement instanceof IArchimateConcept) {
IArchimateConcept archimateConcept = (IArchimateConcept) inputElement;
// Check if it was deleted
if (archimateConcept.eContainer() == null) {
return new Object[0];
}
// Relationship
if (archimateConcept instanceof IArchimateRelationship) {
return new Object[] { inputElement };
}
// Element - Get its relationships
if (archimateConcept instanceof IArchimateElement) {
List<IArchimateRelationship> mainList = new ArrayList<IArchimateRelationship>();
getRelations(mainList, new ArrayList<IArchimateConcept>(), archimateConcept, 0);
return mainList.toArray();
}
}
return new Object[0];
}
use of com.archimatetool.model.IArchimateElement in project archi by archimatetool.
the class ArchimateDiagramEditPartFactoryTests method testArchimateObjectEditPart.
@Test
public void testArchimateObjectEditPart() {
IArchimateElement element = IArchimateFactory.eINSTANCE.createBusinessActor();
IDiagramModelArchimateObject dmo = IArchimateFactory.eINSTANCE.createDiagramModelArchimateObject();
dmo.setArchimateElement(element);
EditPart editPart = editPartFactory.createEditPart(null, dmo);
assertTrue(editPart instanceof ArchimateElementEditPart);
assertEquals(dmo, editPart.getModel());
}
use of com.archimatetool.model.IArchimateElement in project archi by archimatetool.
the class CSVExporterTests method testCreateElementRow_WithLeadingCharsHack.
@Test
public void testCreateElementRow_WithLeadingCharsHack() {
IArchimateElement element = IArchimateFactory.eINSTANCE.createBusinessActor();
element.setId("087dfa23");
element.setName(" The Main Man");
element.setDocumentation("0123");
exporter.setUseLeadingCharsHack(true);
assertEquals("\"=\"\"087dfa23\"\"\",\"BusinessActor\",\"=\"\" The Main Man\"\"\",\"=\"\"0123\"\"\"", exporter.createElementRow(element));
}
use of com.archimatetool.model.IArchimateElement in project archi by archimatetool.
the class CSVExporterTests method testCreateElementRow_WithNewLinesStripped.
@Test
public void testCreateElementRow_WithNewLinesStripped() {
IArchimateElement element = IArchimateFactory.eINSTANCE.createBusinessActor();
element.setId("d452fda");
element.setName("The Main Man");
element.setDocumentation("This is the\r\nDocumentation");
exporter.setStripNewLines(true);
assertEquals("\"d452fda\",\"BusinessActor\",\"The Main Man\",\"This is the Documentation\"", exporter.createElementRow(element));
}
use of com.archimatetool.model.IArchimateElement in project archi by archimatetool.
the class CSVExporterTests method testCreatePropertyRow_Property.
@Test
public void testCreatePropertyRow_Property() {
IArchimateElement element = IArchimateFactory.eINSTANCE.createBusinessActor();
element.setId("1234567a");
IProperty property = IArchimateFactory.eINSTANCE.createProperty();
property.setKey("Some key");
property.setValue("Some value");
element.getProperties().add(property);
assertEquals("\"1234567a\",\"Some key\",\"Some value\"", exporter.createPropertyRow(element.getId(), property));
}
Aggregations