use of org.eclipse.xtext.ui.editor.outline.impl.EObjectNode in project xtext-eclipse by eclipse.
the class OutlineFilterAndSorterTest method setUp.
@Override
public void setUp() throws Exception {
super.setUp();
final Injector injector = TestsActivator.getInstance().getInjector("org.eclipse.xtext.ui.tests.editor.outline.OutlineTestLanguage");
with(new ISetup() {
@Override
public Injector createInjectorAndDoEMFRegistration() {
return injector;
}
});
Model model = OutlineTestFactory.eINSTANCE.createModel();
nodes = Lists.newArrayList();
nodes.add(new EObjectNode(model, null, (ImageDescriptor) null, "one", true));
nodes.add(new EObjectNode(model, null, (ImageDescriptor) null, "two", true));
nodes.add(new EObjectNode(model, null, (ImageDescriptor) null, "three", true));
filterAndSorter = new OutlineFilterAndSorter();
}
use of org.eclipse.xtext.ui.editor.outline.impl.EObjectNode in project xtext-eclipse by eclipse.
the class OutlineNodeComparerTest method testNull.
@Test
public void testNull() {
assertTrue(comparer.equals(null, null));
EObjectNode node = new EObjectNode(eObject, null, (ImageDescriptor) null, "parent", false);
assertFalse(comparer.equals(null, node));
assertFalse(comparer.equals(node, null));
}
use of org.eclipse.xtext.ui.editor.outline.impl.EObjectNode in project xtext-eclipse by eclipse.
the class OutlineNodeTest method testCreateChildrenLazily.
@Test
public void testCreateChildrenLazily() {
DocumentRootNode rootNode = createRootNode();
EObjectNode parentNode = new EObjectNode(parentElement, rootNode, (ImageDescriptor) null, "parent", false);
assertFalse(parentNode.getChildren().isEmpty());
}
use of org.eclipse.xtext.ui.editor.outline.impl.EObjectNode in project xtext-eclipse by eclipse.
the class OutlineNodeTest method createRootNode.
protected DocumentRootNode createRootNode() {
XtextDocument document = get(XtextDocument.class);
document.setInput(resource);
IOutlineTreeStructureProvider treeStructureProvider = new IOutlineTreeStructureProvider() {
@Override
public void createChildren(IOutlineNode parentNode, EObject modelElement) {
new EObjectNode(child0Element, parentNode, (ImageDescriptor) null, "child", false);
}
};
DocumentRootNode rootNode = new DocumentRootNode((ImageDescriptor) null, "root", document, treeStructureProvider);
return rootNode;
}
use of org.eclipse.xtext.ui.editor.outline.impl.EObjectNode in project dsl-devkit by dsldevkit.
the class CheckOutlineTreeProvider method internalCreateChildren.
@Override
protected void internalCreateChildren(final DocumentRootNode parentNode, final EObject modelElement) {
CheckCatalog catalog = (CheckCatalog) modelElement;
if (catalog.getPackageName() != null) {
getOutlineNodeFactory().createEStructuralFeatureNode(parentNode, catalog, CheckPackage.Literals.CHECK_CATALOG__PACKAGE_NAME, ImageDescriptor.createFromImage(checkImages.forPackage()), catalog.getPackageName(), true);
}
if (catalog.getImports() != null && !catalog.getImports().getImportDeclarations().isEmpty()) {
EStructuralFeatureNode importNode = getOutlineNodeFactory().createEStructuralFeatureNode(parentNode, catalog, CheckPackage.Literals.CHECK_CATALOG__IMPORTS, ImageDescriptor.createFromImage(checkImages.forImportContainer()), "Import declarations", false);
for (final org.eclipse.xtext.xtype.XImportDeclaration imported : catalog.getImports().getImportDeclarations()) {
createNode(importNode, imported);
}
}
EObjectNode catalogNode = createNode(parentNode, catalog);
for (final Category category : catalog.getCategories()) {
createNode(catalogNode, category);
}
for (final Check check : catalog.getChecks()) {
createNode(catalogNode, check);
}
}
Aggregations