Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » editorpart menuManager
editorpart menuManager [message #437119] Wed, 21 September 2005 15:19 Go to next message
imre farkas is currently offline imre farkasFriend
Messages: 26
Registered: July 2009
Junior Member
Hi,

I have a custom editor and I want to get the menu so how to reach the
editorpart menuManager?

thx in advance
-farkas
Re: editorpart menuManager [message #437130 is a reply to message #437119] Thu, 22 September 2005 08:24 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: fleque.users.nospam.sf.net

Hello farkas,

have a look at IEditorActionBarContributor. You can register an
implementation in your editor-extension in the plugin.xml.
The Contributor will be inited by
public void init(IActionBars bars, IWorkbenchPage page);
you can access the menuManager by bars.getMenuManager();
public IMenuManager getMenuManager();

Hope that helps

Regards Alex


farkas wrote:
> Hi,
>
> I have a custom editor and I want to get the menu so how to reach the
> editorpart menuManager?
>
> thx in advance
> -farkas
Re: editorpart menuManager2 [message #437147 is a reply to message #437130] Thu, 22 September 2005 19:50 Go to previous messageGo to next message
imre farkas is currently offline imre farkasFriend
Messages: 26
Registered: July 2009
Junior Member
Fleque wrote:
> Hello farkas,
>
> have a look at IEditorActionBarContributor. You can register an
> implementation in your editor-extension in the plugin.xml.
> The Contributor will be inited by
> public void init(IActionBars bars, IWorkbenchPage page);
> you can access the menuManager by bars.getMenuManager();
> public IMenuManager getMenuManager();
>
> Hope that helps
>
> Regards Alex
>
>
> farkas wrote:
>
>> Hi,
>>
>> I have a custom editor and I want to get the menu so how to reach the
>> editorpart menuManager?
>>
>> thx in advance
>> -farkas

Hi Alex,

Thanks for your help. I try it out what you mentioned and I successfull
reached the MenuManger. But do you have any tip, how can I reach the
EditorMenuManager?

thx in advance
-farkas
Re: editorpart menuManager2 [message #437216 is a reply to message #437147] Fri, 23 September 2005 09:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: fleque.users.nospam.sf.net

Hi farkas,

Well, I thought this is the Editor's menu manager. It lets you manage
contributions to toolbar and menu for the Editor.
Did you mean you wantet to reach the Editor's context menu?
I don't really know how to reach it, but you might have to register a
custom one anyhow. This can be done by
IWorkbenchPartSite or IEditorSite registerContextMenu(...).
The IEditorSite is passed to an Editor in its
init(IEditorSite, IEditorInput) method.

Regards Alex


farkas wrote:
>
> Hi Alex,
>
> Thanks for your help. I try it out what you mentioned and I successfull
> reached the MenuManger. But do you have any tip, how can I reach the
> EditorMenuManager?
>
> thx in advance
> -farkas
>
Re: editorpart menuManager2 [message #437223 is a reply to message #437216] Fri, 23 September 2005 13:39 Go to previous messageGo to next message
imre farkas is currently offline imre farkasFriend
Messages: 26
Registered: July 2009
Junior Member
Fleque wrote:
> Hi farkas,
>
> Well, I thought this is the Editor's menu manager. It lets you manage
> contributions to toolbar and menu for the Editor.
> Did you mean you wantet to reach the Editor's context menu?
> I don't really know how to reach it, but you might have to register a
> custom one anyhow. This can be done by
> IWorkbenchPartSite or IEditorSite registerContextMenu(...).
> The IEditorSite is passed to an Editor in its
> init(IEditorSite, IEditorInput) method.
>
> Regards Alex
>
>
> farkas wrote:
>
>>
>> Hi Alex,
>>
>> Thanks for your help. I try it out what you mentioned and I
>> successfull reached the MenuManger. But do you have any tip, how can I
>> reach the EditorMenuManager?
>>
>> thx in advance
>> -farkas
>>

Hi,

Thanks for your reply. Actally I want to remove the "New Editor" item
from the editor context menu. It seems there are two ways to remove or
nonvisible this menuItem. One, if I can reach the editorManager then I
can remove this item (I think it is not the best way and I do not know
how to get the EditorMenuManager) or the second way I can use the
activites.
When I tried to use the activities did not seem to have any effect.

<extension
point="org.eclipse.ui.activities">
<activity
id="activity.NewEditorItem"
name="NewEditorItem"/>
<activityPatternBinding
activityId="activity.NewEditorItem"

pattern=" org\.eclipse\.ui\.workbench/org\.eclipse\.ui\.window\.newEdi tor "/>
</extension>

And one question is arised, how can I add an item to the custom editor
context menu?


thx
-farkas
Re: editorpart menuManager2 [message #437225 is a reply to message #437223] Fri, 23 September 2005 15:13 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

farkas wrote:
> Thanks for your reply. Actally I want to remove the "New Editor" item
> from the editor context menu. It seems there are two ways to remove or
> nonvisible this menuItem. One, if I can reach the editorManager then I
> can remove this item (I think it is not the best way and I do not know
> how to get the EditorMenuManager) or the second way I can use the
> activites.

That's part of the "system menu", and I haven't seen a way to change it
(it doesn't look like it checks activities).

> When I tried to use the activities did not seem to have any effect.
>
> <extension
> point="org.eclipse.ui.activities">
> <activity
> id="activity.NewEditorItem"
> name="NewEditorItem"/>
> <activityPatternBinding
> activityId="activity.NewEditorItem"
>
> pattern=" org\.eclipse\.ui\.workbench/org\.eclipse\.ui\.window\.newEdi tor "/>
> </extension>

The activity will work if you can find the plugin id and extension id of
the item you want to filter ... that's not it (as it turns out, New
Editor doesn't look like it's an extension contribution).

Later,
PW


Re: editorpart menuManager2 [message #437226 is a reply to message #437225] Fri, 23 September 2005 15:59 Go to previous message
imre farkas is currently offline imre farkasFriend
Messages: 26
Registered: July 2009
Junior Member
Paul Webster wrote:
> farkas wrote:
>
>> Thanks for your reply. Actally I want to remove the "New Editor" item
>> from the editor context menu. It seems there are two ways to remove or
>> nonvisible this menuItem. One, if I can reach the editorManager then I
>> can remove this item (I think it is not the best way and I do not know
>> how to get the EditorMenuManager) or the second way I can use the
>> activites.
>
>
> That's part of the "system menu", and I haven't seen a way to change it
> (it doesn't look like it checks activities).
>
>> When I tried to use the activities did not seem to have any effect.
>>
>> <extension
>> point="org.eclipse.ui.activities">
>> <activity
>> id="activity.NewEditorItem"
>> name="NewEditorItem"/>
>> <activityPatternBinding
>> activityId="activity.NewEditorItem"
>>
>> pattern=" org\.eclipse\.ui\.workbench/org\.eclipse\.ui\.window\.newEdi tor "/>
>>
>> </extension>
>
>
> The activity will work if you can find the plugin id and extension id of
> the item you want to filter ... that's not it (as it turns out, New
> Editor doesn't look like it's an extension contribution).
>
> Later,
> PW

Hi Paul,

You mentioned in earlier post (if I can find the id), I should use
activity for removing "New Editor" item from the editor context menu. As
I see there is no any possibility to remove this item.

thx
-farkas
Previous Topic:Page not available when view is initialized
Next Topic:how to auto resizing composite
Goto Forum:
  


Current Time: Mon Dec 09 07:41:21 GMT 2024

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

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

Back to the top