Replace usage of ViewerSorter with ViewerComparator
[deliverable/tracecompass.git] / tmf / org.eclipse.tracecompass.tmf.ui / src / org / eclipse / tracecompass / tmf / ui / project / model / TmfViewerSorter.java
1 /*******************************************************************************
2 * Copyright (c) 2014 Ericsson
3 *
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *
9 * Contributors:
10 * Patrick Tasse - Initial API and implementation
11 *******************************************************************************/
12
13 package org.eclipse.tracecompass.tmf.ui.project.model;
14
15 import org.eclipse.jface.viewers.ViewerComparator;
16
17 /**
18 * Viewer sorter for TMF project model elements
19 */
20 public class TmfViewerSorter extends ViewerComparator {
21
22 @Override
23 public int category(Object element) {
24 if (element instanceof TmfExperimentFolder) {
25 return 0;
26 }
27 if (element instanceof TmfTraceFolder) {
28 return 0;
29 }
30 if (element instanceof TmfExperimentElement) {
31 return 1;
32 }
33 if (element instanceof TmfTraceElement) {
34 return 1;
35 }
36 return 2;
37 }
38
39
40 }
This page took 0.033652 seconds and 5 git commands to generate.