Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » get editpart of editorpart
get editpart of editorpart [message #213169] Wed, 10 December 2008 13:45 Go to next message
Michael is currently offline MichaelFriend
Messages: 23
Registered: July 2009
Junior Member
Hi,

I get the EditorPart of my diagram with the following code:
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage().getActiveEditor()
My goal is to reach the EditPartViewer to fire a command
viewer.getEditDomain().getCommandStack().execute(command)

How can I get the Editpart or EditpartViewer?

Thanks,
Michael
Re: get editpart of editorpart [message #213242 is a reply to message #213169] Thu, 11 December 2008 15:05 Go to previous message
Thomas Beyer is currently offline Thomas BeyerFriend
Messages: 47
Registered: July 2009
Member
Hello Michael,

I think you were almost there...
Try the following code:

IEditorPart iep =
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage().getActiveEditor();
if(iep instanceof DiagramDocumentEditor){

DiagramDocumentEditor dde = (DiagramDocumentEditor)iep;

}

The DiagramDocumentEditor will let you access the DiagramEditPart, the
corresponding TransactionalEditingDomain a.s.o.

HTH & regards

Thomas

"Michael Dengler" <mail@dengl.com> schrieb im Newsbeitrag
news:ghoh6u$nfc$1@build.eclipse.org...
> Hi,
>
> I get the EditorPart of my diagram with the following code:
> PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage().getActiveEditor()
> My goal is to reach the EditPartViewer to fire a command
> viewer.getEditDomain().getCommandStack().execute(command)
>
> How can I get the Editpart or EditpartViewer?
>
> Thanks,
> Michael
Previous Topic:GMF query
Next Topic:Problem with connection on editor reload
Goto Forum:
  


Current Time: Wed Sep 25 04:51:05 GMT 2024

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

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

Back to the top