X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=org.argeo.eclipse.ui%2Fsrc%2Forg%2Fargeo%2Feclipse%2Fui%2FColumnViewerComparator.java;h=9430a20833dbe0e2c5bb9198841d6b1d5a940ca1;hb=c53fec78daddb69c489686844188036b04e1615a;hp=8db5d4fe815101f1605d39dd923c404f8158add8;hpb=e61dd9dda88354091625cca85aa7c96d196688b3;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 8db5d4fe8..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,9 +24,8 @@ public class ColumnViewerComparator extends ViewerComparator { private ColumnViewer viewer; - public ColumnViewerComparator(TableViewerColumn column, - Comparator 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 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); } }