Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjmisinco2016-09-23 09:50:51 -0400
committerAngel Avila2016-10-04 21:35:24 -0400
commit9ab53422527f47256c025646b7e86b81f3eb46d1 (patch)
treec584351632d43c73c6618023dc5690c6fb1a94ad
parent332d90a4efeef27f35adec468b6faf9089e231f9 (diff)
downloadorg.eclipse.osee-9ab53422527f47256c025646b7e86b81f3eb46d1.tar.gz
org.eclipse.osee-9ab53422527f47256c025646b7e86b81f3eb46d1.tar.xz
org.eclipse.osee-9ab53422527f47256c025646b7e86b81f3eb46d1.zip
refactor: Switch ViewSorter to ViewComparator
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/agile/AgileFeatureGroupColumn.java4
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/agile/SprintFilteredListDialog.java4
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/WorkPackageFilterTreeDialog.java4
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsConfigurationDialog.java4
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XAtsProgramComboWidget.java4
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/META-INF/MANIFEST.MF1
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/internal/DslGrammarManager.java28
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/AttributeTypeNameComparator.java (renamed from plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/AttributeTypeNameSorter.java)12
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/StringNameComparator.java (renamed from plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/StringNameSorter.java)10
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/FilteredCheckboxAttributeTypeDialog.java4
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/FilteredTreeArtifactDialog.java10
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/FilteredTreeArtifactTypeDialog.java10
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/FilteredTreeAttributeTypeDialog.java14
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/FilteredTreeDialog.java20
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/FilteredTreeRelationTypeDialog.java12
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/ViewApplicabilityFilterTreeDialog.java4
16 files changed, 68 insertions, 77 deletions
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/agile/AgileFeatureGroupColumn.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/agile/AgileFeatureGroupColumn.java
index bca36436584..6eb41bb8b8f 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/agile/AgileFeatureGroupColumn.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/agile/AgileFeatureGroupColumn.java
@@ -51,7 +51,7 @@ import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
import org.eclipse.osee.framework.ui.plugin.util.ArrayTreeContentProvider;
import org.eclipse.osee.framework.ui.plugin.util.StringLabelProvider;
import org.eclipse.osee.framework.ui.skynet.util.LogUtil;
-import org.eclipse.osee.framework.ui.skynet.util.StringNameSorter;
+import org.eclipse.osee.framework.ui.skynet.util.StringNameComparator;
import org.eclipse.osee.framework.ui.skynet.widgets.dialog.FilteredCheckboxTreeDialog;
import org.eclipse.swt.widgets.TreeColumn;
import org.eclipse.swt.widgets.TreeItem;
@@ -133,7 +133,7 @@ public class AgileFeatureGroupColumn extends XViewerAtsColumn implements IAtsXVi
}
FilteredCheckboxTreeDialog dialog = new FilteredCheckboxTreeDialog("Select Feature Group(s)",
- "Select Feature Group(s)", new ArrayTreeContentProvider(), new StringLabelProvider(), new StringNameSorter());
+ "Select Feature Group(s)", new ArrayTreeContentProvider(), new StringLabelProvider(), new StringNameComparator());
dialog.setInput(activeFeatureGroups);
Collection<IAgileFeatureGroup> selectedFeatureGroups = getSelectedFeatureGroups(awas);
if (!selectedFeatureGroups.isEmpty()) {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/agile/SprintFilteredListDialog.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/agile/SprintFilteredListDialog.java
index e23289e134a..291b27e7e5c 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/agile/SprintFilteredListDialog.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/agile/SprintFilteredListDialog.java
@@ -14,7 +14,7 @@ import java.util.Collection;
import org.eclipse.osee.ats.api.agile.IAgileSprint;
import org.eclipse.osee.framework.ui.plugin.util.ArrayTreeContentProvider;
import org.eclipse.osee.framework.ui.plugin.util.StringLabelProvider;
-import org.eclipse.osee.framework.ui.skynet.util.StringNameSorter;
+import org.eclipse.osee.framework.ui.skynet.util.StringNameComparator;
import org.eclipse.osee.framework.ui.skynet.widgets.XCheckBox;
import org.eclipse.osee.framework.ui.skynet.widgets.dialog.FilteredTreeDialog;
import org.eclipse.swt.SWT;
@@ -35,7 +35,7 @@ public class SprintFilteredListDialog extends FilteredTreeDialog {
public SprintFilteredListDialog(String dialogTitle, String dialogMessage, Collection<? extends IAgileSprint> values) {
super(dialogTitle, dialogMessage, new ArrayTreeContentProvider(), new StringLabelProvider(),
- new StringNameSorter());
+ new StringNameComparator());
}
@Override
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/WorkPackageFilterTreeDialog.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/WorkPackageFilterTreeDialog.java
index c93763a54e5..5a8f008bbf0 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/WorkPackageFilterTreeDialog.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/column/WorkPackageFilterTreeDialog.java
@@ -24,7 +24,7 @@ import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.ui.plugin.util.ArrayTreeContentProvider;
import org.eclipse.osee.framework.ui.plugin.util.StringLabelProvider;
-import org.eclipse.osee.framework.ui.skynet.util.StringNameSorter;
+import org.eclipse.osee.framework.ui.skynet.util.StringNameComparator;
import org.eclipse.osee.framework.ui.skynet.widgets.XCheckBox;
import org.eclipse.osee.framework.ui.skynet.widgets.dialog.FilteredTreeDialog;
import org.eclipse.swt.SWT;
@@ -58,7 +58,7 @@ public class WorkPackageFilterTreeDialog extends FilteredTreeDialog {
protected Control createDialogArea(Composite container) {
Control comp = super.createDialogArea(container);
try {
- getTreeViewer().getViewer().setSorter(new StringNameSorter());
+ getTreeViewer().getViewer().setComparator(new StringNameComparator());
getTreeViewer().getViewer().addPostSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent event) {
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsConfigurationDialog.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsConfigurationDialog.java
index 2b17cf9e788..b0f7219ddaa 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsConfigurationDialog.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/config/AtsConfigurationDialog.java
@@ -16,7 +16,7 @@ import org.eclipse.osee.ats.api.config.AtsConfiguration;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
import org.eclipse.osee.framework.ui.plugin.util.StringLabelProvider;
-import org.eclipse.osee.framework.ui.skynet.util.StringNameSorter;
+import org.eclipse.osee.framework.ui.skynet.util.StringNameComparator;
import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
@@ -39,7 +39,7 @@ public class AtsConfigurationDialog extends ListDialog {
@Override
protected Control createDialogArea(Composite container) {
Control c = super.createDialogArea(container);
- getTableViewer().setSorter(new StringNameSorter());
+ getTableViewer().setComparator(new StringNameComparator());
return c;
}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XAtsProgramComboWidget.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XAtsProgramComboWidget.java
index 5099daed5f2..3a71fd21895 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XAtsProgramComboWidget.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/widgets/XAtsProgramComboWidget.java
@@ -18,7 +18,7 @@ import org.eclipse.osee.ats.api.program.IAtsProgram;
import org.eclipse.osee.ats.core.client.config.IAtsProgramManager;
import org.eclipse.osee.ats.core.client.config.ProgramManagers;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
-import org.eclipse.osee.framework.ui.skynet.util.StringNameSorter;
+import org.eclipse.osee.framework.ui.skynet.util.StringNameComparator;
import org.eclipse.osee.framework.ui.skynet.widgets.XComboViewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
@@ -35,7 +35,7 @@ public class XAtsProgramComboWidget extends XComboViewer {
this.atsPrograms = atsPrograms;
setLabelProvider(new AtsProgramLabelProvider());
setContentProvider(new ArrayContentProvider());
- setComparator(new StringNameSorter());
+ setComparator(new StringNameComparator());
}
public XAtsProgramComboWidget(Collection<? extends IAtsProgram> atsPrograms) throws OseeCoreException {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.framework.ui.skynet/META-INF/MANIFEST.MF
index 8b607425c76..12b8bd386fd 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/META-INF/MANIFEST.MF
@@ -41,7 +41,6 @@ Import-Package: com.google.common.base;version="15.0.0",
org.eclipse.emf.ecore.resource,
org.eclipse.emf.ecore.resource.impl,
org.eclipse.equinox.app;version="1.1.0",
- org.eclipse.jdt.annotation,
org.eclipse.jdt.core,
org.eclipse.jdt.core.search,
org.eclipse.jface.action,
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/internal/DslGrammarManager.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/internal/DslGrammarManager.java
index c839c868351..a4d503102a8 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/internal/DslGrammarManager.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/internal/DslGrammarManager.java
@@ -10,13 +10,9 @@
*******************************************************************************/
package org.eclipse.osee.framework.ui.skynet.internal;
-import com.google.common.base.Function;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.Maps;
import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.FutureTask;
-import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.model.type.AttributeType;
import org.eclipse.osee.framework.jdk.core.type.LazyObject;
@@ -26,6 +22,9 @@ import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.plugin.core.util.ExtensionDefinedObjects;
import org.eclipse.osee.framework.skynet.core.attribute.AttributeTypeManager;
import org.eclipse.osee.framework.ui.skynet.DslGrammar;
+import com.google.common.base.Function;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Maps;
/**
* @author Roberto E. Escobar
@@ -84,7 +83,6 @@ public final class DslGrammarManager {
return result;
}
- @Nullable
public static DslGrammar getGrammar(IAttributeType attributeType) throws OseeCoreException {
Conditions.checkNotNull(attributeType, "attributeType");
@@ -145,18 +143,18 @@ public final class DslGrammarManager {
List<DslGrammar> grammars = extensions.getObjects();
ImmutableMap<String, DslGrammar> idToGrammar =
Maps.uniqueIndex(grammars, new Function<DslGrammar, String>() {
- @Override
- public String apply(DslGrammar grammar) {
- return grammar.getGrammarId();
- }
- });
+ @Override
+ public String apply(DslGrammar grammar) {
+ return grammar.getGrammarId();
+ }
+ });
ImmutableMap<String, DslGrammar> extensionToGrammar =
Maps.uniqueIndex(grammars, new Function<DslGrammar, String>() {
- @Override
- public String apply(DslGrammar grammar) {
- return grammar.getExtension();
- }
- });
+ @Override
+ public String apply(DslGrammar grammar) {
+ return grammar.getExtension();
+ }
+ });
return new DslGrammarRegistry(idToGrammar, extensionToGrammar);
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/AttributeTypeNameSorter.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/AttributeTypeNameComparator.java
index 422212ead6e..47cefc56864 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/AttributeTypeNameSorter.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/AttributeTypeNameComparator.java
@@ -11,28 +11,26 @@
package org.eclipse.osee.framework.ui.skynet.util;
import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.jface.viewers.ViewerComparator;
import org.eclipse.osee.framework.core.data.IAttributeType;
/**
* Default sorter for artifacts. Sorts on descriptive name
- *
+ *
* @author Donald G. Dunne
*/
-public class AttributeTypeNameSorter extends ViewerSorter {
+public class AttributeTypeNameComparator extends ViewerComparator {
/**
* Default sorter for attributes. Sorts on descriptive name
*/
- public AttributeTypeNameSorter() {
+ public AttributeTypeNameComparator() {
super();
}
@Override
- @SuppressWarnings("unchecked")
public int compare(Viewer viewer, Object o1, Object o2) {
-
- return getComparator().compare(((IAttributeType) o1).getName(), ((IAttributeType) o2).getName());
+ return ((IAttributeType) o1).getName().compareTo(((IAttributeType) o2).getName());
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/StringNameSorter.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/StringNameComparator.java
index 3d1e967fe97..552ab6687e5 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/StringNameSorter.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/util/StringNameComparator.java
@@ -11,19 +11,17 @@
package org.eclipse.osee.framework.ui.skynet.util;
import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.jface.viewers.ViewerComparator;
-public class StringNameSorter extends ViewerSorter {
+public class StringNameComparator extends ViewerComparator {
- public StringNameSorter() {
+ public StringNameComparator() {
super();
}
@Override
- @SuppressWarnings("unchecked")
public int compare(Viewer viewer, Object o1, Object o2) {
-
- return getComparator().compare(o1.toString(), o2.toString());
+ return o1.toString().compareTo(o2.toString());
}
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/FilteredCheckboxAttributeTypeDialog.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/FilteredCheckboxAttributeTypeDialog.java
index 9ebff90b849..a1dfeda0504 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/FilteredCheckboxAttributeTypeDialog.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/FilteredCheckboxAttributeTypeDialog.java
@@ -23,7 +23,7 @@ import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.attribute.AttributeTypeManager;
import org.eclipse.osee.framework.ui.plugin.util.ArrayTreeContentProvider;
import org.eclipse.osee.framework.ui.skynet.internal.Activator;
-import org.eclipse.osee.framework.ui.skynet.util.AttributeTypeNameSorter;
+import org.eclipse.osee.framework.ui.skynet.util.AttributeTypeNameComparator;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
@@ -48,7 +48,7 @@ public class FilteredCheckboxAttributeTypeDialog extends FilteredCheckboxTreeDia
}
public FilteredCheckboxAttributeTypeDialog(String title, String message, Collection<? extends IAttributeType> selectable, ITreeContentProvider contentProvider, ILabelProvider labelProvider) {
- super(title, message, contentProvider, labelProvider, new AttributeTypeNameSorter());
+ super(title, message, contentProvider, labelProvider, new AttributeTypeNameComparator());
this.selectable = selectable;
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/FilteredTreeArtifactDialog.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/FilteredTreeArtifactDialog.java
index 369c5ce89bf..716c2613237 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/FilteredTreeArtifactDialog.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/FilteredTreeArtifactDialog.java
@@ -13,7 +13,7 @@ package org.eclipse.osee.framework.ui.skynet.widgets.dialog;
import java.util.Collection;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.jface.viewers.ViewerComparator;
import org.eclipse.osee.framework.core.util.Result;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
@@ -40,8 +40,8 @@ public class FilteredTreeArtifactDialog extends FilteredTreeDialog {
this(title, message, selectable, contentProvider, labelProvider, new ArtifactViewerSorter());
}
- public FilteredTreeArtifactDialog(String title, String message, Collection<? extends Artifact> selectable, ITreeContentProvider contentProvider, ILabelProvider labelProvider, ViewerSorter sorter) {
- super(title, message, contentProvider, labelProvider, sorter);
+ public FilteredTreeArtifactDialog(String title, String message, Collection<? extends Artifact> selectable, ITreeContentProvider contentProvider, ILabelProvider labelProvider, ViewerComparator comparator) {
+ super(title, message, contentProvider, labelProvider, comparator);
this.selectable = selectable;
}
@@ -70,8 +70,8 @@ public class FilteredTreeArtifactDialog extends FilteredTreeDialog {
}
@Override
- public void setSorter(ViewerSorter sorter) {
- getTreeViewer().getViewer().setSorter(sorter);
+ public void setComparator(ViewerComparator comparator) {
+ getTreeViewer().getViewer().setComparator(comparator);
}
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/FilteredTreeArtifactTypeDialog.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/FilteredTreeArtifactTypeDialog.java
index 51c479b33e3..57d35a1b737 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/FilteredTreeArtifactTypeDialog.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/FilteredTreeArtifactTypeDialog.java
@@ -13,7 +13,7 @@ package org.eclipse.osee.framework.ui.skynet.widgets.dialog;
import java.util.Collection;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.jface.viewers.ViewerComparator;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.util.Result;
import org.eclipse.osee.framework.logging.OseeLevel;
@@ -45,8 +45,8 @@ public class FilteredTreeArtifactTypeDialog extends FilteredTreeDialog {
this(title, message, selectable, contentProvider, labelProvider, new ArtifactTypeNameSorter());
}
- public FilteredTreeArtifactTypeDialog(String title, String message, Collection<? extends IArtifactType> selectable, ITreeContentProvider contentProvider, ILabelProvider labelProvider, ViewerSorter sorter) {
- super(title, message, contentProvider, labelProvider, sorter);
+ public FilteredTreeArtifactTypeDialog(String title, String message, Collection<? extends IArtifactType> selectable, ITreeContentProvider contentProvider, ILabelProvider labelProvider, ViewerComparator comparator) {
+ super(title, message, contentProvider, labelProvider, comparator);
this.selectable = selectable;
}
@@ -82,8 +82,8 @@ public class FilteredTreeArtifactTypeDialog extends FilteredTreeDialog {
}
@Override
- public void setSorter(ViewerSorter sorter) {
- getTreeViewer().getViewer().setSorter(sorter);
+ public void setComparator(ViewerComparator comparator) {
+ getTreeViewer().getViewer().setComparator(comparator);
}
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/FilteredTreeAttributeTypeDialog.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/FilteredTreeAttributeTypeDialog.java
index cd1b5e4b425..c7497ab07d4 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/FilteredTreeAttributeTypeDialog.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/FilteredTreeAttributeTypeDialog.java
@@ -13,7 +13,7 @@ package org.eclipse.osee.framework.ui.skynet.widgets.dialog;
import java.util.Collection;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.jface.viewers.ViewerComparator;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.util.Result;
import org.eclipse.osee.framework.logging.OseeLevel;
@@ -21,7 +21,7 @@ import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.attribute.AttributeTypeManager;
import org.eclipse.osee.framework.ui.plugin.util.ArrayTreeContentProvider;
import org.eclipse.osee.framework.ui.skynet.internal.Activator;
-import org.eclipse.osee.framework.ui.skynet.util.AttributeTypeNameSorter;
+import org.eclipse.osee.framework.ui.skynet.util.AttributeTypeNameComparator;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
@@ -41,11 +41,11 @@ public class FilteredTreeAttributeTypeDialog extends FilteredTreeDialog {
}
public FilteredTreeAttributeTypeDialog(String title, String message, Collection<? extends IAttributeType> selectable, ITreeContentProvider contentProvider, ILabelProvider labelProvider) {
- this(title, message, selectable, contentProvider, labelProvider, new AttributeTypeNameSorter());
+ this(title, message, selectable, contentProvider, labelProvider, new AttributeTypeNameComparator());
}
- public FilteredTreeAttributeTypeDialog(String title, String message, Collection<? extends IAttributeType> selectable, ITreeContentProvider contentProvider, ILabelProvider labelProvider, ViewerSorter sorter) {
- super(title, message, contentProvider, labelProvider, sorter);
+ public FilteredTreeAttributeTypeDialog(String title, String message, Collection<? extends IAttributeType> selectable, ITreeContentProvider contentProvider, ILabelProvider labelProvider, ViewerComparator comparator) {
+ super(title, message, contentProvider, labelProvider, comparator);
this.selectable = selectable;
}
@@ -81,8 +81,8 @@ public class FilteredTreeAttributeTypeDialog extends FilteredTreeDialog {
}
@Override
- public void setSorter(ViewerSorter sorter) {
- getTreeViewer().getViewer().setSorter(sorter);
+ public void setComparator(ViewerComparator comparator) {
+ getTreeViewer().getViewer().setComparator(comparator);
}
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/FilteredTreeDialog.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/FilteredTreeDialog.java
index 6338fb394de..ab2cf73e4db 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/FilteredTreeDialog.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/FilteredTreeDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2007 Boeing.
+ * Copyright (c) 2004, 2007 Boeing.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,7 +13,6 @@ package org.eclipse.osee.framework.ui.skynet.widgets.dialog;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
-import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.DoubleClickEvent;
@@ -25,7 +24,6 @@ import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.ViewerComparator;
-import org.eclipse.jface.viewers.ViewerSorter;
import org.eclipse.osee.framework.core.util.Result;
import org.eclipse.osee.framework.ui.swt.ALayout;
import org.eclipse.osee.framework.ui.swt.Displays;
@@ -50,7 +48,7 @@ public class FilteredTreeDialog extends MessageDialog {
private final IContentProvider contentProvider;
private final IBaseLabelProvider labelProvider;
private Collection<? extends Object> initialSelections;
- private ViewerComparator viewerSorter;
+ private ViewerComparator viewerComparator;
private boolean multiSelect = true;
private PatternFilter patternFilter;
List<Object> selected = new ArrayList<>();
@@ -59,12 +57,12 @@ public class FilteredTreeDialog extends MessageDialog {
this(dialogTitle, dialogMessage, contentProvider, labelProvider, null);
}
- public FilteredTreeDialog(String dialogTitle, String dialogMessage, IContentProvider contentProvider, IBaseLabelProvider labelProvider, ViewerComparator viewerSorter) {
+ public FilteredTreeDialog(String dialogTitle, String dialogMessage, IContentProvider contentProvider, IBaseLabelProvider labelProvider, ViewerComparator viewerComparator) {
super(Displays.getActiveShell(), dialogTitle, null, dialogMessage, MessageDialog.NONE,
new String[] {"OK", "Cancel"}, 0);
this.contentProvider = contentProvider;
this.labelProvider = labelProvider;
- this.viewerSorter = viewerSorter;
+ this.viewerComparator = viewerComparator;
this.patternFilter = new ToStringContainsPatternFilter();
setShellStyle(getShellStyle() | SWT.RESIZE);
}
@@ -108,7 +106,7 @@ public class FilteredTreeDialog extends MessageDialog {
}
@SuppressWarnings("unchecked")
- public @Nullable <T> T getSelectedFirst() {
+ public <T> T getSelectedFirst() {
if (selected.size() > 0) {
return (T) selected.iterator().next();
}
@@ -136,8 +134,8 @@ public class FilteredTreeDialog extends MessageDialog {
treeViewer.getViewer().setLabelProvider(labelProvider);
treeViewer.getViewer().setAutoExpandLevel(0);
treeViewer.setQuickSelectionMode(true);
- if (viewerSorter != null) {
- treeViewer.getViewer().setComparator(viewerSorter);
+ if (viewerComparator != null) {
+ treeViewer.getViewer().setComparator(viewerComparator);
}
treeViewer.getViewer().addSelectionChangedListener(new ISelectionChangedListener() {
@Override
@@ -241,8 +239,8 @@ public class FilteredTreeDialog extends MessageDialog {
return treeViewer;
}
- public void setSorter(ViewerSorter viewerSorter) {
- this.viewerSorter = viewerSorter;
+ public void setComparator(ViewerComparator viewerComparator) {
+ this.viewerComparator = viewerComparator;
}
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/FilteredTreeRelationTypeDialog.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/FilteredTreeRelationTypeDialog.java
index 3a0a1a3636b..1c558068841 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/FilteredTreeRelationTypeDialog.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/FilteredTreeRelationTypeDialog.java
@@ -13,7 +13,7 @@ package org.eclipse.osee.framework.ui.skynet.widgets.dialog;
import java.util.Collection;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.jface.viewers.ViewerComparator;
import org.eclipse.osee.framework.core.data.IRelationType;
import org.eclipse.osee.framework.core.util.Result;
import org.eclipse.osee.framework.logging.OseeLevel;
@@ -22,7 +22,7 @@ import org.eclipse.osee.framework.skynet.core.relation.RelationTypeManager;
import org.eclipse.osee.framework.ui.plugin.util.ArrayTreeContentProvider;
import org.eclipse.osee.framework.ui.plugin.util.StringLabelProvider;
import org.eclipse.osee.framework.ui.skynet.internal.Activator;
-import org.eclipse.osee.framework.ui.skynet.util.StringNameSorter;
+import org.eclipse.osee.framework.ui.skynet.util.StringNameComparator;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
@@ -42,10 +42,10 @@ public class FilteredTreeRelationTypeDialog extends FilteredTreeDialog {
}
public FilteredTreeRelationTypeDialog(String title, String message, Collection<? extends IRelationType> selectable, ITreeContentProvider contentProvider, ILabelProvider labelProvider) {
- this(title, message, selectable, contentProvider, labelProvider, new StringNameSorter());
+ this(title, message, selectable, contentProvider, labelProvider, new StringNameComparator());
}
- public FilteredTreeRelationTypeDialog(String title, String message, Collection<? extends IRelationType> selectable, ITreeContentProvider contentProvider, ILabelProvider labelProvider, ViewerSorter sorter) {
+ public FilteredTreeRelationTypeDialog(String title, String message, Collection<? extends IRelationType> selectable, ITreeContentProvider contentProvider, ILabelProvider labelProvider, ViewerComparator sorter) {
super(title, message, contentProvider, labelProvider, sorter);
this.selectable = selectable;
}
@@ -82,8 +82,8 @@ public class FilteredTreeRelationTypeDialog extends FilteredTreeDialog {
}
@Override
- public void setSorter(ViewerSorter sorter) {
- getTreeViewer().getViewer().setSorter(sorter);
+ public void setComparator(ViewerComparator comparator) {
+ getTreeViewer().getViewer().setComparator(comparator);
}
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/ViewApplicabilityFilterTreeDialog.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/ViewApplicabilityFilterTreeDialog.java
index c4c322ad903..14247fc64ec 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/ViewApplicabilityFilterTreeDialog.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/dialog/ViewApplicabilityFilterTreeDialog.java
@@ -20,7 +20,7 @@ import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.ui.plugin.util.ArrayTreeContentProvider;
import org.eclipse.osee.framework.ui.plugin.util.StringLabelProvider;
import org.eclipse.osee.framework.ui.skynet.internal.Activator;
-import org.eclipse.osee.framework.ui.skynet.util.StringNameSorter;
+import org.eclipse.osee.framework.ui.skynet.util.StringNameComparator;
import org.eclipse.osee.framework.ui.skynet.widgets.XCheckBox;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
@@ -44,7 +44,7 @@ public class ViewApplicabilityFilterTreeDialog extends FilteredTreeDialog {
protected Control createDialogArea(Composite container) {
Control comp = super.createDialogArea(container);
try {
- getTreeViewer().getViewer().setSorter(new StringNameSorter());
+ getTreeViewer().getViewer().setComparator(new StringNameComparator());
getTreeViewer().getViewer().addPostSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent event) {

Back to the top