Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 7e520d2b5811badf580653c996f3efc2a28d26d8 (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
51
52
53
54
55
56
57
58
59
60
61
/******************************************************************************
 * Copyright (c) 2006, 2020 Borland Software Corporation, CEA LIST, Artal
 * 
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License 2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0/ 
 * 
 * SPDX-License-Identifier: EPL-2.0
 *
 * Contributors: 
 *    Alexander Shatalin (Borland) - initial API and implementation
 *    Aurelien Didier (ARTAL) - aurelien.didier51@gmail.com - Bug 569174
 *****************************************************************************/

«IMPORT 'http://www.eclipse.org/papyrus/gmf/2020/GenModel'»
«EXTENSION xpt::navigator::Utils»

«DEFINE NavigatorSorter FOR gmfgen::GenNavigator-»
	«EXPAND xpt::Common::copyright FOR editorGen-»
package «packageName»;

	«EXPAND xpt::Common::generatedClassComment»
public class «sorterClassName»  extends org.eclipse.jface.viewers.ViewerSorter {

	«EXPAND attributes-»
	
	«EXPAND category-»

    «EXPAND additions-»
}
«ENDDEFINE»

«DEFINE attributes FOR gmfgen::GenNavigator-»
	«EXPAND xpt::Common::generatedMemberComment»
private static final int GROUP_CATEGORY = «getMaxVisualID(self) + 2»;
	«IF editorGen.diagram.generateCreateShortcutAction()-»

	«EXPAND xpt::Common::generatedMemberComment»
private static final int SHORTCUTS_CATEGORY = «getMaxVisualID(self) + 1»;
	«ENDIF-»
«ENDDEFINE»

«DEFINE category FOR gmfgen::GenNavigator-»
	«EXPAND xpt::Common::generatedMemberComment»
public int category(Object element) {
	if (element instanceof «getNavigatorItemQualifiedClassName()») {
		«getNavigatorItemQualifiedClassName()» item = («getNavigatorItemQualifiedClassName()») element;
	«IF editorGen.diagram.generateCreateShortcutAction()-»
		if (item.getView().getEAnnotation("Shortcut") != null) { «EXPAND xpt::Common::nonNLS»
			return SHORTCUTS_CATEGORY;
		}
	«ENDIF-»
		return «EXPAND xpt::editor::VisualIDRegistry::getVisualIDMethodCall FOR editorGen.diagram»(item.getView());
	}
	return GROUP_CATEGORY;
}
«ENDDEFINE»

«DEFINE additions FOR gmfgen::GenNavigator-»
«ENDDEFINE»

Back to the top