Commit 8cbf3a74 authored by Simon Barner's avatar Simon Barner
Browse files

Use org.eclipse.jface.viewers.ViewerComparator instead of ViewerSorter

* org.eclipse.jface.viewers.ViewerSorter is deprecated

Issue-Ref: 3539
Issue-Url: https://af3-developer.fortiss.org/issues/3539

Signed-off-by: Simon Barner's avatarSimon Barner <barner@fortiss.org>
parent 1272f13f
TableContentProviderBase.java 6773e5be4c6f4aa5f7215b7e821b5b3f57fa6991 GREEN
TableContentProviderBase.java 6b9e8f413c7104197bc12c9c6a0e455dcd3f2b07 YELLOW
......@@ -19,7 +19,7 @@ import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerSorter;
import org.eclipse.jface.viewers.ViewerComparator;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Table;
......@@ -58,7 +58,13 @@ public abstract class TableContentProviderBase implements IStructuredContentProv
TableViewer viewer = new TableViewer(getTableWidget(parent));
createColumns(viewer);
viewer.setSorter(new TableViewerSorter());
viewer.setComparator(new ViewerComparator() {
/** {@inheritDoc} */
@Override
public int compare(Viewer viewer, Object o1, Object o2) {
return TableContentProviderBase.this.compare(viewer, o1, o2);
}
});
viewer.setContentProvider(this);
viewer.setInput(getContentObject());
......@@ -76,13 +82,4 @@ public abstract class TableContentProviderBase implements IStructuredContentProv
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
// default implementation ignores the input changed event
}
/** ViewerSorter using {@link TableContentProviderBase#compare}. */
private class TableViewerSorter extends ViewerSorter {
/** {@inheritDoc} */
@Override
public int compare(Viewer viewer, Object o1, Object o2) {
return TableContentProviderBase.this.compare(viewer, o1, o2);
}
}
}
ConstraintUIBases.java 3676a600e0866091db9798763c6eee97eec5b55b GREEN
ContextMenuSubMenuContributorBase.java 6275d96fe8690d9d4744bcbaef3c7d14ba8e30ff GREEN
EObjectActionBase.java 4ef9f8be59e64d4838acc9e268d418ba5d94fa1a GREEN
EReferencePropertySectionBase.java 0ce42d0452eef2b3419b7d197178be93be2643af GREEN
EReferencePropertySectionBase.java 3347e99b2fc135dd4b3117407179900ef757092c YELLOW
EditorBase.java 9c09fff92945256bb8680992ae7bb2c78f47b150 GREEN
ModelEditorBindingBase.java 4c5ac569c0b6e7678fc8191096b26dfd09fdcb98 GREEN
ModelElementHandlerBase.java 384727748f125c9d43f19d9c0eba4ba1be5a7a26 GREEN
......
......@@ -30,7 +30,7 @@ import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.ViewerSorter;
import org.eclipse.jface.viewers.ViewerComparator;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
import org.fortiss.tooling.kernel.extension.data.ITopLevelElement;
......@@ -92,7 +92,7 @@ public abstract class EReferencePropertySectionBase<I extends EObject, R extends
modelReferenceCombo = createDecoratedComboViewer(modelReferenceComboLabel);
modelReferenceCombo.setContentProvider(new ArrayContentProvider());
modelReferenceCombo.setLabelProvider(new ReferenceLabelProvider());
modelReferenceCombo.setSorter(new ViewerSorter());
modelReferenceCombo.setComparator(new ViewerComparator());
modelReferenceCombo.addSelectionChangedListener(new ISelectionChangedListener() {
@SuppressWarnings("unchecked")
@Override
......
KISSViewPart.java 33833f8c463c0f4df9a9560b69e02d53b52be62e GREEN
KISSViewPart.java 0de931d1947b2fc8c95cb5b5c9ed9d9d3bc82c6e YELLOW
KISSViewerContentProvider.java b9740ee3471a70726f3f7e4dd500668301af3f61 GREEN
KISSViewerLabelProvider.java 639495bdc8ce8c13edd464869ff625f745ed9809 GREEN
......@@ -19,7 +19,7 @@ import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.ViewerSorter;
import org.eclipse.jface.viewers.ViewerComparator;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.layout.FillLayout;
......@@ -54,7 +54,7 @@ public class KISSViewPart extends ViewPart implements ISelectionChangedListener
TreeViewer tv = gui.getTreeViewer();
tv.setContentProvider(new KISSViewerContentProvider());
tv.setLabelProvider(new KISSViewerLabelProvider());
tv.setSorter(new ViewerSorter());
tv.setComparator(new ViewerComparator());
tv.addSelectionChangedListener(this);
gui.getDescriptionText().setText(GREETING);
......
......@@ -3,14 +3,14 @@ ConnectionCompositorServiceIntrospectionDetailsUIHandler.java bf4744afe94f1b97c2
ConstraintCheckerServiceIntrospectionDetailsUIHandler.java 33758640bc77148162b88143dd1ed758a12bcf30 GREEN
ConstraintServiceIntrospectionDetailsUIHandler.java 8695a09d5a6047d1a478c1d48a49f1e3072caadd GREEN
ConstraintUIServiceIntrospectionDetailsUIHandler.java bc5fff880e84fac2fa8e1bc43b67cfb2ce907f97 GREEN
ContextMenuServiceIntrospectionDetailsUIHandler.java 37a6fd96a248f42bead8e551c9dc4125858c35f1 GREEN
ContextMenuServiceIntrospectionDetailsUIHandler.java 33f39e000e14a9c2661ca280e82139593852be7c YELLOW
CopyClassNameToClipBoardRunnable.java 884555c7026c466d3401b272fc64b9f693074950 GREEN
EObjectAware2IntrospectionDetailsUIHandlerBase.java 18aefde758dc370f564a535d71bab9afc8bdf91f GREEN
EObjectAwareIntrospectionDetailsUIHandlerBase.java dc14e1cdcb550aaada7d35396de60cb6515d04ce GREEN
EclipseResourceStorageProviderIntrospectionDetailsUIHandler.java 987f882a82cfa20af08e85629e2767c0ebab042f GREEN
EditPartFactoryServiceIntrospectionDetailsUIHandler.java e14b000ffface065dd58f7a9799cceb74acd095e GREEN
ElementCompositorServiceIntrospectionDetailsUIHandler.java 3e5d8e4c268a4498c0b17d2ab83bf17665b37cd0 GREEN
IntrospectionDetailsUIHandlerBase.java 24e251412ad7e941f4caf6f72f2c108f44d952ca GREEN
IntrospectionDetailsUIHandlerBase.java fae98d41eaf47401b27e80da542e187d952fb287 YELLOW
LibraryServiceIntrospectionDetailsUIHandler.java a17e31bfdb1215b9d50279a37165fac6db0733ea GREEN
MigrationServiceIntrospectionDetailsUIHandler.java 66c7b9094dbf373e56c5a5558bb35073e70d4ec3 GREEN
ModelEditorBindingServiceIntrospectionDetailsUIHandler.java e8c55cd97cba5b4286c9681649970e348e248bf2 GREEN
......
......@@ -20,7 +20,7 @@ import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.TableLabelProviderBase;
import org.eclipse.jface.viewers.ViewerSorter;
import org.eclipse.jface.viewers.ViewerComparator;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.widgets.Control;
......@@ -123,8 +123,8 @@ public final class ContextMenuServiceIntrospectionDetailsUIHandler
/** {@inheritDoc} */
@Override
protected ViewerSorter createSorter() {
return new ViewerSorter() {
protected ViewerComparator createComparator() {
return new ViewerComparator() {
/** {@inheritDoc} */
@Override
public int category(Object element) {
......
......@@ -23,7 +23,7 @@ import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.ViewerSorter;
import org.eclipse.jface.viewers.ViewerComparator;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CTabFolder;
import org.eclipse.swt.custom.CTabItem;
......@@ -72,7 +72,7 @@ public abstract class IntrospectionDetailsUIHandlerBase extends DetailsUIHandler
treeViewer.setContentProvider(createContentProvider());
treeViewer.setLabelProvider(createLabelProvider());
treeViewer.setSorter(createSorter());
treeViewer.setComparator(createComparator());
treeViewer.setInput(getInputObject());
addContextMenu(treeViewer);
......@@ -178,9 +178,10 @@ public abstract class IntrospectionDetailsUIHandlerBase extends DetailsUIHandler
protected abstract Object getInputObject();
/**
* Creates the sorter for the filtered tree. The default is {@link ViewerSorter#ViewerSorter()}.
* Creates the comparator for the filtered tree. The default is
* {@link ViewerComparator#ViewerComparator()}.
*/
protected ViewerSorter createSorter() {
return new ViewerSorter();
protected ViewerComparator createComparator() {
return new ViewerComparator();
}
}
......@@ -7,6 +7,6 @@ LinkWithEditorPartListener.java c5ab74424378e7b158a805c4dd14fc03c8abeded GREEN
MarkerViewContentProvider.java 4cb1192baebe21bca951c439c163d0c171512515 GREEN
MarkerViewPart.java cbb650271b6877af205421b7cb11f930440a7ef9 GREEN
NavigatorNewMenu.java a35e391960d1dacbe7f77982e53e1891e9382d5a GREEN
NavigatorTreeContentComparator.java d9f1354cfdff78b104b28887d2397e5ca0e9755b YELLOW
NavigatorTreeContentProvider.java 1fbe97bebf3805cc1af190cecd784fc1cfd12306 GREEN
NavigatorTreeContentSorter.java 76fc94e441ac1a8f2c5ae573f0e2b1e6fa73c31a GREEN
NavigatorViewPart.java e43a915961bd440b01dfd7d5ce89aa1b994bb8dd GREEN
NavigatorViewPart.java 7426503b59605885d8baad9633df69b83d6e38c0 YELLOW
......@@ -17,17 +17,17 @@ package org.fortiss.tooling.kernel.ui.internal.views;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerSorter;
import org.eclipse.jface.viewers.ViewerComparator;
import org.fortiss.tooling.kernel.extension.data.TutorialCompositeStep;
import org.fortiss.tooling.kernel.ui.extension.IModelElementHandler;
import org.fortiss.tooling.kernel.ui.service.IModelElementHandlerService;
/**
* {@link ViewerSorter} for the {@link NavigatorViewPart}.
* {@link ViewerComparator} for the {@link NavigatorViewPart}.
*
* @author hoelzl
*/
public class NavigatorTreeContentSorter extends ViewerSorter {
public class NavigatorTreeContentComparator extends ViewerComparator {
/** {@inheritDoc} */
@Override
......
......@@ -170,7 +170,7 @@ public final class NavigatorViewPart extends ViewPart implements ISelectionListe
new DecoratingLabelProvider(new TutorialDefinitionModelElementLabelProvider(),
decoratorManager.getLabelDecorator()));
viewer.setContentProvider(new NavigatorTreeContentProvider());
viewer.setSorter(new NavigatorTreeContentSorter());
viewer.setComparator(new NavigatorTreeContentComparator());
getSite().setSelectionProvider(viewer);
createContextMenu();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment