| 
| Radio Buttons in Dynamic Menu [message #331563] | Thu, 11 September 2008 14:37  |  | 
| Eclipse User  |  |  |  |  | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html>
 <head>
 </head>
 <body bgcolor="#ffffff" text="#000000">
 <font face="Helvetica, Arial, sans-serif">Hi,<br>
 <br>
 I am trying to put a <u>dynamic menu</u> in my Common Navigator View.<br>
 I want this menu to have 5 choices - radio buttons. My NON-WORKING :)
 code is below.<br>
 The elements are apearing in the dynamic menu, but the RADIO buttons
 behaviour is not working properly (cause the black bullet is not
 showing)<br>
 Does anybody knows why?<br>
 <br>
 Thank you so much,<br>
 AR<br>
 </font><br>
 public class <b>MMFEListContributionItem </b>extends
 CompoundContributionItem {<br>
 <br>
     public static final String MMFE_LIST_CI_ID =
 "com.csw.macs.core.SetMMFEContribution";<br>
     private static final String SET_MMFE_COMMAND_ID =
 "setMMFEInConfigContentsViewCommand";<br>
 <br>
     @Override<br>
     protected IContributionItem[] <b>getContributionItems</b>() {<br>
         <br>
         ConfigurationInstantiation ci =
 ConfigurationContentsNavigator.getSelectedCI();<br>
         Map<String, Object> parameters = new HashMap<String,
 Object>();<br>
         if (ci != null) {<br>
             ArrayList<IContributionItem> contribItems = new
 ArrayList<IContributionItem>();<br>
             //Start group marker<br>
             contribItems.add(new GroupMarker("MMFEs_START"));<br>
             for (MmfeInstance mmfei : ci.getMmfeinstances()) {<br>
                 <b>ccipSetMMFE </b>= new
 CommandContributionItemParameter(PlatformUI.getWorkbench()<br >
                         .getActiveWorkbenchWindow(), MMFE_LIST_CI_ID,
 SET_MMFE_COMMAND_ID,<br>
                         CommandContributionItem.STYLE_PUSH);<br>
                 // set the command id<br>
                 ccipSetMMFE.commandId = SET_MMFE_COMMAND_ID;<br>
                 ccipSetMMFE.style = <b>CommandContributionItem.STYLE_RADIO</b>;<br>
                 // set the parameters for this command<br>
                 parameters.clear();<br>
                 parameters.put("mmfeId",
 Integer.toString(mmfei.getId()));<br>
                 ccipSetMMFE.parameters = parameters;<br>
                 // set the label<br>
                 ccipSetMMFE.label = mmfei.getName();<br>
                 contribItems.add(new CommandContributionItem(<b>ccipSetMMFE</b>));<br>
             }<br>
             return contribItems.toArray(new IContributionItem[] {});<br>
         } else<br>
             return new ContributionItem[0];<br>
     }<br>
 <br>
 }<br>
 <br>
 <br>
 </body>
 </html>
 |  |  |  | 
|  | 
Powered by 
FUDForum. Page generated in 0.02826 seconds