|
Re: editorpart menuManager [message #437130 is a reply to message #437119] |
Thu, 22 September 2005 08:24 |
Eclipse User |
|
|
|
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 #437216 is a reply to message #437147] |
Fri, 23 September 2005 09:06 |
Eclipse User |
|
|
|
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 |
imre farkas 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 |
|
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
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
|
|
|
|
Powered by
FUDForum. Page generated in 0.04570 seconds