use of com.archimatetool.model.IFolder in project archi by archimatetool.
the class Archimate2To3Handler method convertDerivedFolder.
private void convertDerivedFolder(IArchimateModel model, IFolder derivedFolder) {
IFolder relationsFolder = model.getFolder(FolderType.RELATIONS);
if (relationsFolder != null) {
for (EObject eObject : new ArrayList<EObject>(derivedFolder.eContents())) {
relationsFolder.getElements().add(eObject);
}
}
model.getFolders().remove(derivedFolder);
}
use of com.archimatetool.model.IFolder in project archi by archimatetool.
the class ArchimateModel method createDefaultFolder.
private void createDefaultFolder(FolderType folderType, String folderName, int index) {
if (getFolder(folderType) == null) {
IFolder folder = IArchimateFactory.eINSTANCE.createFolder();
folder.setType(folderType);
folder.setName(folderName);
getFolders().add(index, folder);
}
}
use of com.archimatetool.model.IFolder in project archi by archimatetool.
the class DiagramModelArchimateConnection method removeArchimateConceptFromModel.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT
*/
@Override
public void removeArchimateConceptFromModel() {
IArchimateRelationship relationship = getArchimateRelationship();
if (relationship != null) {
IFolder folder = (IFolder) relationship.eContainer();
if (folder != null) {
folder.getElements().remove(relationship);
relationship.disconnect();
}
}
}
use of com.archimatetool.model.IFolder in project archi by archimatetool.
the class CommandsTests method testDeleteArchimateElementCommand.
@Test
public void testDeleteArchimateElementCommand() {
IArchimateElement element = (IArchimateElement) tm.getObjectByID("1544");
assertNotNull(element);
IFolder parent = (IFolder) element.eContainer();
DeleteArchimateElementCommand cmd = new DeleteArchimateElementCommand(element);
cmd.execute();
assertNull(element.eContainer());
assertFalse(parent.getElements().contains(element));
cmd.undo();
assertEquals(0, parent.getElements().indexOf(element));
}
use of com.archimatetool.model.IFolder in project archi by archimatetool.
the class CommandsTests method testDeleteArchimateRelationshipCommand.
@Test
public void testDeleteArchimateRelationshipCommand() {
IArchimateRelationship relationship = (IArchimateRelationship) tm.getObjectByID("670aa5ed");
assertNotNull(relationship);
assertTrue(relationship.getSource().getSourceRelationships().contains(relationship));
assertTrue(relationship.getTarget().getTargetRelationships().contains(relationship));
IFolder parent = (IFolder) relationship.eContainer();
DeleteArchimateRelationshipCommand cmd = new DeleteArchimateRelationshipCommand(relationship);
cmd.execute();
assertNull(relationship.eContainer());
assertFalse(parent.getElements().contains(relationship));
assertFalse(relationship.getSource().getSourceRelationships().contains(relationship));
assertFalse(relationship.getTarget().getTargetRelationships().contains(relationship));
cmd.undo();
assertEquals(11, parent.getElements().indexOf(relationship));
}
Aggregations