[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.tools.emf] Adding elements to model
|
I am new to EMF and working on a Sudoku thing using EMF (ecore) and TEF.
In my model, a Puzzle contains Field (types are Row, Column and Box).
I need to add elements to the model programatically by overriding the
check method. The model alreay contains 9 rows, this is handled in the
textual editor created in TEF. I need to create 9 boxes and 9 columns.
@Override
public String check(IModelElement modelElement, SemanticsContext context)
{
//own code
Puzzle puzzle =
(Puzzle)((EMFModelElement)modelElement).getEMFObject();
NewstructureFactory factory = NewstructureFactory.eINSTANCE;
Box b1 = factory.createBox();
}
How can I add this box to puzzle?