/*
* Copyright (c) 2006, 2009 Borland Software Corporation and others.
* 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:
* Borland Software Corporation - initial API and implementation
*/
package org.eclipse.gmf.graphdef.editor.navigator;
import org.eclipse.gmf.graphdef.editor.part.GMFGraphVisualIDRegistry;
import org.eclipse.jface.viewers.ViewerSorter;
/**
* @generated
*/
public class GMFGraphNavigatorSorter extends ViewerSorter {
/**
* @generated
*/
private static final int GROUP_CATEGORY = 7011;
/**
* @generated
*/
private static final int SHORTCUTS_CATEGORY = 7010;
/**
* @generated
*/
public int category(Object element) {
if (element instanceof GMFGraphNavigatorItem) {
GMFGraphNavigatorItem item = (GMFGraphNavigatorItem) element;
if (item.getView().getEAnnotation("Shortcut") != null) { //$NON-NLS-1$
return SHORTCUTS_CATEGORY;
}
return GMFGraphVisualIDRegistry.getVisualID(item.getView());
}
return GROUP_CATEGORY;
}
}