Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Visual Editor (VE) » Extract the editpart for a specific component
Extract the editpart for a specific component [message #120247] Thu, 09 March 2006 04:27 Go to next message
Eclipse UserFriend
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 #120273 is a reply to message #120247] Thu, 09 March 2006 15:10 Go to previous messageGo to next message
Eclipse UserFriend
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 #120345 is a reply to message #120273] Fri, 10 March 2006 11:20 Go to previous messageGo to next message
Eclipse UserFriend
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 #120367 is a reply to message #120345] Fri, 10 March 2006 14:54 Go to previous messageGo to next message
Eclipse UserFriend
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 #120516 is a reply to message #120367] Tue, 14 March 2006 05:37 Go to previous messageGo to next message
Eclipse UserFriend
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 #120547 is a reply to message #120516] Tue, 14 March 2006 14:14 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

Are you adding it directly to the code, or are you adding it through the
EMF java model?

--
Thanks,
Rich Kulp
Re: Extract the editpart for a specific component [message #120559 is a reply to message #120547] Wed, 15 March 2006 04:12 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: solomonpaul55.gmail.com

I am adding it directly to the code using AST.

Thanks
SOLOMON
Re: Extract the editpart for a specific component [message #120595 is a reply to message #120559] Wed, 15 March 2006 14:31 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: Extract the editpart for a specific component [message #120977 is a reply to message #120595] Tue, 28 March 2006 10:24 Go to previous message
Eclipse UserFriend
Originally posted by: solomonpaul55.gmail.com

Hi Rich,

Thanks a lot.I can access the new child editpart just added using
the
EditPartListener.


Regards,
SOLOMON
Re: Extract the editpart for a specific component [message #612288 is a reply to message #120247] Thu, 09 March 2006 15:10 Go to previous message
Eclipse UserFriend
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 11:20 Go to previous message
Eclipse UserFriend
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 14:54 Go to previous message
Eclipse UserFriend
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 05:37 Go to previous message
Eclipse UserFriend
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 #612310 is a reply to message #120516] Tue, 14 March 2006 14:14 Go to previous message
Eclipse UserFriend
Originally posted by: richkulp.us.NO_SPAM.ibm.com

Are you adding it directly to the code, or are you adding it through the
EMF java model?

--
Thanks,
Rich Kulp
Re: Extract the editpart for a specific component [message #612311 is a reply to message #120547] Wed, 15 March 2006 04:12 Go to previous message
Eclipse UserFriend
Originally posted by: solomonpaul55.gmail.com

I am adding it directly to the code using AST.

Thanks
SOLOMON
Re: Extract the editpart for a specific component [message #612314 is a reply to message #120559] Wed, 15 March 2006 14:31 Go to previous message
Eclipse UserFriend
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
Re: Extract the editpart for a specific component [message #612370 is a reply to message #120595] Tue, 28 March 2006 10:24 Go to previous message
Eclipse UserFriend
Originally posted by: solomonpaul55.gmail.com

Hi Rich,

Thanks a lot.I can access the new child editpart just added using
the
EditPartListener.


Regards,
SOLOMON
Previous Topic:NullPointerException when creating a new Visual class
Next Topic:generating xml for the VE Editor
Goto Forum:
  


Current Time: Thu Apr 25 13:00:36 GMT 2024

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

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

Back to the top