Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » how to delete element in a MultiPageEditorPart
how to delete element in a MultiPageEditorPart [message #210616] Thu, 02 March 2006 08:33 Go to next message
Eclipse UserFriend
Originally posted by: patricktessier.orange.fr

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
Re: how to delete element in a MultiPageEditorPart [message #210800 is a reply to message #210616] Mon, 06 March 2006 11:05 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ingo.koch[nospam].sap.com

You have to update the selection actions of your sub editor.
There?s already a thread in this newsgroup.



"Patrick" <patricktessier@orange.fr> wrote in message
news:0d487570ad37034882e303bb92583707$1@www.eclipse.org...
> 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
>
Re: how to delete element in a MultiPageEditorPart [message #210806 is a reply to message #210800] Mon, 06 March 2006 11:09 Go to previous message
Eclipse UserFriend
Originally posted by: ingo.koch[nospam].sap.com

Here you go:

<cite>

What I had to do additionally was
1. to register the MultipageEditor as SelectionListener.

getSite().getWorkbenchWindow().getSelectionService().addSele ctionListener(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@eclipse.org...
> You have to update the selection actions of your sub editor.
> There?s already a thread in this newsgroup.
>
>
>
> "Patrick" <patricktessier@orange.fr> wrote in message
> news:0d487570ad37034882e303bb92583707$1@www.eclipse.org...
> > 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
> >
>
>
Previous Topic:UMLClass diagram of GEF
Next Topic:Image not visible on label
Goto Forum:
  


Current Time: Fri Apr 26 04:40:01 GMT 2024

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

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

Back to the top