blob: 63d5c3bbe9c711ffc657a82c754eab1e530e3455 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2016 Fundación Tecnalia Research & Innovation.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Huascar Espinoza - initial API and implementation
* Alejandra Ruíz - initial API and implementation
* Idoya Del Río - initial API and implementation
* Mari Carmen Palacios - initial API and implementation
* Angel López - initial API and implementation
*******************************************************************************/
/*
*
*/
package org.eclipse.opencert.pkm.refframework.refframework.diagram.navigator;
import org.eclipse.jface.viewers.ViewerSorter;
import org.eclipse.opencert.pkm.refframework.refframework.diagram.part.RefframeworkVisualIDRegistry;
/**
* @generated
*/
public class RefframeworkNavigatorSorter 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 RefframeworkNavigatorItem) {
RefframeworkNavigatorItem item = (RefframeworkNavigatorItem) element;
if (item.getView().getEAnnotation("Shortcut") != null) { //$NON-NLS-1$
return SHORTCUTS_CATEGORY;
}
return RefframeworkVisualIDRegistry.getVisualID(item.getView());
}
return GROUP_CATEGORY;
}
}