[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.gmf] Re: get editpart of editorpart

Hello Michael,

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

IEditorPart iep = 
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().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@xxxxxxxxx> schrieb im Newsbeitrag 
news:ghoh6u$nfc$1@xxxxxxxxxxxxxxxxxxxx
> Hi,
>
> I get the EditorPart of my diagram with the following code:
> PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().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