Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » ISelectionProvider error at runtime
ISelectionProvider error at runtime [message #228507] Tue, 26 December 2006 03:23 Go to next message
Nacef is currently offline Nacef
Messages: 29
Registered: July 2009
Junior Member
Hi everyone,

I'm a newbie in RCP development and especially with GEF. I wanted just to
test GEF in an RCP application so that's what I did step by step :
- I created a new RCP plugin project.
- I added a new view called ProcessView.
- I added org.eclipse.gef and org.eclipse.draw2d as dependencies in the
project.
- I added a GraphicalViewer to the view and added the following code :

public void createPartControl(Composite parent) {
graphicalViewer = new GraphicalViewerImpl();
graphicalViewer.createControl(parent);
graphicalViewer.setEditDomain(new EditDomain());
graphicalViewer.setEditPartFactory(new EditPartFactory(){

public EditPart createEditPart(EditPart context, Object model) {
EditPart result = new AbstractGraphicalEditPart() {
protected IFigure createFigure() {
return new Label("Hello, world");
}

@Override
protected void createEditPolicies() {
}
};
result.setModel(model);
return result;
}});

graphicalViewer.setContents(new Object());
}

What I get when running is :
java.lang.NoClassDefFoundError:
org/eclipse/jface/viewers/ISelectionProvider
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.def ineClass(DefaultClassLoader.java:161)
at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineC lass(ClasspathManager.java:499)
at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findCla ssImpl(ClasspathManager.java:469)
at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClassImpl(ClasspathManager.java:428)
at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClass(ClasspathManager.java:411)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.fin dLocalClass(DefaultClassLoader.java:189)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findLo calClass(BundleLoader.java:334)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:386)
....


If anyone can help me I would be very grateful, it is crucial for my
project.

Thx to all
Re: ISelectionProvider error at runtime [message #228547 is a reply to message #228507] Tue, 26 December 2006 14:22 Go to previous messageGo to next message
Eclipse User
Originally posted by: none.unknown.com

Your set-up must not be right. Perhaps you're missing the jface plug-in
somehow (it is included in RCP). You should follow-up on the platform
newsgroup if the problem persists.

BTW, once you get it working you might still not see the label, because it
might not get laid out. The layer to which it gets added might not have a
layout manager. Even if it does, you'd have to most likely provide a layout
constraint.

"Nacef LABIDI" <nacef.l@gmail.com> wrote in message
news:a3c949bafe19f7bdd92078cf6bfb0746$1@www.eclipse.org...
> Hi everyone,
>
> I'm a newbie in RCP development and especially with GEF. I wanted just to
> test GEF in an RCP application so that's what I did step by step :
> - I created a new RCP plugin project.
> - I added a new view called ProcessView.
> - I added org.eclipse.gef and org.eclipse.draw2d as dependencies in the
> project.
> - I added a GraphicalViewer to the view and added the following code :
>
> public void createPartControl(Composite parent) {
> graphicalViewer = new GraphicalViewerImpl();
> graphicalViewer.createControl(parent);
> graphicalViewer.setEditDomain(new EditDomain());
> graphicalViewer.setEditPartFactory(new EditPartFactory(){
>
> public EditPart createEditPart(EditPart context, Object model) {
> EditPart result = new AbstractGraphicalEditPart() {
> protected IFigure createFigure() {
> return new Label("Hello, world");
> }
>
> @Override
> protected void createEditPolicies() {
> }
> };
> result.setModel(model);
> return result;
> }});
>
> graphicalViewer.setContents(new Object());
> }
>
> What I get when running is :
> java.lang.NoClassDefFoundError:
> org/eclipse/jface/viewers/ISelectionProvider
> at java.lang.ClassLoader.defineClass1(Native Method)
> at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.def ineClass(DefaultClassLoader.java:161)
> at
> org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineC lass(ClasspathManager.java:499)
> at
> org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findCla ssImpl(ClasspathManager.java:469)
> at
> org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClassImpl(ClasspathManager.java:428)
> at
> org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLoc alClass(ClasspathManager.java:411)
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.fin dLocalClass(DefaultClassLoader.java:189)
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findLo calClass(BundleLoader.java:334)
> at
> org.eclipse.osgi.framework.internal.core.BundleLoader.findCl ass(BundleLoader.java:386)
> ...
>
>
> If anyone can help me I would be very grateful, it is crucial for my
> project.
>
> Thx to all
>
Re: ISelectionProvider error at runtime [message #228563 is a reply to message #228547] Wed, 27 December 2006 03:53 Go to previous message
Nacef is currently offline Nacef
Messages: 29
Registered: July 2009
Junior Member
Hi,

I've verified my setup and I think all is fine : I have runned an example using jface (tableviewers) with the same setup and it runs well. I don't understand why it doesn't work when using GEF.
Previous Topic:how to use dialogs in editing
Next Topic:disable editor editing
Goto Forum:
  


Current Time: Thu Apr 17 17:37:14 EDT 2014

Powered by FUDForum. Page generated in 0.01636 seconds