Palette Tools/Entries confusing [message #93177] |
Wed, 10 September 2003 03:23  |
Eclipse User |
|
|
|
I added a palette to my simple GEF application. It has at the moment 2
buttons.
One is a CreationToolEntry and the other ConnectionCreationToolEntry.
Clicking on creationtoolentry, creates a tool and allows mouseDrag
feedback but has no visible effect afterwards. With some debug output, and
by commenting out createTool(), I discovered that the ToolEntry itself
(setup with a simpleFactory) creates the feedback and creates an instance
of whatever the Factory is set up to create.
I can't get the tool to do anything.
Looking at the JavaDoc for ToolEntry, then CreationFactory, SimpleFactory
doesn't tell you what the factory is supposed to create. You have to go to
the Tool's page-so I eventually found that the Factory is meant to create
the EditPart. Confusingly, in the logic example, the factories create
instances of things in the model package...
The only way I can create Nodes at the moment is by creating the model,
adding it the list of nodes/children and calling refresh from the contents
editpart so that an editpart gets created for it and the associated
figures etc. However, this will only create them at a default location and
size.
What is the process for setting up and using palette tools? What is their
relationship with the entry?
Thanks
Chris Heald
|
|
|
|
Re: Palette Tools/Entries confusing [message #94078 is a reply to message #93990] |
Fri, 12 September 2003 11:43  |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
No, the creation tool sends requests to the target (editpart) of the
creation. See CreateRequest. See LayoutEditPolicy.getCreateCommand. Read
the tutorial for more information about requests, commands, and refreshing
the controllers (editparts) so your new object appears.
"Chris Heald" <chris.heald@m.eads.net> wrote in message
news:bjsh0t$l1p$1@eclipse.org...
> OK, duh! Subclassing inorder to remove a method isn't goign to work...!
> Got the createTool method to return null and indeed, no tool is created
> and no feedback is performed and no objects are created.
>
> But the question remains - How do I get the tool to actually create the
> model, controller and update the display?
> Do I have to subclass the tool?
>
> Thanks
> Chris
>
|
|
|
Powered by
FUDForum. Page generated in 0.04260 seconds