Remove old license headers
[lgpl/argeo-commons.git] / org.argeo.eclipse.ui / src / org / argeo / eclipse / ui / ColumnViewerComparator.java
index 8db5d4fe815101f1605d39dd923c404f8158add8..9430a20833dbe0e2c5bb9198841d6b1d5a940ca1 100644 (file)
@@ -1,22 +1,5 @@
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *         http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
 package org.argeo.eclipse.ui;
 
-import java.util.Comparator;
-
 import org.eclipse.jface.viewers.ColumnViewer;
 import org.eclipse.jface.viewers.TableViewerColumn;
 import org.eclipse.jface.viewers.Viewer;
@@ -26,7 +9,7 @@ import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
 
 /** Generic column viewer sorter */
-public class ColumnViewerComparator<T> extends ViewerComparator {
+public class ColumnViewerComparator extends ViewerComparator {
        private static final long serialVersionUID = -2266218906355859909L;
 
        public static final int ASC = 1;
@@ -41,9 +24,8 @@ public class ColumnViewerComparator<T> extends ViewerComparator {
 
        private ColumnViewer viewer;
 
-       public ColumnViewerComparator(TableViewerColumn column,
-                       Comparator<T> comparator) {
-               super(comparator);
+       public ColumnViewerComparator(TableViewerColumn column) {
+               super(null);
                this.column = column;
                this.viewer = column.getViewer();
                this.column.getColumn().addSelectionListener(new SelectionAdapter() {
@@ -93,8 +75,7 @@ public class ColumnViewerComparator<T> extends ViewerComparator {
                }
        }
 
-       @SuppressWarnings("unchecked")
        public int compare(Viewer viewer, Object e1, Object e2) {
-               return direction * getComparator().compare((T) e1, (T) e2);
+               return direction * super.compare(viewer, e1, e2);
        }
 }