Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 21:09 Go to next message
Oelerink is currently offline OelerinkFriend
Messages: 129
Registered: July 2009
Senior Member
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 13:47 Go to previous messageGo to next message
Ugo Sangiorgi is currently offline Ugo SangiorgiFriend
Messages: 44
Registered: July 2009
Member
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 20:14 Go to previous messageGo to next message
Oelerink is currently offline OelerinkFriend
Messages: 129
Registered: July 2009
Senior Member
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 20:27 Go to previous messageGo to next message
Oelerink is currently offline OelerinkFriend
Messages: 129
Registered: July 2009
Senior Member
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] Tue, 23 September 2008 01:23 Go to previous message
Jevon  is currently offline Jevon Friend
Messages: 164
Registered: July 2009
Senior Member
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: Wed Jan 27 11:05:56 GMT 2021

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

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

Back to the top