Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[gmf-dev] problem updating view

Hello ,
 
Could someone help me with this? I have created some semantic elements programmatically as children in another one. But when I draw a connection between them, the first target element disappears from the vie but still exists in the resources. after the first connection, everything works fine.
When I first create a child element with a tool and remove it again, also everything works fine. can someone help me to solve this problem?
 
Greetings,
Toman
 

protected EObject doDefaultElementCreation() {

Resource resource = getElementToEdit().eResource();

config.Block newElement = config.ConfigFactory.eINSTANCE.createBlock();

ReadXml rx = new ReadXml();

List<config.Socket> sockets = (List<Socket>) rx.getBlockSockets();

List<config.Property> properties = rx.getBlockProperties();

newElement.getProperties().addAll(properties);

newElement.getSockets().addAll(sockets);

newElement.setDescription(rx.getBlockDescription());

newElement.setName(rx.getBlockname());

for (Iterator<config.Socket> it = sockets.iterator(); it

.hasNext();) {

it.next().setBlock(newElement);

}

for (Iterator<Property> it = newElement.getProperties().iterator(); it

.hasNext();) {

it.next().setBlock(newElement);

}

resource.getContents().add(newElement);

resource.getContents().add(newElement);

System.out.println(newElement.getSockets().size());

return newElement;

}


Back to the top