Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 41dcf8a99979e5303b692805966e2a79a62b30e9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*******************************************************************************
 * Copyright (c) 2013 CEA LIST.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors:
 *     Cedric Dumoulin - cedric.dumoulin@lifl.fr
 ******************************************************************************/
package org.eclipse.papyrus.layers.stackmodel.diagram.ui.handlers;

import java.util.HashMap;
import java.util.Map;

import org.eclipse.jface.action.IContributionItem;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.CompoundContributionItem;
import org.eclipse.ui.menus.CommandContributionItem;


/**
 * This class is responsible to create the dynamic menu allowing to create
 * child elements of a Layer Model.
 * 
 * @author cedric dumoulin
 *
 */
public class DynamicCreateChildMenu extends CompoundContributionItem {

	/**
	 * @see org.eclipse.ui.actions.CompoundContributionItem#getContributionItems()
	 *
	 * @return
	 */
	@Override
	protected IContributionItem[] getContributionItems() {
//		System.err.println("getContributionItems()");
		IContributionItem[] items = new IContributionItem[1];
		
	    Map<String, String> parms = new HashMap<String, String>();
	    parms.put("groupBy", "Severity");
	    items[0] = new CommandContributionItem(PlatformUI.getWorkbench().getActiveWorkbenchWindow(), null,
	            "org.eclipse.ui.views.problems.grouping",
	            parms, null, null, null, "Severity", null,
	            null, CommandContributionItem.STYLE_PUSH);
		return items;
	}

}

Back to the top