Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8198115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T05:52:59+00:00 2026-06-07T05:52:59+00:00

I need to provide a dynamic popup menu for all views. I can create

  • 0

I need to provide a dynamic popup menu for all views. I can create a dynamic popup menu contributibution, but I must set the URI and register it for certain view. Now I’m trying to register the menu dynamically, when the user selects another view:

public class GlobalSelectionListener implements ISelectionListener {
    HashSet<IWorkbenchPart> extended = new HashSet<IWorkbenchPart>();

    @Override
    public void selectionChanged(IWorkbenchPart part, ISelection selection) {
        if (!extended.contains(part)) {
            IWorkbenchPartSite wps = part.getSite();
            if (wps == null)
                return;
            //creates popup menu for this part
            MenuManager mgr = new MenuManager();
            mgr.add(new DynamicMenu()); //DynamicMenu extends ContributionItem
            wps.registerContextMenu("identifier." + mgr.hashCode(), mgr, wps.getSelectionProvider());
            extended.add(part);
            System.out.println(part + " menu extended");
        }
    }
}

But this does not work. No one menu item appears in popup menu. I don’t know, whether is it ever possible to do it this way. Is there any method to add popup menu for arbitrary view dynamically? It seems, that the registerContextMenu() method does something else.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T05:53:01+00:00Added an answer on June 7, 2026 at 5:53 am

    The problem was not solved, nevertheless there is a workaround. It is possible to register the pop-up menu in plugin.xml file for all views and editors needed. Usualy the number of plugin usecases is limited. If you’re writting a plugin, you know what you need the plugin for. Use the Spy plug-in (ALT+SHIFT+F1) to see the active menu contribution identifiers and register your contribution to the pop-up menu of all views and editors you need.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to create a Dynamic Data Site, but my data is stored in
I know that you can set various callbacks for certain actions, but I need
I have a zend form, and I need to provide a dynamic link on
I can make the same in Django using render_to(...) but ASP.NET. I need to
Im using the jQuery dynamic form plugin , but i need support for nested
I need to provide our web developers an easy and quick way to test
I need to provide some passwords, API keys and similar sensitive data in my
I have a few large forms that I need to provide visual cues about
I'm currently writing an app in Python and need to provide localization for it.
I have a wcf web service and I need to provide the client with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.