Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » ViewPart Menu(How to change a Viewpart tab context menu)
ViewPart Menu [message #756567] Mon, 14 November 2011 11:18 Go to next message
David Casas is currently offline David CasasFriend
Messages: 58
Registered: November 2011
Location: Barcelona
Member

Hi guys,

I am developing a RCP applications, and I have been unable to find how can I change Viewpart's tab menu (the one that have Detached, Move, Close... actions). Could anyone help me?

On the other hand, I want to know if there is a way to translate all these commands, I have tried to override org.eclipse.ui.window.maximizePart without success...

Thank you in advance
Re: ViewPart Menu [message #756617 is a reply to message #756567] Mon, 14 November 2011 14:21 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

The pane menu (called the system menu in eclipse) is provided by the presentation (generally the 3.x presentation that provides a presentation factory and follows the presentation API). AFAIK it is not extensible.

PW


Re: ViewPart Menu [message #756719 is a reply to message #756617] Mon, 14 November 2011 19:17 Go to previous messageGo to next message
Catalin Gerea is currently offline Catalin GereaFriend
Messages: 89
Registered: July 2009
Location: Bucharest, Romania
Member

Here is a code that will allow you to hide that menu; but to change it as Paul is said it is not possible.
BTW, what is your use case for changing that menu?

Display display = PlatformUI.createDisplay();
    display.addFilter(SWT.MenuDetect, new Listener() {
      @Override
      public void handleEvent(Event aEvent) {
        if (aEvent.widget != null) {
          if (aEvent.widget.getClass() == CTabFolder.class) {
            aEvent.type = SWT.None;
          }
        }
      }
    });


Time is what you make of it.
Re: ViewPart Menu [message #757090 is a reply to message #756719] Wed, 16 November 2011 13:22 Go to previous messageGo to next message
David Casas is currently offline David CasasFriend
Messages: 58
Registered: November 2011
Location: Barcelona
Member

Hi again and thanxs for your responses,

the thing is our application is wrotten in Spanish, so I wanted to have this menu translated in that language.

However I think it is not a bad option to hide, so I will put all needed options in the viewpart menu.

Thanks for your help!
Re: ViewPart Menu [message #757158 is a reply to message #757090] Wed, 16 November 2011 20:07 Go to previous messageGo to next message
Catalin Gerea is currently offline Catalin GereaFriend
Messages: 89
Registered: July 2009
Location: Bucharest, Romania
Member

If it was only the case of translating those entries to spanish then a language fragment will solve your problem.
Please read this article: http://www.eclipse.org/articles/Article-Speak-The-Local-Language/article.html. Then download the appropriate language pack from http://eclipse.org/babel/ and integrate it into your build if necessary. For that menu you have pointed to the 'responsible' plugin containing the properties file is: org.eclipse.ui.workbench.

Note that in my case it was decided by the client to remove those menu entries.


Time is what you make of it.
Re: ViewPart Menu [message #788277 is a reply to message #756567] Wed, 01 February 2012 15:45 Go to previous messageGo to next message
David Casas is currently offline David CasasFriend
Messages: 58
Registered: November 2011
Location: Barcelona
Member

Thanks Catalin,

I finally chose to hide that menu, I think it is better this way. Thank's for your help.

Cheers
Re: ViewPart Menu [message #789069 is a reply to message #788277] Thu, 02 February 2012 15:17 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Just a note. That won't work reliable in eclipse 4.2, as the presentation has changed.

PW


Previous Topic:Webstart: jredesc in component ignored: null
Next Topic:View with multiple relative views in perspective extension
Goto Forum:
  


Current Time: Sun Nov 29 08:28:51 GMT 2020

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

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

Back to the top