use of org.eclipse.ui.menus.CommandContributionItemParameter in project yamcs-studio by yamcs.
the class SwitchProcessorCompoundContributionItem method createProcessorItem.
private CommandContributionItem createProcessorItem(ProcessorInfo processor) {
CommandContributionItemParameter itemParameter = new CommandContributionItemParameter(PlatformUI.getWorkbench().getActiveWorkbenchWindow(), null, SWITCH_PROCESSOR_COMMAND, CommandContributionItem.STYLE_RADIO);
HashMap<String, String> params = new HashMap<>();
params.put(RadioState.PARAMETER_ID, processor.getName());
itemParameter.label = processor.getName();
itemParameter.parameters = params;
return new CommandContributionItem(itemParameter);
}
use of org.eclipse.ui.menus.CommandContributionItemParameter in project core by jcryptool.
the class FlexiProviderOperationsView method addContributionItem.
private void addContributionItem(IContributionManager manager, final String commandId, final ImageDescriptor icon, final String tooltip) {
CommandContributionItemParameter param = new CommandContributionItemParameter(serviceLocator, null, commandId, SWT.PUSH);
if (icon != null)
param.icon = icon;
if (tooltip != null && !tooltip.equals(""))
param.tooltip = tooltip;
CommandContributionItem item = new CommandContributionItem(param);
manager.add(item);
}
use of org.eclipse.ui.menus.CommandContributionItemParameter in project egit by eclipse.
the class ResetMenu method getCommandContributionItem.
private static CommandContributionItem getCommandContributionItem(String commandId, String menuLabel, Map<String, String> parameters, IWorkbenchSite site) {
CommandContributionItemParameter parameter = new CommandContributionItemParameter(site, commandId, commandId, CommandContributionItem.STYLE_PUSH);
parameter.label = menuLabel;
parameter.parameters = parameters;
return new CommandContributionItem(parameter);
}
use of org.eclipse.ui.menus.CommandContributionItemParameter in project jbosstools-openshift by jbosstools.
the class ScaleDeploymentContributionItem method getContributionItems.
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
protected IContributionItem[] getContributionItems() {
if (!isRelevant()) {
return new IContributionItem[0];
}
Map mapUp = new HashMap();
mapUp.put(ScaleDeploymentHandler.REPLICA_DIFF, "1");
CommandContributionItemParameter pUp = new CommandContributionItemParameter(fServiceLocator, DYNAMIC_ITEM_ID + ".up", COMMAND_ID, mapUp, OpenShiftImages.TREND_UP, null, null, "Up", null, "Increment the number of deployed replicas by one.", 0, null, true);
Map mapDown = new HashMap();
mapDown.put(ScaleDeploymentHandler.REPLICA_DIFF, "-1");
CommandContributionItemParameter pDown = new CommandContributionItemParameter(fServiceLocator, DYNAMIC_ITEM_ID + ".down", COMMAND_ID, mapDown, OpenShiftImages.TREND_DOWN, null, null, "Down", null, "Increment the number of deployed replicas by one.", 0, null, true);
CommandContributionItemParameter pTo = new CommandContributionItemParameter(fServiceLocator, DYNAMIC_ITEM_ID + ".to", COMMAND_ID, new HashMap(), null, null, null, "To...", null, "Scale the number of deployed replicas to a specific value.", 0, null, true);
return new IContributionItem[] { new CommandContributionItem(pUp), new CommandContributionItem(pDown), new CommandContributionItem(pTo) };
}
use of org.eclipse.ui.menus.CommandContributionItemParameter in project mdw-designer by CenturyLinkCloud.
the class ShowViewMenu method fillMenu.
private void fillMenu(IMenuManager innerMgr) {
innerMgr.removeAll();
IWorkbenchPage page = window.getActivePage();
if (page == null || page.getPerspective() == null)
return;
// visible actions
List<String> viewIds = Arrays.asList(page.getShowViewShortcuts());
List<CommandContributionItemParameter> actions = new ArrayList<CommandContributionItemParameter>(viewIds.size());
for (String id : viewIds) {
if (id.equals("org.eclipse.ui.internal.introview"))
continue;
CommandContributionItemParameter item = getItem(id);
if (item != null)
actions.add(item);
}
Collections.sort(actions, actionComparator);
for (CommandContributionItemParameter ccip : actions) {
if (WorkbenchActivityHelper.filterItem(ccip))
continue;
CommandContributionItem item = new CommandContributionItem(ccip);
innerMgr.add(item);
}
}
Aggregations