Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2019-10-10 15:20:44 -0400
committerAlexander Kurtakov2019-10-10 15:20:44 -0400
commit8ba5a7191f2522a599c2b74044054451263fbd0d (patch)
tree6e56597bb2c7027b1b01c6fb1ed55f44786122ff
parentb7e1fb466de2b4d9a7de24ba4617eb40663cde76 (diff)
downloadorg.eclipse.cdt-8ba5a7191f2522a599c2b74044054451263fbd0d.tar.gz
org.eclipse.cdt-8ba5a7191f2522a599c2b74044054451263fbd0d.tar.xz
org.eclipse.cdt-8ba5a7191f2522a599c2b74044054451263fbd0d.zip
Migrate to ViewerComparator.
Change-Id: I5b70806ca7376797e387164158a0c41d52b59cb5 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r--build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/LexicalSortingAction.java6
-rw-r--r--build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/DiscoveredPathContainerPage.java49
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CView.java2
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathContainerSelectionPage.java15
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CFileTypesPreferenceBlock.java6
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/SourceFolderSelectionDialog.java4
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/SourceFileSelectionDialog.java11
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/TreeListDialogField.java14
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/CElementWorkingSetPage.java2
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/ListDialogField.java20
10 files changed, 25 insertions, 104 deletions
diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/LexicalSortingAction.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/LexicalSortingAction.java
index 7d1f0c7ec7..979c105a0e 100644
--- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/LexicalSortingAction.java
+++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/editor/LexicalSortingAction.java
@@ -22,7 +22,7 @@ import org.eclipse.cdt.make.internal.ui.MakeUIImages;
import org.eclipse.cdt.make.internal.ui.MakeUIPlugin;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.jface.viewers.ViewerComparator;
public class LexicalSortingAction extends Action {
private static final String ACTION_NAME = "LexicalSortingAction"; //$NON-NLS-1$
@@ -52,7 +52,7 @@ public class LexicalSortingAction extends Action {
private void valueChanged(boolean on, boolean store) {
setChecked(on);
- fTreeViewer.setSorter(on ? fSorter : null);
+ fTreeViewer.setComparator(on ? fSorter : null);
String key = ACTION_NAME + ".tooltip" + (on ? ".on" : ".off"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
setToolTipText(MakeUIPlugin.getResourceString(key));
@@ -61,7 +61,7 @@ public class LexicalSortingAction extends Action {
}
}
- private class LexicalMakefileSorter extends ViewerSorter {
+ private class LexicalMakefileSorter extends ViewerComparator {
@Override
public int category(Object obj) {
if (obj instanceof IDirective) {
diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/DiscoveredPathContainerPage.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/DiscoveredPathContainerPage.java
index 08acbbe32e..d46cf14055 100644
--- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/DiscoveredPathContainerPage.java
+++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/dialogs/DiscoveredPathContainerPage.java
@@ -152,23 +152,17 @@ public class DiscoveredPathContainerPage extends WizardPage implements IPathEntr
fDiscoveredContainerList.setLabelText(MakeUIPlugin.getResourceString(CONTAINER_LIST_LABEL));
fDiscoveredContainerList.setTreeExpansionLevel(2);
- fDiscoveredContainerList.setViewerSorter(new DiscoveredElementSorter());
+ fDiscoveredContainerList.setViewerComparator(new DiscoveredElementSorter());
dirty = false;
deletedEntries = new ArrayList<>();
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.IDialogPage#dispose()
- */
@Override
public void dispose() {
deregisterActionHandlers();
super.dispose();
}
- /* (non-Javadoc)
- * @see org.eclipse.cdt.ui.wizards.ICPathContainerPage#initialize(org.eclipse.cdt.core.model.ICProject, org.eclipse.cdt.core.model.IPathEntry[])
- */
@Override
public void initialize(ICProject project, IPathEntry[] currentEntries) {
fCProject = project;
@@ -179,9 +173,6 @@ public class DiscoveredPathContainerPage extends WizardPage implements IPathEntr
}
}
- /* (non-Javadoc)
- * @see org.eclipse.cdt.ui.wizards.ICPathContainerPage#finish()
- */
@Override
public boolean finish() {
if (!dirty) {
@@ -274,17 +265,11 @@ public class DiscoveredPathContainerPage extends WizardPage implements IPathEntr
return false;
}
- /* (non-Javadoc)
- * @see org.eclipse.cdt.ui.wizards.ICPathContainerPage#getContainerEntries()
- */
@Override
public IContainerEntry[] getNewContainers() {
return new IContainerEntry[] { fPathEntry };
}
- /* (non-Javadoc)
- * @see org.eclipse.cdt.ui.wizards.ICPathContainerPage#setSelection(org.eclipse.cdt.core.model.IPathEntry)
- */
@Override
public void setSelection(IContainerEntry containerEntry) {
if (containerEntry != null) {
@@ -377,9 +362,6 @@ public class DiscoveredPathContainerPage extends WizardPage implements IPathEntr
return container;
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
- */
@Override
public void createControl(Composite parent) {
PixelConverter converter = new PixelConverter(parent);
@@ -463,28 +445,17 @@ public class DiscoveredPathContainerPage extends WizardPage implements IPathEntr
private class DiscoveredContainerAdapter implements IDialogFieldListener, ITreeListAdapter<DiscoveredElement> {
private final Object[] EMPTY_ARR = new Object[0];
- // ---------- IDialogFieldListener --------
- /* (non-Javadoc)
- * @see org.eclipse.cdt.internal.ui.wizards.dialogfields.IDialogFieldListener#dialogFieldChanged(org.eclipse.cdt.internal.ui.wizards.dialogfields.DialogField)
- */
@Override
public void dialogFieldChanged(DialogField field) {
// TODO Auto-generated method stub
}
- // -------- IListAdapter --------
- /* (non-Javadoc)
- * @see org.eclipse.cdt.internal.ui.wizards.dialogfields.ITreeListAdapter#customButtonPressed(org.eclipse.cdt.internal.ui.wizards.dialogfields.TreeListDialogField, int)
- */
@Override
public void customButtonPressed(TreeListDialogField<DiscoveredElement> field, int index) {
containerPageCustomButtonPressed(field, index);
}
- /* (non-Javadoc)
- * @see org.eclipse.cdt.internal.ui.wizards.dialogfields.ITreeListAdapter#selectionChanged(org.eclipse.cdt.internal.ui.wizards.dialogfields.TreeListDialogField)
- */
@Override
public void selectionChanged(TreeListDialogField<DiscoveredElement> field) {
if (copyTextAction != null) {
@@ -493,27 +464,18 @@ public class DiscoveredPathContainerPage extends WizardPage implements IPathEntr
containerPageSelectionChanged(field);
}
- /* (non-Javadoc)
- * @see org.eclipse.cdt.internal.ui.wizards.dialogfields.ITreeListAdapter#doubleClicked(org.eclipse.cdt.internal.ui.wizards.dialogfields.TreeListDialogField)
- */
@Override
public void doubleClicked(TreeListDialogField<DiscoveredElement> field) {
// TODO Auto-generated method stub
}
- /* (non-Javadoc)
- * @see org.eclipse.cdt.internal.ui.wizards.dialogfields.ITreeListAdapter#keyPressed(org.eclipse.cdt.internal.ui.wizards.dialogfields.TreeListDialogField, org.eclipse.swt.events.KeyEvent)
- */
@Override
public void keyPressed(TreeListDialogField<DiscoveredElement> field, KeyEvent event) {
// TODO Auto-generated method stub
}
- /* (non-Javadoc)
- * @see org.eclipse.cdt.internal.ui.wizards.dialogfields.ITreeListAdapter#getChildren(org.eclipse.cdt.internal.ui.wizards.dialogfields.TreeListDialogField, java.lang.Object)
- */
@Override
public Object[] getChildren(TreeListDialogField<DiscoveredElement> field, Object element) {
if (element instanceof DiscoveredElement) {
@@ -523,9 +485,6 @@ public class DiscoveredPathContainerPage extends WizardPage implements IPathEntr
return EMPTY_ARR;
}
- /* (non-Javadoc)
- * @see org.eclipse.cdt.internal.ui.wizards.dialogfields.ITreeListAdapter#getParent(org.eclipse.cdt.internal.ui.wizards.dialogfields.TreeListDialogField, java.lang.Object)
- */
@Override
public Object getParent(TreeListDialogField<DiscoveredElement> field, Object element) {
if (element instanceof DiscoveredElement) {
@@ -535,9 +494,6 @@ public class DiscoveredPathContainerPage extends WizardPage implements IPathEntr
return null;
}
- /* (non-Javadoc)
- * @see org.eclipse.cdt.internal.ui.wizards.dialogfields.ITreeListAdapter#hasChildren(org.eclipse.cdt.internal.ui.wizards.dialogfields.TreeListDialogField, java.lang.Object)
- */
@Override
public boolean hasChildren(TreeListDialogField<DiscoveredElement> field, Object element) {
if (element instanceof DiscoveredElement) {
@@ -842,9 +798,6 @@ public class DiscoveredPathContainerPage extends WizardPage implements IPathEntr
return rc;
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IAction#run()
- */
@Override
public void run() {
if (discoveredEntry != null) {
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CView.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CView.java
index b409055f27..d4f2e4e312 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CView.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/cview/CView.java
@@ -341,7 +341,7 @@ public class CView extends ViewPart
* Initializes the sorter.
*/
void initCElementSorter() {
- viewer.setSorter(new CElementSorter());
+ viewer.setComparator(new CElementSorter());
}
/**
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathContainerSelectionPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathContainerSelectionPage.java
index 84ec67dde8..575ccfc843 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathContainerSelectionPage.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/dialogs/cpaths/CPathContainerSelectionPage.java
@@ -28,7 +28,7 @@ import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.LabelProvider;
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.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
@@ -51,7 +51,7 @@ public class CPathContainerSelectionPage extends WizardPage {
}
}
- private static class CPathContainerSorter extends ViewerSorter {
+ private static class CPathContainerSorter extends ViewerComparator {
@Override
public int category(Object element) {
@@ -87,15 +87,12 @@ public class CPathContainerSelectionPage extends WizardPage {
validatePage();
}
- /* (non-Javadoc)
- * @see IDialogPage#createControl(Composite)
- */
@Override
public void createControl(Composite parent) {
fListViewer = new TableViewer(parent, SWT.SINGLE | SWT.BORDER);
fListViewer.setLabelProvider(new CPathContainerLabelProvider());
fListViewer.setContentProvider(new ListContentProvider());
- fListViewer.setSorter(new CPathContainerSorter());
+ fListViewer.setComparator(new CPathContainerSorter());
fListViewer.setInput(Arrays.asList(fContainers));
fListViewer.addSelectionChangedListener(new ISelectionChangedListener() {
@Override
@@ -145,17 +142,11 @@ public class CPathContainerSelectionPage extends WizardPage {
}
}
- /* (non-Javadoc)
- * @see IWizardPage#canFlipToNextPage()
- */
@Override
public boolean canFlipToNextPage() {
return isPageComplete(); // avoid the getNextPage call to prevent potential plugin load
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.IDialogPage#setVisible(boolean)
- */
@Override
public void setVisible(boolean visible) {
if (!visible && fListViewer != null) {
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CFileTypesPreferenceBlock.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CFileTypesPreferenceBlock.java
index be91aa9f2e..ae745603e4 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CFileTypesPreferenceBlock.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/preferences/CFileTypesPreferenceBlock.java
@@ -42,7 +42,7 @@ import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.TableLayout;
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.jface.window.Window;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
@@ -73,7 +73,7 @@ public class CFileTypesPreferenceBlock {
private Button fBtnNew;
private Button fBtnRemove;
- private class AssocSorter extends ViewerSorter {
+ private class AssocComparator extends ViewerComparator {
@Override
public int category(Object element) {
if (element instanceof CFileTypeAssociation) {
@@ -275,7 +275,7 @@ public class CFileTypesPreferenceBlock {
fAssocViewer = new TableViewer(table);
- fAssocViewer.setSorter(new AssocSorter());
+ fAssocViewer.setComparator(new AssocComparator());
fAssocViewer.setContentProvider(new AssocContentProvider());
fAssocViewer.setLabelProvider(new AssocLabelProvider());
fAssocViewer.setInput(getCFileTypeAssociations());
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/SourceFolderSelectionDialog.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/SourceFolderSelectionDialog.java
index 72aeccebeb..182c50508c 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/SourceFolderSelectionDialog.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/SourceFolderSelectionDialog.java
@@ -24,8 +24,8 @@ import org.eclipse.cdt.ui.CElementLabelProvider;
import org.eclipse.cdt.ui.CElementSorter;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.ViewerComparator;
import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.viewers.ViewerSorter;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
@@ -39,7 +39,7 @@ public class SourceFolderSelectionDialog extends ElementTreeSelectionDialog {
ICProject.class };
private static final ViewerFilter fFilter = new TypedViewerFilter(FILTER_CLASSES);
- private static final ViewerSorter fSorter = new CElementSorter();
+ private static final ViewerComparator fSorter = new CElementSorter();
public SourceFolderSelectionDialog(Shell parent) {
super(parent, createLabelProvider(), createContentProvider());
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/SourceFileSelectionDialog.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/SourceFileSelectionDialog.java
index daa5558157..6e372af24d 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/SourceFileSelectionDialog.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/SourceFileSelectionDialog.java
@@ -355,9 +355,6 @@ public class SourceFileSelectionDialog extends SelectionStatusDialog {
super.cancelPressed();
}
- /*
- * @see SelectionStatusDialog#computeResult()
- */
@Override
protected void computeResult() {
setResult(((IStructuredSelection) fViewer.getSelection()).toList());
@@ -378,9 +375,6 @@ public class SourceFileSelectionDialog extends SelectionStatusDialog {
super.create();
}
- /*
- * @see Dialog#createDialogArea(Composite)
- */
@Override
protected Control createDialogArea(Composite parent) {
Composite composite = (Composite) super.createDialogArea(parent);
@@ -434,7 +428,7 @@ public class SourceFileSelectionDialog extends SelectionStatusDialog {
fViewer.setLabelProvider(fLabelProvider);
fViewer.addSelectionChangedListener(fFieldsAdapter);
- fViewer.setSorter(new CElementSorter());
+ fViewer.setComparator(new CElementSorter());
fViewer.addFilter(new Filter());
Tree tree = fViewer.getTree();
@@ -455,9 +449,6 @@ public class SourceFileSelectionDialog extends SelectionStatusDialog {
return fViewer;
}
- /**
- * @see org.eclipse.jface.window.Window#handleShellCloseEvent()
- */
@Override
protected void handleShellCloseEvent() {
super.handleShellCloseEvent();
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/TreeListDialogField.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/TreeListDialogField.java
index ae61ad390d..16ef5fe3e0 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/TreeListDialogField.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/dialogfields/TreeListDialogField.java
@@ -33,7 +33,6 @@ import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerComparator;
-import org.eclipse.jface.viewers.ViewerSorter;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.KeyAdapter;
import org.eclipse.swt.events.KeyEvent;
@@ -146,19 +145,6 @@ public class TreeListDialogField<T> extends DialogField {
}
/**
- * Sets the viewerSorter.
- *
- * @param viewerSorter
- * The viewerSorter to set
- *
- * @deprecated Use {@link #setViewerComparator(ViewerComparator)} instead.
- */
- @Deprecated
- public void setViewerSorter(ViewerSorter viewerSorter) {
- setViewerComparator(viewerSorter);
- }
-
- /**
* Sets the viewerComparator.
*
* @param viewerComparator
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/CElementWorkingSetPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/CElementWorkingSetPage.java
index 90b15362e9..0d3d2f7dec 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/CElementWorkingSetPage.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/workingsets/CElementWorkingSetPage.java
@@ -130,7 +130,7 @@ public class CElementWorkingSetPage extends WizardPage implements IWorkingSetPag
AppearanceAwareLabelProvider.DEFAULT_IMAGEFLAGS | CElementImageProvider.SMALL_ICONS);
fTree.setLabelProvider(new DecoratingCLabelProvider(cElementLabelProvider));
- fTree.setSorter(new CElementSorter());
+ fTree.setComparator(new CElementSorter());
fTree.setUseHashlookup(true);
fTree.setInput(CoreModel.create(CUIPlugin.getWorkspace().getRoot()));
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/ListDialogField.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/ListDialogField.java
index 7c82b89a51..af950d427c 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/ListDialogField.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/dialogfields/ListDialogField.java
@@ -29,7 +29,7 @@ import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
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.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
@@ -54,7 +54,7 @@ public class ListDialogField extends DialogField {
protected ILabelProvider fLabelProvider;
protected ListViewerAdapter fListViewerAdapter;
protected List fElements;
- protected ViewerSorter fViewerSorter;
+ protected ViewerComparator fViewerComparator;
protected String[] fButtonLabels;
private Button[] fButtonControls;
@@ -141,11 +141,11 @@ public class ListDialogField extends DialogField {
}
/**
- * Sets the viewerSorter.
- * @param viewerSorter The viewerSorter to set
+ * Sets the viewerComparator.
+ * @param viewerComparator The viewerComparator to set
*/
- public void setViewerSorter(ViewerSorter viewerSorter) {
- fViewerSorter = viewerSorter;
+ public void setViewerComparator(ViewerComparator viewerComparator) {
+ fViewerComparator = viewerComparator;
}
// ------ adapter communication
@@ -250,8 +250,8 @@ public class ListDialogField extends DialogField {
fTable.setInput(fParentElement);
- if (fViewerSorter != null) {
- fTable.setSorter(fViewerSorter);
+ if (fViewerComparator != null) {
+ fTable.setComparator(fViewerComparator);
}
fTableControl.setEnabled(isEnabled());
@@ -598,9 +598,9 @@ public class ListDialogField extends DialogField {
public void selectFirstElement() {
Object element = null;
- if (fViewerSorter != null) {
+ if (fViewerComparator != null) {
Object[] arr = fElements.toArray();
- fViewerSorter.sort(fTable, arr);
+ fViewerComparator.sort(fTable, arr);
if (arr.length > 0) {
element = arr[0];
}

Back to the top