Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Keppler2018-04-06 03:43:54 -0400
committerThomas Wolf2018-05-30 11:44:01 -0400
commit264e843efa0c71de4a9f5391af993247b6fde0d6 (patch)
tree9201fa377eba5110209ab8259f068f119fbc057c
parentef2e7929e8b39d32e030bd44ab1031d90839580d (diff)
downloadegit-github-264e843efa0c71de4a9f5391af993247b6fde0d6.tar.gz
egit-github-264e843efa0c71de4a9f5391af993247b6fde0d6.tar.xz
egit-github-264e843efa0c71de4a9f5391af993247b6fde0d6.zip
Replace deprecated ViewerSorters
Replace ViewerSorters by signature compatible ViewerComparators. The setComparator() interface exists since 3.2, so there should not be a problem with compatibility. The remaining ViewerSorter depends on a super class in mylyn.commons.ui, which has no ViewerComparator replacement yet. Change-Id: I9a647998a58c6d64d84f61e5aab41fd2e63423ae Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
-rw-r--r--org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/RepositorySelectionWizardPage.java4
-rw-r--r--org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistConnectorSelectionDialog.java7
2 files changed, 7 insertions, 4 deletions
diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/RepositorySelectionWizardPage.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/RepositorySelectionWizardPage.java
index 699c4cac..26c8d47c 100644
--- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/RepositorySelectionWizardPage.java
+++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/RepositorySelectionWizardPage.java
@@ -40,7 +40,7 @@ import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.jface.viewers.StyledString;
import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.jface.viewers.ViewerComparator;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.mylyn.internal.github.core.GitHub;
import org.eclipse.mylyn.internal.github.core.GitHubException;
@@ -256,7 +256,7 @@ public class RepositorySelectionWizardPage extends WizardPage {
CheckboxTreeViewer viewer = tree.getCheckboxTreeViewer();
viewer.setContentProvider(new WorkbenchContentProvider());
viewer.setLabelProvider(new RepositoryLabelProvider());
- viewer.setSorter(new ViewerSorter() {
+ viewer.setComparator(new ViewerComparator() {
@Override
public int compare(Viewer viewer, Object e1, Object e2) {
diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistConnectorSelectionDialog.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistConnectorSelectionDialog.java
index 9d279c24..9ce51915 100644
--- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistConnectorSelectionDialog.java
+++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistConnectorSelectionDialog.java
@@ -24,7 +24,7 @@ import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.jface.viewers.ViewerComparator;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskRepositoryLabelProvider;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.swt.SWT;
@@ -53,6 +53,7 @@ public class GistConnectorSelectionDialog extends SelectionDialog {
repos = repositories;
}
+ @Override
protected Control createDialogArea(Composite parent) {
Composite c = (Composite) super.createDialogArea(parent);
@@ -66,10 +67,11 @@ public class GistConnectorSelectionDialog extends SelectionDialog {
viewer.setLabelProvider(new DecoratingLabelProvider(
new TaskRepositoryLabelProvider(), PlatformUI.getWorkbench()
.getDecoratorManager().getLabelDecorator()));
- viewer.setSorter(new ViewerSorter());
+ viewer.setComparator(new ViewerComparator());
viewer.setInput(repos);
viewer.addDoubleClickListener(new IDoubleClickListener() {
+ @Override
public void doubleClick(DoubleClickEvent event) {
Object selected = ((IStructuredSelection) event.getSelection())
.getFirstElement();
@@ -79,6 +81,7 @@ public class GistConnectorSelectionDialog extends SelectionDialog {
});
viewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
Object selected = ((IStructuredSelection) event.getSelection())
.getFirstElement();

Back to the top