blob: e80133bcbfba1dc6a274725f5cde5a0174db8bbc (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
/*******************************************************************************
* Copyright (c) 2012 Wind River Systems, Inc. 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:
* Wind River Systems - initial API and implementation
*******************************************************************************/
package org.eclipse.tcf.te.launch.ui.internal.viewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerSorter;
import org.eclipse.tcf.te.launch.ui.model.LaunchNode;
/**
* The common sorter for the launch contribution to the target explorer.
*/
public class LaunchTreeViewerSorter extends ViewerSorter {
/*
* (non-Javadoc)
* @see org.eclipse.jface.viewers.ViewerComparator#compare(org.eclipse.jface.viewers.Viewer,
* java.lang.Object, java.lang.Object)
*/
@Override
public int compare(Viewer viewer, Object e1, Object e2) {
if (e1 instanceof LaunchNode && e2 instanceof LaunchNode) {
return ((LaunchNode)e1).getName().compareTo(((LaunchNode)e2).getName());
}
return super.compare(viewer, e1, e2);
}
}
|