Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Get the editPart from an Impl
Get the editPart from an Impl [message #206169] Sun, 21 September 2008 17:09 Go to next message
Eclipse UserFriend
Hello,

is this possible? I load the Object over the xmi file. Now i want to get
the EditPart from some Objects. It must be the way from the impl to an
editpart. Maybe its possible if i have the model and graphical
definition in one file?

Greetings
Jörg
Re: Get the editPart from an Impl [message #206238 is a reply to message #206169] Mon, 22 September 2008 09:47 Go to previous messageGo to next message
Eclipse UserFriend
Hi Jörg,
do you have the editor up on your workbench?
I use to do this:
XXXDiagramEditor editor =
(XXXDiagramEditor)PlatformUI.getWorkbench().getActiveWorkben chWindow().getActivePage().getActiveEditor();

RootEditPart p = (RootEditPart) editor.getDiagramEditPart();

then with
p.getChildren() you have all the editparts of the diagram :)

Hope it helps,
best,
Ugo


Jörg wrote:
> Hello,
>
> is this possible? I load the Object over the xmi file. Now i want to get
> the EditPart from some Objects. It must be the way from the impl to an
> editpart. Maybe its possible if i have the model and graphical
> definition in one file?
>
> Greetings
> Jörg
Re: Get the editPart from an Impl [message #206325 is a reply to message #206238] Mon, 22 September 2008 16:14 Go to previous messageGo to next message
Eclipse UserFriend
Thank you for your reply. But i have the workbench. My problem is, that
i don't get the real semantiv object with getChildren() and then
getModel() and getElement(). This objects seems to be copies of the
current impl, because these objects references(a structual feature) to
other objects than expected.

Greetings

Ugo Sangiorgi schrieb:
> Hi Jörg,
> do you have the editor up on your workbench?
> I use to do this:
> XXXDiagramEditor editor =
> (XXXDiagramEditor)PlatformUI.getWorkbench().getActiveWorkben chWindow().getActivePage().getActiveEditor();
>
>
> RootEditPart p = (RootEditPart) editor.getDiagramEditPart();
>
> then with
> p.getChildren() you have all the editparts of the diagram :)
>
> Hope it helps,
> best,
> Ugo
>
>
> Jörg wrote:
>> Hello,
>>
>> is this possible? I load the Object over the xmi file. Now i want to
>> get the EditPart from some Objects. It must be the way from the impl
>> to an editpart. Maybe its possible if i have the model and graphical
>> definition in one file?
>>
>> Greetings
>> Jörg
Re: Get the editPart from an Impl [message #206333 is a reply to message #206325] Mon, 22 September 2008 16:27 Go to previous messageGo to next message
Eclipse UserFriend
Can somebody say me, where i find the code(not the interface) for the
getElement() Methode?

Jörg schrieb:
> Thank you for your reply. But i have the workbench. My problem is, that
> i don't get the real semantiv object with getChildren() and then
> getModel() and getElement(). This objects seems to be copies of the
> current impl, because these objects references(a structual feature) to
> other objects than expected.
>
> Greetings
>
> Ugo Sangiorgi schrieb:
>> Hi Jörg,
>> do you have the editor up on your workbench?
>> I use to do this:
>> XXXDiagramEditor editor =
>> (XXXDiagramEditor)PlatformUI.getWorkbench().getActiveWorkben chWindow().getActivePage().getActiveEditor();
>>
>>
>> RootEditPart p = (RootEditPart) editor.getDiagramEditPart();
>>
>> then with
>> p.getChildren() you have all the editparts of the diagram :)
>>
>> Hope it helps,
>> best,
>> Ugo
>>
>>
>> Jörg wrote:
>>> Hello,
>>>
>>> is this possible? I load the Object over the xmi file. Now i want to
>>> get the EditPart from some Objects. It must be the way from the impl
>>> to an editpart. Maybe its possible if i have the model and graphical
>>> definition in one file?
>>>
>>> Greetings
>>> Jörg
Re: Get the editPart from an Impl [message #206350 is a reply to message #206333] Mon, 22 September 2008 21:23 Go to previous message
Eclipse UserFriend
You can always run your code in a debug environment, set up a
watchpoint, and backtrace until you find the actual getElement()
implementation.

Jevon

Jörg wrote:
> Can somebody say me, where i find the code(not the interface) for the
> getElement() Methode?
>
> Jörg schrieb:
>> Thank you for your reply. But i have the workbench. My problem is,
>> that i don't get the real semantiv object with getChildren() and then
>> getModel() and getElement(). This objects seems to be copies of the
>> current impl, because these objects references(a structual feature) to
>> other objects than expected.
>>
>> Greetings
>>
>> Ugo Sangiorgi schrieb:
>>> Hi Jörg,
>>> do you have the editor up on your workbench?
>>> I use to do this:
>>> XXXDiagramEditor editor =
>>> (XXXDiagramEditor)PlatformUI.getWorkbench().getActiveWorkben chWindow().getActivePage().getActiveEditor();
>>>
>>>
>>> RootEditPart p = (RootEditPart) editor.getDiagramEditPart();
>>>
>>> then with
>>> p.getChildren() you have all the editparts of the diagram :)
>>>
>>> Hope it helps,
>>> best,
>>> Ugo
>>>
>>>
>>> Jörg wrote:
>>>> Hello,
>>>>
>>>> is this possible? I load the Object over the xmi file. Now i want to
>>>> get the EditPart from some Objects. It must be the way from the impl
>>>> to an editpart. Maybe its possible if i have the model and graphical
>>>> definition in one file?
>>>>
>>>> Greetings
>>>> Jörg
Previous Topic:Custom (runtime) attributes set for EClass
Next Topic:diagram file
Goto Forum:
  


Current Time: Fri Jul 04 17:04:17 EDT 2025

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

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

Back to the top