Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » The submenu is present in the UI (I'm able to see it). But, when I try to access it programmatically
The submenu is present in the UI (I'm able to see it). But, when I try to access it programmatically [message #1698711] Wed, 17 June 2015 11:48
Palraj Jayaraj is currently offline Palraj JayarajFriend
Messages: 15
Registered: June 2015
Junior Member
We are having a view, with pulldownmenu items (Group by, Grouped by). 'Group by' has sub-menu which are the columns in the views. When any of the submenu is selected, THe view entries will be grouped with the column and also there will be a entry added to 'Group by' Menu.

We are having a util method of signature:

public static void clickPullDownMenuItem(String viewID, String menu){
display.asyncExec(new Runnable() {
 
  @Override
  public void run() {
    IViewPart viewPart = getView(viewID);
    MenuManager mainMenuManager = (MenuManager) viewPart.getViewSite().getActionBars().getMenuManager();
    IContributionItem[] items = mainMenuManager.getItems();
    //iterate to through the items and invoke the action of the item.
  }
  Thread.sleep(2000);
}


I use the below calls to simulate the same.

1. clickPullDownMenuItem(viewID, "Group by/Resource")
2. clickPullDownMenuItem(viewID, "Grouped by/Resource")


After the first statement is executed I am able to see the 'Resource' entry in the 'Grouped by' menu. But, when the second statement is being executed, I'm getting no items under 'Grouped by' in the above method.

The thing I don't understand is the submenu is present in the UI (I'm able to see it). But, when I try to access it programmatically, I'm not getting that submenu.
Previous Topic:drawImage directly to browser <image>
Next Topic:Wizard not Displaying Second Page
Goto Forum:
  


Current Time: Fri Apr 26 01:08:57 GMT 2024

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

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

Back to the top