use of org.eclipse.xtext.ui.editor.outline.impl.EObjectNode in project xtext-eclipse by eclipse.
the class OutlineNodeTest method testAddChildToLeafNode.
@Test
public void testAddChildToLeafNode() {
EObjectNode parentNode = new EObjectNode(parentElement, null, (ImageDescriptor) null, "parent", true);
assertFalse(parentNode.hasChildren());
assertTrue(parentNode.getChildren().isEmpty());
EObjectNode childNode = new EObjectNode(child0Element, parentNode, (ImageDescriptor) null, "child", false);
assertTrue(parentNode.hasChildren());
assertTrue(parentNode.getChildren().contains(childNode));
}
use of org.eclipse.xtext.ui.editor.outline.impl.EObjectNode in project xtext-eclipse by eclipse.
the class OutlineNodeTest method testStateAccess.
@Test
public void testStateAccess() {
DocumentRootNode rootNode = createRootNode();
EObjectNode parentNode = new EObjectNode(parentElement, rootNode, (ImageDescriptor) null, "parent", false);
EStructuralFeatureNode featureNode = new EStructuralFeatureNode(parentElement, OutlineTestPackage.Literals.ELEMENT__XREFS, parentNode, (ImageDescriptor) null, "eClassifiers", true);
IUnitOfWork<Boolean, EObject> work = new IUnitOfWork<Boolean, EObject>() {
@Override
public Boolean exec(EObject state) throws Exception {
return state != null;
}
};
assertTrue(rootNode.readOnly(work));
assertTrue(parentNode.readOnly(work));
assertTrue(featureNode.readOnly(work));
}
use of org.eclipse.xtext.ui.editor.outline.impl.EObjectNode in project xtext-eclipse by eclipse.
the class OutlineNodeTest method testParentChildOpposites.
@Test
public void testParentChildOpposites() {
EObjectNode parentNode = new EObjectNode(parentElement, null, (ImageDescriptor) null, "parent", false);
EObjectNode childNode = new EObjectNode(child0Element, parentNode, (ImageDescriptor) null, "child", false);
assertEquals(childNode.getParent(), parentNode);
assertTrue(parentNode.getChildren().contains(childNode));
}
use of org.eclipse.xtext.ui.editor.outline.impl.EObjectNode in project xtext-eclipse by eclipse.
the class OutlineNodeTest method testMethodsDelegateToParent.
@Test
public void testMethodsDelegateToParent() {
DocumentRootNode rootNode = createRootNode();
EObjectNode parentNode = new EObjectNode(parentElement, rootNode, (ImageDescriptor) null, "parent", false);
assertNotNull(parentNode.getDocument());
assertNotNull(parentNode.getTreeProvider());
assertEquals(rootNode.getDocument(), parentNode.getDocument());
assertEquals(rootNode.getTreeProvider(), parentNode.getTreeProvider());
}
use of org.eclipse.xtext.ui.editor.outline.impl.EObjectNode in project xtext-eclipse by eclipse.
the class OutlineNodeTest method testEqualsNotImplemented.
@Test
public void testEqualsNotImplemented() throws Exception {
EObjectNode node0 = new EObjectNode(parentElement, null, (ImageDescriptor) null, "parent", false);
EObjectNode node1 = new EObjectNode(parentElement, null, (ImageDescriptor) null, "parent", false);
assertNotSame(node0, node1);
}
Aggregations