| Home » Eclipse Projects » GEF » CreationToolEntry and SimpleFactory
 Goto Forum:| 
| CreationToolEntry and SimpleFactory [message #143053] | Fri, 16 July 2004 16:00  |  | 
| Eclipse User  |  |  |  |  | Originally posted by: bandrews.bphnx.com 
 I have added a CreationToolEntry object to my PaletteGroup, like this:
 
 control.add(new CreationToolEntry("Window",
 "Create Window",
 new SimpleFactory(WindowModel.class),
 null,
 null);
 
 When I select this tool then click in the viewer, my execute() method of
 my CreateCommand gets called, but nothing is drawn in the viewer.
 I believe my createEditPart() method of the PartFactory is supposed to be
 called by the framework somewhere in here, but where? It does not get
 called at all. What could I be doing wrong?
 
 Any help is very much appreciated as my hair is beginning to fall out!
 
 thanks,
 
 B
 |  |  |  |  | 
| Re: CreationToolEntry and SimpleFactory [message #143063 is a reply to message #143053] | Fri, 16 July 2004 17:12   |  | 
| Eclipse User  |  |  |  |  | Originally posted by: webmaster.mafd.org 
 Barry,
 
 are you "registering" the EditPartFactory with the editor?
 
 This is typically done in "configureGraphicalViewer" method:
 getGraphicalViewer().setEditPartFactory(new YourEditPartFactory());
 
 Spack
 
 "Barry Andrews" <bandrews@bphnx.com> wrote in message
 news:cd9c4b$kbv$1@eclipse.org...
 > I have added a CreationToolEntry object to my PaletteGroup, like this:
 >
 > control.add(new CreationToolEntry("Window",
 >                                   "Create Window",
 >                                   new SimpleFactory(WindowModel.class),
 >                                   null,
 >                                   null);
 >
 > When I select this tool then click in the viewer, my execute() method of
 > my CreateCommand gets called, but nothing is drawn in the viewer.
 > I believe my createEditPart() method of the PartFactory is supposed to be
 > called by the framework somewhere in here, but where? It does not get
 > called at all. What could I be doing wrong?
 >
 > Any help is very much appreciated as my hair is beginning to fall out!
 >
 > thanks,
 >
 > B
 >
 |  |  |  |  | 
| Re: CreationToolEntry and SimpleFactory [message #143069 is a reply to message #143063] | Fri, 16 July 2004 20:09   |  | 
| Eclipse User  |  |  |  |  | Originally posted by: bandrews.bphnx.com 
 Yes, I did do that.
 
 
 Richard Spackmann wrote:
 
 > Barry,
 
 > are you "registering" the EditPartFactory with the editor?
 
 > This is typically done in "configureGraphicalViewer" method:
 > getGraphicalViewer().setEditPartFactory(new YourEditPartFactory());
 
 > Spack
 
 > "Barry Andrews" <bandrews@bphnx.com> wrote in message
 > news:cd9c4b$kbv$1@eclipse.org...
 > > I have added a CreationToolEntry object to my PaletteGroup, like this:
 > >
 > > control.add(new CreationToolEntry("Window",
 > >                                   "Create Window",
 > >                                   new SimpleFactory(WindowModel.class),
 > >                                   null,
 > >                                   null);
 > >
 > > When I select this tool then click in the viewer, my execute() method of
 > > my CreateCommand gets called, but nothing is drawn in the viewer.
 > > I believe my createEditPart() method of the PartFactory is supposed to be
 > > called by the framework somewhere in here, but where? It does not get
 > > called at all. What could I be doing wrong?
 > >
 > > Any help is very much appreciated as my hair is beginning to fall out!
 > >
 > > thanks,
 > >
 > > B
 > >
 |  |  |  |  | 
| Re: CreationToolEntry and SimpleFactory [message #143079 is a reply to message #143069] | Fri, 16 July 2004 22:04   |  | 
| Eclipse User  |  |  |  |  | Originally posted by: RichardSpackmann.mafd.org 
 Hmmm....are you sure your EditPartFactory creates new EditParts of type
 WindowModel ?
 
 For example, the factories I have seen from tutorials have if statements
 that check for the instance type of iModel.
 
 What do you specifically do in your CreateCommand?
 
 Also, the debugger is INVALUABLE, I recommend stepping through to see what's
 not happening. Other than that - I really dont' know, I'm not that much of
 an expert.
 
 Maybe post your code so I can dig through and other people can chime in?
 
 Spack
 
 "Barry Andrews" <bandrews@bphnx.com> wrote in message
 news:cd9qo1$66f$1@eclipse.org...
 > Yes, I did do that.
 >
 >
 > Richard Spackmann wrote:
 >
 > > Barry,
 >
 > > are you "registering" the EditPartFactory with the editor?
 >
 > > This is typically done in "configureGraphicalViewer" method:
 > > getGraphicalViewer().setEditPartFactory(new YourEditPartFactory());
 >
 > > Spack
 >
 > > "Barry Andrews" <bandrews@bphnx.com> wrote in message
 > > news:cd9c4b$kbv$1@eclipse.org...
 > > > I have added a CreationToolEntry object to my PaletteGroup, like this:
 > > >
 > > > control.add(new CreationToolEntry("Window",
 > > >                                   "Create Window",
 > > >                                   new
 SimpleFactory(WindowModel.class),
 > > >                                   null,
 > > >                                   null);
 > > >
 > > > When I select this tool then click in the viewer, my execute() method
 of
 > > > my CreateCommand gets called, but nothing is drawn in the viewer.
 > > > I believe my createEditPart() method of the PartFactory is supposed to
 be
 > > > called by the framework somewhere in here, but where? It does not get
 > > > called at all. What could I be doing wrong?
 > > >
 > > > Any help is very much appreciated as my hair is beginning to fall out!
 > > >
 > > > thanks,
 > > >
 > > > B
 > > >
 >
 >
 |  |  |  |  | 
| Re: CreationToolEntry and SimpleFactory [message #143364 is a reply to message #143053] | Mon, 19 July 2004 13:15   |  | 
| Eclipse User  |  |  |  |  | Once your command creates the new object and adds it to the model, the model parent should be firing a property change.  When its corresponding EditPart
 gets notified of the change in children, it should invoke refreshChildren()
 (which will create the EditPart for the new child).
 
 "Barry Andrews" <bandrews@bphnx.com> wrote in message
 news:cd9c4b$kbv$1@eclipse.org...
 > I have added a CreationToolEntry object to my PaletteGroup, like this:
 >
 > control.add(new CreationToolEntry("Window",
 >                                   "Create Window",
 >                                   new SimpleFactory(WindowModel.class),
 >                                   null,
 >                                   null);
 >
 > When I select this tool then click in the viewer, my execute() method of
 > my CreateCommand gets called, but nothing is drawn in the viewer.
 > I believe my createEditPart() method of the PartFactory is supposed to be
 > called by the framework somewhere in here, but where? It does not get
 > called at all. What could I be doing wrong?
 >
 > Any help is very much appreciated as my hair is beginning to fall out!
 >
 > thanks,
 >
 > B
 >
 |  |  |  |  | 
| Re: CreationToolEntry and SimpleFactory [message #143575 is a reply to message #143079] | Tue, 20 July 2004 14:06   |  | 
| Eclipse User  |  |  |  |  | Originally posted by: bandrews.bphnx.com 
 Richard,
 
 I sent you a zip file of the source code since it's too large to put here.
 I didn't see a place to attach files, so I hope it's okay that I sent you
 the email.
 
 many thanks for your help!
 
 Barry
 
 
 
 Richard Spackmann wrote:
 
 > Hmmm....are you sure your EditPartFactory creates new EditParts of type
 > WindowModel ?
 
 > For example, the factories I have seen from tutorials have if statements
 > that check for the instance type of iModel.
 
 > What do you specifically do in your CreateCommand?
 
 > Also, the debugger is INVALUABLE, I recommend stepping through to see what's
 > not happening. Other than that - I really dont' know, I'm not that much of
 > an expert.
 
 > Maybe post your code so I can dig through and other people can chime in?
 
 > Spack
 
 > "Barry Andrews" <bandrews@bphnx.com> wrote in message
 > news:cd9qo1$66f$1@eclipse.org...
 > > Yes, I did do that.
 > >
 > >
 > > Richard Spackmann wrote:
 > >
 > > > Barry,
 > >
 > > > are you "registering" the EditPartFactory with the editor?
 > >
 > > > This is typically done in "configureGraphicalViewer" method:
 > > > getGraphicalViewer().setEditPartFactory(new YourEditPartFactory());
 > >
 > > > Spack
 > >
 > > > "Barry Andrews" <bandrews@bphnx.com> wrote in message
 > > > news:cd9c4b$kbv$1@eclipse.org...
 > > > > I have added a CreationToolEntry object to my PaletteGroup, like this:
 > > > >
 > > > > control.add(new CreationToolEntry("Window",
 > > > >                                   "Create Window",
 > > > >                                   new
 > SimpleFactory(WindowModel.class),
 > > > >                                   null,
 > > > >                                   null);
 > > > >
 > > > > When I select this tool then click in the viewer, my execute() method
 > of
 > > > > my CreateCommand gets called, but nothing is drawn in the viewer.
 > > > > I believe my createEditPart() method of the PartFactory is supposed to
 > be
 > > > > called by the framework somewhere in here, but where? It does not get
 > > > > called at all. What could I be doing wrong?
 > > > >
 > > > > Any help is very much appreciated as my hair is beginning to fall out!
 > > > >
 > > > > thanks,
 > > > >
 > > > > B
 > > > >
 > >
 > >
 |  |  |  |  | 
| Re: CreationToolEntry and SimpleFactory [message #143710 is a reply to message #143364] | Tue, 20 July 2004 15:44  |  | 
| Eclipse User  |  |  |  |  | Originally posted by: bandrews.bphnx.com 
 Thanks! The problem was my "contents" EditPart did not implement a
 PropertyChangeListener so it was not receiving notifications on addChild.
 
 Pratik Shah wrote:
 
 > Once your command creates the new object and adds it to the model, the model
 > parent should be firing a property change.  When its corresponding EditPart
 > gets notified of the change in children, it should invoke refreshChildren()
 > (which will create the EditPart for the new child).
 
 > "Barry Andrews" <bandrews@bphnx.com> wrote in message
 > news:cd9c4b$kbv$1@eclipse.org...
 > > I have added a CreationToolEntry object to my PaletteGroup, like this:
 > >
 > > control.add(new CreationToolEntry("Window",
 > >                                   "Create Window",
 > >                                   new SimpleFactory(WindowModel.class),
 > >                                   null,
 > >                                   null);
 > >
 > > When I select this tool then click in the viewer, my execute() method of
 > > my CreateCommand gets called, but nothing is drawn in the viewer.
 > > I believe my createEditPart() method of the PartFactory is supposed to be
 > > called by the framework somewhere in here, but where? It does not get
 > > called at all. What could I be doing wrong?
 > >
 > > Any help is very much appreciated as my hair is beginning to fall out!
 > >
 > > thanks,
 > >
 > > B
 > >
 |  |  |  | 
 
 
 Current Time: Mon Oct 27 16:44:52 EDT 2025 
 Powered by FUDForum . Page generated in 0.06137 seconds |