/*
* Copyright (c) 2006, 2008 Borland Software Corp.
*
* 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:
* Alexander Shatalin (Borland) - initial API and implementation
*/
package org.eclipse.gmf.ecore.navigator;
import org.eclipse.gmf.ecore.part.EcoreVisualIDRegistry;
import org.eclipse.jface.viewers.ViewerSorter;
/**
* @generated
*/
public class EcoreNavigatorSorter extends ViewerSorter {
/**
* @generated
*/
private static final int GROUP_CATEGORY = 7014;
/**
* @generated
*/
private static final int SHORTCUTS_CATEGORY = 7013;
/**
* @generated
*/
public int category(Object element) {
if (element instanceof EcoreNavigatorItem) {
EcoreNavigatorItem item = (EcoreNavigatorItem) element;
if (item.getView().getEAnnotation("Shortcut") != null) { //$NON-NLS-1$
return SHORTCUTS_CATEGORY;
}
return EcoreVisualIDRegistry.getVisualID(item.getView());
}
return GROUP_CATEGORY;
}
}