/*
* Copyright Text ->
*
* Copyright (c) 2012-2016 Marsha Chechik, Alessio Di Sandro, Michalis Famelis,
* Rick Salay.
* 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:
* Alessio Di Sandro - Implementation.
*/
package edu.toronto.cs.se.modelepedia.statemachine.diagram.navigator;
import org.eclipse.jface.viewers.ViewerSorter;
import edu.toronto.cs.se.modelepedia.statemachine.diagram.part.StateMachineVisualIDRegistry;
/**
* @generated
*/
public class StateMachineNavigatorSorter extends ViewerSorter {
/**
* @generated
*/
private static final int GROUP_CATEGORY = 7003;
/**
* @generated
*/
private static final int SHORTCUTS_CATEGORY = 7002;
/**
* @generated
*/
public int category(Object element) {
if (element instanceof StateMachineNavigatorItem) {
StateMachineNavigatorItem item = (StateMachineNavigatorItem) element;
if (item.getView().getEAnnotation("Shortcut") != null) { //$NON-NLS-1$
return SHORTCUTS_CATEGORY;
}
return StateMachineVisualIDRegistry.getVisualID(item.getView());
}
return GROUP_CATEGORY;
}
}