X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=org.argeo.eclipse.ui%2Fsrc%2Forg%2Fargeo%2Feclipse%2Fui%2FColumnViewerComparator.java;h=9430a20833dbe0e2c5bb9198841d6b1d5a940ca1;hb=a6c43627c0687dae14095c505be60e709ac8d823;hp=65d688af613edf1dc60fbc847e28af180c0de811;hpb=e7b05d237d09d176a627d26816717fb9f59c6011;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/ColumnViewerComparator.java b/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/ColumnViewerComparator.java index 65d688af6..9430a2083 100644 --- a/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/ColumnViewerComparator.java +++ b/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/ColumnViewerComparator.java @@ -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 extends ViewerComparator { +public class ColumnViewerComparator extends ViewerComparator { private static final long serialVersionUID = -2266218906355859909L; public static final int ASC = 1; @@ -41,8 +24,8 @@ public class ColumnViewerComparator extends ViewerComparator { private ColumnViewer viewer; - public ColumnViewerComparator(TableViewerColumn column, Comparator comparator) { - super((Comparator) comparator); + public ColumnViewerComparator(TableViewerColumn column) { + super(null); this.column = column; this.viewer = column.getViewer(); this.column.getColumn().addSelectionListener(new SelectionAdapter() { @@ -92,9 +75,7 @@ public class ColumnViewerComparator 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); } }