/* * Copyright (c) 2006, 2007 Borland Software Corporation. * 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: * Richard Gronback (Borland) - initial API and implementation */ package org.eclipse.gmf.examples.mindmap.diagram.navigator; import org.eclipse.gmf.examples.mindmap.diagram.part.MindmapVisualIDRegistry; import org.eclipse.jface.viewers.ViewerSorter; /** * @generated */ public class MindmapNavigatorSorter extends ViewerSorter { /** * @generated */ private static final int GROUP_CATEGORY = 7004; /** * @generated */ private static final int SHORTCUTS_CATEGORY = 7003; /** * @generated */ public int category(Object element) { if (element instanceof MindmapNavigatorItem) { MindmapNavigatorItem item = (MindmapNavigatorItem) element; if (item.getView().getEAnnotation("Shortcut") != null) { //$NON-NLS-1$ return SHORTCUTS_CATEGORY; } return MindmapVisualIDRegistry.getVisualID(item.getView()); } return GROUP_CATEGORY; } }