org.eclipse.emf.ecore.impl.EObjectImpl Java Examples

The following examples show how to use org.eclipse.emf.ecore.impl.EObjectImpl. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: NodeIteratorTest.java    From xtext-core with Eclipse Public License 2.0 6 votes vote down vote up
public static INode nodeWithTwoSiblings() {
	NodeModelBuilder builder = new NodeModelBuilder();
	String text = "alpha beta gamma";
	
	ICompositeNode root = builder.newRootNode(text);

	EObject alpha = new EObjectImpl() {};
	ILeafNode alphaNode = builder.newLeafNode(text.indexOf("alpha"), "alpha".length(), alpha, false, null, root);
	
	EObject beta = new EObjectImpl() {};
	builder.newLeafNode(text.indexOf("beta"), "beta".length(), beta, false, null, root);
	
	EObject gamma = new EObjectImpl() {};
	builder.newLeafNode(text.indexOf("gamma"), "gamma".length(), gamma, false, null, root);
	
	return alphaNode;
}
 
Example #2
Source File: BasicNodeIteratorTest.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
public static AbstractNode nodeWithTwoSiblings() {
	NodeModelBuilder builder = new NodeModelBuilder();
	String text = "alpha beta gamma";
	
	RootNode root = new RootNode();
	root.basicSetCompleteContent(text);
	
	EObject alpha = new EObjectImpl() {};
	builder.newLeafNode(text.indexOf("alpha"), "alpha".length(), alpha, false, null, root);
	
	EObject beta = new EObjectImpl() {};
	builder.newLeafNode(text.indexOf("beta"), "beta".length(), beta, false, null, root);
	
	EObject gamma = new EObjectImpl() {};
	builder.newLeafNode(text.indexOf("gamma"), "gamma".length(), gamma, false, null, root);
	
	return root.basicGetFirstChild();

}