Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Trying to get the sample to work
Trying to get the sample to work [message #674657] Fri, 27 May 2011 18:32 Go to next message
Neil Goldsmith is currently offline Neil GoldsmithFriend
Messages: 68
Registered: July 2009
Member
Trying to follow along with the example code and get that running by following the code in the documentation, but even that is not coming up. It can't seem to load my DiagramTypeProvider:

!ENTRY org.eclipse.graphiti 4 0 2011-05-27 14:23:49.984
!MESSAGE org.eclipse.core.runtime.CoreException: Plug-in GraphitiMySample was unable to load class com.avaya.graphitieditor.MyGraphitiDiagramTypeProvider.


Code is extremly simple (just started the tutorial).

I have 2 classes and a plugin. It appears to not load my DiagramTypeProvider, but not sure why. Everything seems to be in place. I've included my .log file with more stack trace in this message. Thanks!

MyGraphitiDiagramTypeProvider.java

package com.avaya.graphitieditor;

import org.eclipse.graphiti.dt.AbstractDiagramTypeProvider;

public class MyGraphitiDiagramTypeProvider extends AbstractDiagramTypeProvider {
	public MyGraphitiDiagramTypeProvider() {
	    super();
	    setFeatureProvider(new MyFeatureProvider(this));
	}
}



MyFeatureProvider.java
package com.avaya.graphitieditor;

import org.eclipse.graphiti.dt.IDiagramTypeProvider;
import org.eclipse.graphiti.ui.features.DefaultFeatureProvider;

public class MyFeatureProvider extends DefaultFeatureProvider {
    public MyFeatureProvider(IDiagramTypeProvider dtp) {
        super(dtp);
    }
}



plugin.xml:

<?eclipse version="3.4"?>
<plugin
   id="com.avaya.graphitieditor"
   name="MyGraphiti Plug-in"
   version="6.0.0.0701"
   provider-name="test"
   class="graphitimysample.GraphitiMySamplePlugin">
   
  <extension
      point="org.eclipse.graphiti.ui.diagramTypes">
    <diagramType
      description="This is the diagram type for my Graphiti tutorial"
      id="GraphitiMySample.MyTutorialDiagramType"
      name="Neil Graphiti Tutorial Diagram Type"
      type="myGraphititutorial">
    </diagramType>
  </extension>
  <extension
      point="org.eclipse.graphiti.ui.diagramTypeProviders">
    <diagramTypeProvider
      class="com.avaya.graphitieditor.MyGraphitiDiagramTypeProvider"
      description="This is my editor for the Graphiti tutorial"
      id="GraphitiMySample.MyTutorialDiagramTypeProvider"
      name="Neil tutorial editor">
      <diagramType
        id="GraphitiMySample.MyTutorialDiagramType">
      </diagramType>
    </diagramTypeProvider>
  </extension>
</plugin>



  • Attachment: .log
    (Size: 25.99KB, Downloaded 334 times)

[Updated on: Fri, 27 May 2011 18:36]

Report message to a moderator

Re: Trying to get the sample to work [message #674682 is a reply to message #674657] Fri, 27 May 2011 21:25 Go to previous messageGo to next message
Neil Goldsmith is currently offline Neil GoldsmithFriend
Messages: 68
Registered: July 2009
Member
I got it working. The plugin had some issues I had to fix.
Re: Trying to get the sample to work [message #675349 is a reply to message #674657] Tue, 31 May 2011 08:46 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Neil,

the reason is that your DiagramTypeProvider is registered for a wrong
diagram type:
<diagramType
id="GraphitiMySample.MyTutorialDiagramType">
</diagramType>

You need to register it for "myGraphititutorial"

HTH,
Michael

"Neil Goldsmith" wrote in message news:iroq71$11r$1@news.eclipse.org...

Trying to follow along with the example code and get that running by
following the code in the documentation, but even that is not coming up. It
can't seem to load my DiagramTypeProvider:

!ENTRY org.eclipse.graphiti 4 0 2011-05-27 14:23:49.984
!MESSAGE org.eclipse.core.runtime.CoreException: Plug-in GraphitiMySample
was unable to load class
com.avaya.graphitieditor.MyGraphitiDiagramTypeProvider.


Code is extremly simple (just started the tutorial).

I have 2 classes and a plugin. It appears to not load my
DiagramTypeProvider, but not sure why. Everything seems to be in place.
I've included my .log file with more stack trace in this message. Thanks!

MyGraphitiDiagramTypeProvider.java

public class MyGraphitiDiagramTypeProvider extends
AbstractDiagramTypeProvider {
public MyGraphitiDiagramTypeProvider() {
super();
setFeatureProvider(new MyFeatureProvider(this));
}
}



MyFeatureProvider.java

public class MyFeatureProvider extends DefaultFeatureProvider {
public MyFeatureProvider(IDiagramTypeProvider dtp) {
super(dtp);
}
}


plugin.xml:

<?eclipse version="3.4"?>
<plugin
id="com.avaya.graphitieditor"
name="MyGraphiti Plug-in"
version="6.0.0.0701"
provider-name="test"
class="graphitimysample.GraphitiMySamplePlugin">

<extension
point="org.eclipse.graphiti.ui.diagramTypes">
<diagramType
description="This is the diagram type for my Graphiti tutorial"
id="GraphitiMySample.MyTutorialDiagramType"
name="Neil Graphiti Tutorial Diagram Type"
type="myGraphititutorial">
</diagramType>
</extension>
<extension
point="org.eclipse.graphiti.ui.diagramTypeProviders">
<diagramTypeProvider
class="com.avaya.graphitieditor.MyGraphitiDiagramTypeProvider"
description="This is my editor for the Graphiti tutorial"
id="GraphitiMySample.MyTutorialDiagramTypeProvider"
name="Neil tutorial editor">
<diagramType
id="GraphitiMySample.MyTutorialDiagramType">
</diagramType>
</diagramTypeProvider>
</extension>
</plugin>
Re: Trying to get the sample to work [message #675436 is a reply to message #675349] Tue, 31 May 2011 14:20 Go to previous messageGo to next message
Neil Goldsmith is currently offline Neil GoldsmithFriend
Messages: 68
Registered: July 2009
Member

Thanks Michael,

I found the bug on my end, but from what you are saying, don't you match up the ID from the diagramType ext point to your Diagram type ID attribute when you define your DT Provider? I followed the tutorial in the docs and structured my plugin nearly the same. Mine seems to be working fine now when I followed a similar structure to the code below from the tutorial.

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<plugin>
  <extension
      point="org.eclipse.graphiti.ui.diagramTypes">
    <diagramType
      description="This is the diagram type for my Graphiti tutorial"
      id="org.eclipse.graphiti.examples.tutorial.diagram.MyTutorialDiagramType"
      name="My Graphiti Tutorial Diagram Type"
      type="mytutorial">
    </diagramType>
  </extension>

  <extension
      point="org.eclipse.graphiti.ui.diagramTypeProviders">
    <diagramTypeProvider
      class="org.eclipse.graphiti.examples.tutorial.diagram.
             MyTutorialDiagramTypeProvider"
      description="This is my editor for the Graphiti tutorial"
      id="org.eclipse.graphiti.examples.tutorial.diagram.
          MyTutorialDiagramTypeProvider"
      name="My tutorial editor">
      <diagramType
        id="org.eclipse.graphiti.examples.tutorial.diagram.MyTutorialDiagramType">
      </diagramType>
    </diagramTypeProvider>
  </extension>
</plugin>

Re: Trying to get the sample to work [message #675735 is a reply to message #675436] Wed, 01 June 2011 10:17 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Neil,

yes, actually this is what I meant to say. Re-reading my answer again, I see
it is somewhat misleading.

Thanks,
Michael

"Neil Goldsmith" wrote in message news:is2sus$27o$1@news.eclipse.org...


Thanks Michael,

I found the bug on my end, but from what you are saying, don't you match up
the ID from the diagramType ext point to your Diagram type ID attribute when
you define your DT Provider? I followed the tutorial in the docs and
structured my plugin nearly the same. Mine seems to be working fine now
when I followed a similar structure to the code below from the tutorial.


<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<plugin>
<extension
point="org.eclipse.graphiti.ui.diagramTypes">
<diagramType
description="This is the diagram type for my Graphiti tutorial"
id="org.eclipse.graphiti.examples.tutorial.diagram.MyTutorialDiagramType"
name="My Graphiti Tutorial Diagram Type"
type="mytutorial">
</diagramType>
</extension>

<extension
point="org.eclipse.graphiti.ui.diagramTypeProviders">
<diagramTypeProvider
class="org.eclipse.graphiti.examples.tutorial.diagram.
MyTutorialDiagramTypeProvider"
description="This is my editor for the Graphiti tutorial"
id="org.eclipse.graphiti.examples.tutorial.diagram.
MyTutorialDiagramTypeProvider"
name="My tutorial editor">
<diagramType
id="org.eclipse.graphiti.examples.tutorial.diagram.MyTutorialDiagramType">
</diagramType>
</diagramTypeProvider>
</extension>
</plugin>
Re: Trying to get the sample to work [message #1067367 is a reply to message #675436] Mon, 08 July 2013 12:44 Go to previous messageGo to next message
Heeren Sharma is currently offline Heeren SharmaFriend
Messages: 7
Registered: May 2013
Junior Member
Hey Neil,
I am facing the similar problem. I have successfully registered one DiagramType in one plugin project. But now when I created new Plugin project and try to register new DiagramType then I am not getting this new DiagramType in the list of graphiti example section.
Any kind of direction will be helpful.
Thanks.
Heeren

[Updated on: Mon, 08 July 2013 12:45]

Report message to a moderator

Re: Trying to get the sample to work [message #1067374 is a reply to message #1067367] Mon, 08 July 2013 13:05 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Heeren,

have you checked the Eclipse error log for any execptions during startup?

Michael
Re: Trying to get the sample to work [message #1067477 is a reply to message #1067374] Tue, 09 July 2013 00:08 Go to previous message
Heeren Sharma is currently offline Heeren SharmaFriend
Messages: 7
Registered: May 2013
Junior Member
Hi Michael,
Thanks for the hint. I got it working now. I suppose Error occurred as I have added
"org.eclipse.graphiti.mm.source" dependency. I changed manually the MANIFEST.MF file's entry to "org.eclipse.graphiti.mm".
Though I notice a really strange behavior. When I try to add "org.eclipse.graphiti.mm" dependency from the dependencies tab, then it doesn't show this dependency in other project, but only the "source" one. Can you verify or explain this behavior?

Thanks,
Heeren
Previous Topic:Problem with API changes in newest Graphiti Version
Next Topic:Insert a PictogramElement into another
Goto Forum:
  


Current Time: Fri Mar 29 12:26:36 GMT 2024

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

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

Back to the top