Extract the editpart for a specific component [message #120247] |
Wed, 08 March 2006 23:27  |
Eclipse User |
|
|
|
Originally posted by: solomonpaul55.gmail.com
Hi all,
I have a wizard that writes code for a visual component(JPanel).I am
able to view the component added to the source code in visual Editor.
In the Wizard finish after adding the code.I am trying to get the
VisualEditor's TreeViewer and extract the editpart for that specific
component.
I am not able to find that component on the visual Editor's TreeViewer.
Can any body please help me solve this problem?
Thank You and Best Regards,
SOLOMON
|
|
|
|
|
|
|
|
|
|
|
Re: Extract the editpart for a specific component [message #612288 is a reply to message #120247] |
Thu, 09 March 2006 10:10  |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
You probably shouldn't be trying the tree viewer. The bean viewer is not
required to be open. You probably should be looking for the graphical
editpart.
To find a graphical editpart given the model object (the EMF
IJavaObjectInstance), use from the GraphicalViewer,
viewer.getEditPartRegistry().get(model)
This will return the GraphicalEditPart for that model in the graphical
viewer.
--
Thanks,
Rich Kulp
|
|
|
Re: Extract the editpart for a specific component [message #612294 is a reply to message #120273] |
Fri, 10 March 2006 06:20  |
Eclipse User |
|
|
|
Originally posted by: solomonpaul55.gmail.com
Hi Rich,
Thanks for reply. I am already using the graphical viewer from the
EditDomain of the Visual Editor i.e. ScrollingGraphicalViewer.
The problem I am facing is explained below.
I have a wizard, which writes code for a visual component to the Java
source file using AST. In the final stage of a custom wizard, I am trying
to extract the EditPart for the visual component that I just added to the
source file from the ScrollingGraphicalViewer. But I am unable to find the
EditPart for the Visual Component in the method performFinish of the
Wizard code. After the Wizard completion I am able to view that visual
component on the Free form. Can you please help me solve this problem?
Thanks,
Regards,
Solomon.
|
|
|
Re: Extract the editpart for a specific component [message #612296 is a reply to message #120345] |
Fri, 10 March 2006 09:54  |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
Editparts don't show up immediately, neither on the tree nor the graph
viewer. Changes made directly to code are processed in a background job
and you don't know when it will be done. Though typically within a second.
Why do you need the editpart? Maybe there is something else that can be
done.
--
Thanks,
Rich Kulp
|
|
|
Re: Extract the editpart for a specific component [message #612308 is a reply to message #120367] |
Tue, 14 March 2006 00:37  |
Eclipse User |
|
|
|
Originally posted by: solomonpaul55.gmail.com
Hi Rich,
Thanks for the reply.
I am parsing through the Graphical viewer and building a Component
Viewer tree that is similar to Java Bean tree viewer ,but with a
different classification.
The wizard is used to create one type of component. When I have finished
with the creation of the component. I also wanted it to appear on the
tree. Hence I am trying to parse the current graphical viewer and trying
to get hold of that edit part and add to the tree node representing the
component just added.
Hence I need to capture the editpart for the code just added . Can you
please help me in this regard.
Regards And Thank You
SOLOMON
|
|
|
|
|
Re: Extract the editpart for a specific component [message #612314 is a reply to message #120559] |
Wed, 15 March 2006 09:31  |
Eclipse User |
|
|
|
Originally posted by: richkulp.us.NO_SPAM.ibm.com
That's going to be a problem. There is no way to know when the code will
be parsed and the actual editpart created. It happens "later" because it
happens in background job. The best I can suggest is to add an EditPart
listener to the parent graphical editpart (the one that was in the model
BEFORE you did anything, and the one that has the first new child
editpart added to it). The childAdded() notification will tell you when
a child editpart was added to it. Once you get everything of interest
you can then remove the listener.
SOLOMON wrote:
> I am adding it directly to the code using AST.
>
> Thanks SOLOMON
>
--
Thanks,
Rich Kulp
|
|
|
|
Powered by
FUDForum. Page generated in 0.05845 seconds