Search in sources :

Example 1 with CommandContributionItemParameter

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);
}
Also used : HashMap(java.util.HashMap) CommandContributionItemParameter(org.eclipse.ui.menus.CommandContributionItemParameter) CommandContributionItem(org.eclipse.ui.menus.CommandContributionItem)

Example 2 with CommandContributionItemParameter

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);
}
Also used : CommandContributionItemParameter(org.eclipse.ui.menus.CommandContributionItemParameter) CommandContributionItem(org.eclipse.ui.menus.CommandContributionItem)

Example 3 with CommandContributionItemParameter

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);
}
Also used : CommandContributionItemParameter(org.eclipse.ui.menus.CommandContributionItemParameter) CommandContributionItem(org.eclipse.ui.menus.CommandContributionItem)

Example 4 with CommandContributionItemParameter

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) };
}
Also used : HashMap(java.util.HashMap) IContributionItem(org.eclipse.jface.action.IContributionItem) CommandContributionItemParameter(org.eclipse.ui.menus.CommandContributionItemParameter) HashMap(java.util.HashMap) Map(java.util.Map) CommandContributionItem(org.eclipse.ui.menus.CommandContributionItem)

Example 5 with CommandContributionItemParameter

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);
    }
}
Also used : CommandContributionItemParameter(org.eclipse.ui.menus.CommandContributionItemParameter) ArrayList(java.util.ArrayList) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage) CommandContributionItem(org.eclipse.ui.menus.CommandContributionItem)

Aggregations

CommandContributionItemParameter (org.eclipse.ui.menus.CommandContributionItemParameter)31 CommandContributionItem (org.eclipse.ui.menus.CommandContributionItem)30 HashMap (java.util.HashMap)9 IContributionItem (org.eclipse.jface.action.IContributionItem)4 ResultSetPanelDescriptor (org.jkiss.dbeaver.ui.controls.resultset.panel.ResultSetPanelDescriptor)4 DataTransferNodeDescriptor (org.jkiss.dbeaver.tools.transfer.registry.DataTransferNodeDescriptor)3 DataTransferProcessorDescriptor (org.jkiss.dbeaver.tools.transfer.registry.DataTransferProcessorDescriptor)3 InvocationTargetException (java.lang.reflect.InvocationTargetException)2 DecimalFormat (java.text.DecimalFormat)2 java.util (java.util)2 List (java.util.List)2 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)2 IAdaptable (org.eclipse.core.runtime.IAdaptable)2 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)2 IStatus (org.eclipse.core.runtime.IStatus)2 Status (org.eclipse.core.runtime.Status)2 org.eclipse.jface.action (org.eclipse.jface.action)2 IDialogConstants (org.eclipse.jface.dialogs.IDialogConstants)2 IDialogSettings (org.eclipse.jface.dialogs.IDialogSettings)2 IFindReplaceTarget (org.eclipse.jface.text.IFindReplaceTarget)2