Search in sources :

Example 6 with EStructuralFeatureNode

use of org.eclipse.xtext.ui.editor.outline.impl.EStructuralFeatureNode 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));
}
Also used : IUnitOfWork(org.eclipse.xtext.util.concurrent.IUnitOfWork) DocumentRootNode(org.eclipse.xtext.ui.editor.outline.impl.DocumentRootNode) EObject(org.eclipse.emf.ecore.EObject) EStructuralFeatureNode(org.eclipse.xtext.ui.editor.outline.impl.EStructuralFeatureNode) EObjectNode(org.eclipse.xtext.ui.editor.outline.impl.EObjectNode) Test(org.junit.Test)

Aggregations

EStructuralFeatureNode (org.eclipse.xtext.ui.editor.outline.impl.EStructuralFeatureNode)6 IOutlineNode (org.eclipse.xtext.ui.editor.outline.IOutlineNode)3 EObjectNode (org.eclipse.xtext.ui.editor.outline.impl.EObjectNode)3 Category (com.avaloq.tools.ddk.check.check.Category)1 Check (com.avaloq.tools.ddk.check.check.Check)1 CheckCatalog (com.avaloq.tools.ddk.check.check.CheckCatalog)1 Collection (java.util.Collection)1 EObject (org.eclipse.emf.ecore.EObject)1 EStructuralFeature (org.eclipse.emf.ecore.EStructuralFeature)1 StyledString (org.eclipse.jface.viewers.StyledString)1 DocumentRootNode (org.eclipse.xtext.ui.editor.outline.impl.DocumentRootNode)1 ITextRegion (org.eclipse.xtext.util.ITextRegion)1 IUnitOfWork (org.eclipse.xtext.util.concurrent.IUnitOfWork)1 Test (org.junit.Test)1