Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Unable to run org.eclipse.gef.examples.ediagram
Unable to run org.eclipse.gef.examples.ediagram [message #643771] Wed, 08 December 2010 08:51 Go to next message
Murthy Bhat is currently offline Murthy BhatFriend
Messages: 159
Registered: July 2009
Senior Member

For some references I tried to download the "org.eclipse.gef.examples.ediagram" example from CVS and run it. I try to create a new ecore file and I get a blank error message.

On further investigation it appears to me that the application is failing to create a new resource out of the resourceset. I guess it has something to do with the URI.

Would be great if anyone could help me out here.

Re: Unable to run org.eclipse.gef.examples.ediagram [message #643776 is a reply to message #643771] Wed, 08 December 2010 09:15 Go to previous message
Murthy Bhat is currently offline Murthy BhatFriend
Messages: 159
Registered: July 2009
Senior Member
I have resolved the issue now.

I need to register my resource factory before creating the resource. So I create a method as below and call it as one of the first lines in the doFinish() method of 'NewEDiagramWizard'

private void registerFactory() {
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap( ).put(
"ecore", new XMIResourceFactoryImpl() {
public Resource createResource(URI uri) {
XMIResource xmiResource = new XMIResourceImpl(uri);
return xmiResource;

After this, there was one last hurdle between me and the GEF editor, the package inclusion error.

So I modified the part in the doFinish() method as below.

doFinish(). . . .

if (ecoreResource == null) {
// The URI didn't match any existing file,so create a new one in the workspace
ecoreResource = rsrcSet.createResource(uri);
EPackage pckg = EcoreFactory.eINSTANCE.createEPackage();
try {;
} catch (IOException ioe) {

List contents = ecoreResource.getContents();
for (int j = 0; j < contents.size(); j++) {

Hope this helps someone is in similar situation.

Previous Topic:SWT.DEL key and a Graphical viewer inside an eclipse ViewPart
Next Topic:elementary draw2d program doesn't work
Goto Forum:

Current Time: Sat Nov 28 00:52:12 GMT 2015

Powered by FUDForum. Page generated in 0.04439 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software