Skip to main content



      Home
Home » Eclipse Projects » GEF » accessing to Workbench from EditPart
accessing to Workbench from EditPart [message #42524] Fri, 15 November 2002 10:04 Go to next message
Eclipse UserFriend
hi all,

I want to open a new editor window when user double clicks on the figure of
a editpart. so I need to access to:

getActiveWorkbenchWindow().getActivePage().openEditor(...)

method. how can I access to Workbench ?


thanx,
ozgur
Re: accessing to Workbench from EditPart [message #42650 is a reply to message #42524] Fri, 15 November 2002 13:15 Go to previous messageGo to next message
Eclipse UserFriend
Hi Ozgur,

I use the following code to open a new drawing in the same editor, that's
not the same you want but gives you propably a hint for your problem. The
code is part of the command for opening the new diagramm.

Dieter

public void execute() {

System.out.println("Called OpenKernelCommand.execute for" +
part.getClassName());

EditPartViewer viewer = editPart.getRoot().getViewer();

lastFactory = viewer.getEditPartFactory();

lastEditPart = viewer.getContents();


EditPart editPart = new PartNetKernelEditPart();

editPart.setModel(new PartNetKernelAdapter(part,
part.getKernel().getPartNetKernel()));


viewer.setEditPartFactory(new PartNetKernelPartFactory());

viewer.setContents(editPart);


((DefaultEditDomain)viewer.getEditDomain()).setPaletteRoot(P artsModelPlugin.
createPartNetPalette());

}

"Ozgur Kurt" <ozgurkurt@hotmail.com> schrieb im Newsbeitrag
news:ar30ct$d3t$1@rogue.oti.com...
> hi all,
>
> I want to open a new editor window when user double clicks on the figure
of
> a editpart. so I need to access to:
>
> getActiveWorkbenchWindow().getActivePage().openEditor(...)
>
> method. how can I access to Workbench ?
>
>
> thanx,
> ozgur
>
>
Re: accessing to Workbench from EditPart [message #43430 is a reply to message #42524] Mon, 18 November 2002 09:07 Go to previous message
Eclipse UserFriend
try doing this from your edit part:

getEditor().getEditorSite().getWorkbenchWindow().getActivePa ge().openEditor(...);

gett the editor from the DefaultEditDomain.

Ozgur Kurt wrote:

> hi all,

> I want to open a new editor window when user double clicks on the figure of
> a editpart. so I need to access to:

> getActiveWorkbenchWindow().getActivePage().openEditor(...)

> method. how can I access to Workbench ?


> thanx,
> ozgur
Previous Topic:excluding actions from commandstack
Next Topic:is it possible to hide connections, like in visual age
Goto Forum:
  


Current Time: Tue Jul 22 19:09:37 EDT 2025

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

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

Back to the top