1 | /* |
2 | *Copyright 2007, IPD, SDQ, University of Karlsruhe |
3 | */ |
4 | package de.uka.ipd.sdq.pcm.gmf.repository.navigator; |
5 | |
6 | import org.eclipse.jface.viewers.ViewerSorter; |
7 | |
8 | import de.uka.ipd.sdq.pcm.gmf.repository.part.PalladioComponentModelVisualIDRegistry; |
9 | |
10 | /** |
11 | * @generated |
12 | */ |
13 | public class PalladioComponentModelNavigatorSorter extends ViewerSorter { |
14 | |
15 | /** |
16 | * @generated |
17 | */ |
18 | private static final int GROUP_CATEGORY = 7110; |
19 | |
20 | /** |
21 | * @generated |
22 | */ |
23 | private static final int SHORTCUTS_CATEGORY = 7109; |
24 | |
25 | /** |
26 | * @generated |
27 | */ |
28 | public int category(Object element) { |
29 | if (element instanceof PalladioComponentModelNavigatorItem) { |
30 | PalladioComponentModelNavigatorItem item = (PalladioComponentModelNavigatorItem) element; |
31 | if (item.getView().getEAnnotation("Shortcut") != null) { //$NON-NLS-1$ |
32 | return SHORTCUTS_CATEGORY; |
33 | } |
34 | return PalladioComponentModelVisualIDRegistry.getVisualID(item |
35 | .getView()); |
36 | } |
37 | return GROUP_CATEGORY; |
38 | } |
39 | |
40 | } |