Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/ListEditorContentProvider.java')
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/ListEditorContentProvider.java15
1 files changed, 9 insertions, 6 deletions
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/ListEditorContentProvider.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/ListEditorContentProvider.java
index 735755c8..b6c21d08 100644
--- a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/ListEditorContentProvider.java
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/ListEditorContentProvider.java
@@ -18,22 +18,25 @@ import java.util.List;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.Viewer;
+
/**
* @author Eugene Kuleshov
*/
public class ListEditorContentProvider<T> implements IStructuredContentProvider {
public static final Object[] EMPTY = new Object[0];
+
private boolean shouldSort;
+
private Comparator<T> comparator;
-
+
@SuppressWarnings("unchecked")
public Object[] getElements(Object input) {
if(input instanceof List) {
List<T> list = (List<T>) input;
- if (shouldSort) {
+ if(shouldSort) {
T[] array = (T[]) list.toArray();
- Arrays.<T>sort(array, comparator);
+ Arrays.<T> sort(array, comparator);
return array;
}
return list.toArray();
@@ -43,14 +46,14 @@ public class ListEditorContentProvider<T> implements IStructuredContentProvider
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
}
-
+
public void dispose() {
}
-
+
public void setShouldSort(boolean shouldSort) {
this.shouldSort = shouldSort;
}
-
+
public void setComparator(Comparator<T> comparator) {
this.comparator = comparator;
}

Back to the top