[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
[news.eclipse.tools.gef] Re: how to delete element in a MultiPageEditorPart
|
Here you go:
<cite>
What I had to do additionally was
1. to register the MultipageEditor as SelectionListener.
getSite().getWorkbenchWindow().getSelectionService().addSelectionListener(th
is);
2. Implement the ISelectionListener allmost as you suggested:
public void selectionChanged(IWorkbenchPart part, ISelection selection) {
if (this.equals(getSite().getPage().getActiveEditor())) {
if (netEditor.equals(getActiveEditor()))
netEditor.selectionChanged(getActiveEditor(), selection);
}
}
}
3. to override the selectionChanged method in my Editor.
public void selectionChanged(IWorkbenchPart part, ISelection selection) {
super.selectionChanged(part, selection);
if (this.equals(part)) { // Propagated from MyMultiPageEditor.
updateActions(getSelectionActions());
}
}
"Ingo Koch" <ingo.koch[nospam]@sap.com> wrote in message
news:duh51k$uh2$1@xxxxxxxxxxxxxx
> You have to update the selection actions of your sub editor.
> There?s already a thread in this newsgroup.
>
>
>
> "Patrick" <patricktessier@xxxxxxxxx> wrote in message
> news:0d487570ad37034882e303bb92583707$1@xxxxxxxxxxxxxxxxxx
> > Hi,
> >
> > I would like to use delete action with a multiPageEditorPart.
> > so
> > I have create EditorContextMenuProvider in which i have write:
> >
> >
> > action = getActionRegistry().getAction(ActionFactory.DELETE.getId());
> > if (action.isEnabled())
> > menu.appendToGroup(GEFActionConstants.GROUP_EDIT, action);
> >
> > But the "action.isEnabled" return always false whereas in a simple
editor
> > it runs.
> > What have to do?
> >
> > Thanks
> >
>
>