Search in sources :

Example 1 with NoteEditPart

use of com.archimatetool.editor.diagram.editparts.diagram.NoteEditPart in project archi by archimatetool.

the class ArchimateDiagramEditPartFactoryTests method testNoteEditPart.

@Test
public void testNoteEditPart() {
    IDiagramModelNote note = IArchimateFactory.eINSTANCE.createDiagramModelNote();
    EditPart editPart = editPartFactory.createEditPart(null, note);
    assertTrue(editPart instanceof NoteEditPart);
    assertEquals(note, editPart.getModel());
}
Also used : GroupEditPart(com.archimatetool.editor.diagram.editparts.diagram.GroupEditPart) NoteEditPart(com.archimatetool.editor.diagram.editparts.diagram.NoteEditPart) EditPart(org.eclipse.gef.EditPart) EmptyEditPart(com.archimatetool.editor.diagram.editparts.diagram.EmptyEditPart) NoteEditPart(com.archimatetool.editor.diagram.editparts.diagram.NoteEditPart) IDiagramModelNote(com.archimatetool.model.IDiagramModelNote) Test(org.junit.Test)

Example 2 with NoteEditPart

use of com.archimatetool.editor.diagram.editparts.diagram.NoteEditPart in project archi by archimatetool.

the class NoteUIProviderTests method testCreateEditPart.

@Override
public void testCreateEditPart() {
    EditPart editPart = provider.createEditPart();
    assertTrue(editPart instanceof NoteEditPart);
}
Also used : NoteEditPart(com.archimatetool.editor.diagram.editparts.diagram.NoteEditPart) EditPart(org.eclipse.gef.EditPart) NoteEditPart(com.archimatetool.editor.diagram.editparts.diagram.NoteEditPart)

Example 3 with NoteEditPart

use of com.archimatetool.editor.diagram.editparts.diagram.NoteEditPart in project archi by archimatetool.

the class PropertiesLabelProviderTests method testGetTextNote.

@Test
public void testGetTextNote() {
    // Text for diagram model
    IDiagramModelNote note = IArchimateFactory.eINSTANCE.createDiagramModelNote();
    String text = provider.getText(new StructuredSelection(note));
    assertEquals("Note", text);
    // Text for EditPart
    NoteEditPart editPart = new NoteEditPart();
    editPart.setModel(note);
    text = provider.getText(new StructuredSelection(editPart));
    assertEquals("Note", text);
}
Also used : StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) NoteEditPart(com.archimatetool.editor.diagram.editparts.diagram.NoteEditPart) IDiagramModelNote(com.archimatetool.model.IDiagramModelNote) Test(org.junit.Test)

Aggregations

NoteEditPart (com.archimatetool.editor.diagram.editparts.diagram.NoteEditPart)3 IDiagramModelNote (com.archimatetool.model.IDiagramModelNote)2 EditPart (org.eclipse.gef.EditPart)2 Test (org.junit.Test)2 EmptyEditPart (com.archimatetool.editor.diagram.editparts.diagram.EmptyEditPart)1 GroupEditPart (com.archimatetool.editor.diagram.editparts.diagram.GroupEditPart)1 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)1