Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Problem using viewer.setContents(model)
Problem using viewer.setContents(model) [message #150473] Fri, 10 September 2004 15:31 Go to next message
Eclipse UserFriend
Originally posted by: xpmansami.msn.com

Help please.
I have an RCP application that works.
I added a view and inside the createPartControl method, the
viewer.setContents(model) does not work ?
Here my code for createPartControl
--
viewer = new ScrollingGraphicalViewer();
viewer.setEditDomain(new EditDomain());

// viewer.createControl(parent);
viewer.createControl(sash_form);

// - ajouté ligne suivante
viewer.getControl().setBackground(new Color(null, 255, 255, 213));
// - fin ajouté
// Create the toolbar
createToolbar();

ParentModel model = new ParentModel();
model.addChild(new ChildModel(new Rectangle(60, 5, 80, 20)));
model.addChild(new ChildModel(new Rectangle(30, 30, 100, 50)));

viewer.setEditPartFactory(new MyEditPartFactory());
//-- !!! viewer.setContents(model) does not work
viewer.setContents(model);
//-
viewer.addSelectionChangedListener(this);
viewer.getEditDomain().getCommandStack().addCommandStackList ener(this);

Many thanks for your help.
Re: Problem using viewer.setContents(model) [message #150481 is a reply to message #150473] Fri, 10 September 2004 15:37 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: xpmansami.msn.com

xpmansami wrote:

> Help please.
> I have an RCP application that works.
> I added a view and inside the createPartControl method, the
> viewer.setContents(model) does not work ?
> Here my code for createPartControl
> --
> viewer = new ScrollingGraphicalViewer();
> viewer.setEditDomain(new EditDomain());

> // viewer.createControl(parent);
> viewer.createControl(sash_form);

> // - ajouté ligne suivante
> viewer.getControl().setBackground(new Color(null, 255, 255, 213));
> // - fin ajouté
> // Create the toolbar
> createToolbar();

> ParentModel model = new ParentModel();
> model.addChild(new ChildModel(new Rectangle(60, 5, 80, 20)));
> model.addChild(new ChildModel(new Rectangle(30, 30, 100, 50)));

> viewer.setEditPartFactory(new MyEditPartFactory());
> //-- !!! viewer.setContents(model) does not work
> viewer.setContents(model);
> //-
> viewer.addSelectionChangedListener(this);
> viewer.getEditDomain().getCommandStack().addCommandStackList ener(this);

> Many thanks for your help.

After launching the RCP application, when I open the myGefview , I got
"An error has occurred when creating this view" inside the view.
Every thing in the code works but the "viewer.setContents(model);
"
Re: Problem using viewer.setContents(model) [message #150504 is a reply to message #150481] Fri, 10 September 2004 17:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Look at the error. Open the PDE runtime view in your target workbench.


"xpmansami" <xpmansami@msn.com> wrote in message
news:chshod$3fu$1@eclipse.org...
> xpmansami wrote:
>
> > Help please.
> > I have an RCP application that works.
> > I added a view and inside the createPartControl method, the
> > viewer.setContents(model) does not work ?
> > Here my code for createPartControl
> > --
> > viewer = new ScrollingGraphicalViewer();
> > viewer.setEditDomain(new EditDomain());
>
> > // viewer.createControl(parent);
> > viewer.createControl(sash_form);
>
> > // - ajout
Re: Problem using viewer.setContents(model) [message #150529 is a reply to message #150504] Sat, 11 September 2004 10:21 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: xpmansami.msn.com

The only message I have is :
"Problems occured when invoking code from plug-in org.eclipse.core.runtime"

Thanks a lot for your help Randy


Randy Hudson wrote:

> Look at the error. Open the PDE runtime view in your target workbench.


> "xpmansami" <xpmansami@msn.com> wrote in message
> news:chshod$3fu$1@eclipse.org...
> > xpmansami wrote:
> >
> > > Help please.
> > > I have an RCP application that works.
> > > I added a view and inside the createPartControl method, the
> > > viewer.setContents(model) does not work ?
> > > Here my code for createPartControl
> > > --
> > > viewer = new ScrollingGraphicalViewer();
> > > viewer.setEditDomain(new EditDomain());
> >
> > > // viewer.createControl(parent);
> > > viewer.createControl(sash_form);
> >
> > > // - ajouté ligne suivante
> > > viewer.getControl().setBackground(new Color(null, 255, 255, 213));
> > > // - fin ajouté
> > > // Create the toolbar
> > > createToolbar();
> >
> > > ParentModel model = new ParentModel();
> > > model.addChild(new ChildModel(new Rectangle(60, 5, 80, 20)));
> > > model.addChild(new ChildModel(new Rectangle(30, 30, 100, 50)));
> >
> > > viewer.setEditPartFactory(new MyEditPartFactory());
> > > //-- !!! viewer.setContents(model) does not work
> > > viewer.setContents(model);
> > > //-
> > > viewer.addSelectionChangedListener(this);
> > > viewer.getEditDomain().getCommandStack().addCommandStackList ener(this);
> >
> > > Many thanks for your help.
> >
> > After launching the RCP application, when I open the myGefview , I got
> > "An error has occurred when creating this view" inside the view.
> > Every thing in the code works but the "viewer.setContents(model);
> > "
> >
> >
Re: Problem using viewer.setContents(model) [message #150537 is a reply to message #150529] Sat, 11 September 2004 10:39 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: xpmansami.msn.com

Plese Randy, which direction should I follow ?

I'm actualy trying to develop a gantt editor.
I need a "swimlane" composite made of a tree at the left
and the gantt chart at the right. Each gantt barre has the same tree item
Y position. Each gantt barre can be connected, moved and so on with impact
on the model ...
Of course the scolling must apply to the whole composite.

Should I use GEF tree at the left and a GEF editor at the right ?
Can I use a Jface treeViewer at the left ?

Thanks a lot.

xpmansami wrote:

> The only message I have is :
> "Problems occured when invoking code from plug-in org.eclipse.core.runtime"

> Thanks a lot for your help Randy


> Randy Hudson wrote:

> > Look at the error. Open the PDE runtime view in your target workbench.


> > "xpmansami" <xpmansami@msn.com> wrote in message
> > news:chshod$3fu$1@eclipse.org...
> > > xpmansami wrote:
> > >
> > > > Help please.
> > > > I have an RCP application that works.
> > > > I added a view and inside the createPartControl method, the
> > > > viewer.setContents(model) does not work ?
> > > > Here my code for createPartControl
> > > > --
> > > > viewer = new ScrollingGraphicalViewer();
> > > > viewer.setEditDomain(new EditDomain());
> > >
> > > > // viewer.createControl(parent);
> > > > viewer.createControl(sash_form);
> > >
> > > > // - ajouté ligne suivante
> > > > viewer.getControl().setBackground(new Color(null, 255, 255, 213));
> > > > // - fin ajouté
> > > > // Create the toolbar
> > > > createToolbar();
> > >
> > > > ParentModel model = new ParentModel();
> > > > model.addChild(new ChildModel(new Rectangle(60, 5, 80, 20)));
> > > > model.addChild(new ChildModel(new Rectangle(30, 30, 100, 50)));
> > >
> > > > viewer.setEditPartFactory(new MyEditPartFactory());
> > > > //-- !!! viewer.setContents(model) does not work
> > > > viewer.setContents(model);
> > > > //-
> > > > viewer.addSelectionChangedListener(this);
> > > > viewer.getEditDomain().getCommandStack().addCommandStackList ener(this);
> > >
> > > > Many thanks for your help.
> > >
> > > After launching the RCP application, when I open the myGefview , I got
> > > "An error has occurred when creating this view" inside the view.
> > > Every thing in the code works but the "viewer.setContents(model);
> > > "
> > >
> > >
Re: Problem using viewer.setContents(model) [message #150567 is a reply to message #150529] Sat, 11 September 2004 18:12 Go to previous messageGo to next message
Pratik Shah is currently offline Pratik ShahFriend
Messages: 1077
Registered: July 2009
Senior Member
Please provide the stack trace. Open the Error Log view to see it and
double-click to get the details. Sometimes there are wrapped exceptions, so
the trace is the next error message.


"xpmansami" <xpmansami@msn.com> wrote in message
news:chujjj$im3$1@eclipse.org...
> The only message I have is :
> "Problems occured when invoking code from plug-in
org.eclipse.core.runtime"
>
> Thanks a lot for your help Randy
>
>
> Randy Hudson wrote:
>
> > Look at the error. Open the PDE runtime view in your target workbench.
>
>
> > "xpmansami" <xpmansami@msn.com> wrote in message
> > news:chshod$3fu$1@eclipse.org...
> > > xpmansami wrote:
> > >
> > > > Help please.
> > > > I have an RCP application that works.
> > > > I added a view and inside the createPartControl method, the
> > > > viewer.setContents(model) does not work ?
> > > > Here my code for createPartControl
> > > > --
> > > > viewer = new ScrollingGraphicalViewer();
> > > > viewer.setEditDomain(new EditDomain());
> > >
> > > > // viewer.createControl(parent);
> > > > viewer.createControl(sash_form);
> > >
> > > > // - ajout
Re: Problem using viewer.setContents(model) [message #150626 is a reply to message #150567] Sun, 12 September 2004 18:00 Go to previous message
Eclipse UserFriend
Originally posted by: xpmansami.msn.com

There is no more error.
My error came from the fact I had 2 packages where each one was containing
the same class name "MyEditPartFactory". The "MyEditPartFactory" created
instance was the bad one . This is nothing to have with Gef. Well, some
times, we test many same kind of objects.
Excuse me for wasting your time.

I still need your advice about my current choice on developing a gantt
planning.
I have a swinlane composite. The left side is a jface treeviewer, and the
right side is a Gef editor. I need ensure the scolling, zoom, be
synchronized between the 2 sides, etc ..
Before going furter, I need to know if my choice (Jface+Gef) is acceptable
for my requirement (gannt planning) or is it better to replace Jface
treeviewer by Gef tree ?
Thanks a lot Pratik and Randy.

Pratik Shah wrote:

> Please provide the stack trace. Open the Error Log view to see it and
> double-click to get the details. Sometimes there are wrapped exceptions, so
> the trace is the next error message.


> "xpmansami" <xpmansami@msn.com> wrote in message
> news:chujjj$im3$1@eclipse.org...
> > The only message I have is :
> > "Problems occured when invoking code from plug-in
> org.eclipse.core.runtime"
> >
> > Thanks a lot for your help Randy
> >
> >
> > Randy Hudson wrote:
> >
> > > Look at the error. Open the PDE runtime view in your target workbench.
> >
> >
> > > "xpmansami" <xpmansami@msn.com> wrote in message
> > > news:chshod$3fu$1@eclipse.org...
> > > > xpmansami wrote:
> > > >
> > > > > Help please.
> > > > > I have an RCP application that works.
> > > > > I added a view and inside the createPartControl method, the
> > > > > viewer.setContents(model) does not work ?
> > > > > Here my code for createPartControl
> > > > > --
> > > > > viewer = new ScrollingGraphicalViewer();
> > > > > viewer.setEditDomain(new EditDomain());
> > > >
> > > > > // viewer.createControl(parent);
> > > > > viewer.createControl(sash_form);
> > > >
> > > > > // - ajouté ligne suivante
> > > > > viewer.getControl().setBackground(new Color(null, 255, 255, 213));
> > > > > // - fin ajouté
> > > > > // Create the toolbar
> > > > > createToolbar();
> > > >
> > > > > ParentModel model = new ParentModel();
> > > > > model.addChild(new ChildModel(new Rectangle(60, 5, 80, 20)));
> > > > > model.addChild(new ChildModel(new Rectangle(30, 30, 100, 50)));
> > > >
> > > > > viewer.setEditPartFactory(new MyEditPartFactory());
> > > > > //-- !!! viewer.setContents(model) does not work
> > > > > viewer.setContents(model);
> > > > > //-
> > > > > viewer.addSelectionChangedListener(this);
> > > > >
> viewer.getEditDomain().getCommandStack().addCommandStackList ener(this);
> > > >
> > > > > Many thanks for your help.
> > > >
> > > > After launching the RCP application, when I open the myGefview , I got
> > > > "An error has occurred when creating this view" inside the view.
> > > > Every thing in the code works but the "viewer.setContents(model);
> > > > "
> > > >
> > > >
> >
> >
Previous Topic:UPDATE : Model-View-Controller Question
Next Topic:New Shapes example CVS Question
Goto Forum:
  


Current Time: Fri Apr 26 10:41:47 GMT 2024

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

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

Back to the top