summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorHendrik Still2013-09-16 06:07:10 (EDT)
committer Gerrit Code Review @ Eclipse.org2013-09-17 09:21:39 (EDT)
commit010d666b30813f3485b4098eb0466967903214a3 (patch)
treec93b27618bc2ed53d910947bebac55d8cf8e929e
parent94afd5ca34dc66e7e60cb5af54c0b1af79bb8e7f (diff)
downloadeclipse.platform.ui-010d666b30813f3485b4098eb0466967903214a3.zip
eclipse.platform.ui-010d666b30813f3485b4098eb0466967903214a3.tar.gz
eclipse.platform.ui-010d666b30813f3485b4098eb0466967903214a3.tar.bz2
Bug 417142 - [Viewers] Update Viewer JUnit tests to use genericsrefs/changes/89/16489/2
-Added Testcase for the generic ArrayContentProvider -Updated Testcases to support the <? super I> changes for the ContentProvider Also includes changes from change Ic9b25517d81e78ed3c15576b4956b791278ca682 Change-Id: Ic5f774516c032c99e8f890cc82c61cbd76dc6d78 Signed-off-by: Hendrik Still <hendrik.still@gammas.de>
-rw-r--r--tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/labelProviders/CompositeLabelProviderTest.java4
-rw-r--r--tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/labelProviders/DecoratingStyledCellLabelProviderTest.java3
-rw-r--r--tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/AllTests.java1
-rw-r--r--tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/ArrayContentProviderTest.java165
-rw-r--r--tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug138608Test.java2
-rw-r--r--tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug180504TableViewerTest.java2
-rw-r--r--tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug180504TreeViewerTest.java2
-rw-r--r--tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug200337TableViewerTest.java2
-rw-r--r--tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug200558Test.java2
-rw-r--r--tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug201002TableViewerTest.java2
-rw-r--r--tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug201002TreeViewerTest.java2
-rw-r--r--tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug203657TableViewerTest.java2
-rw-r--r--tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug203657TreeViewerTest.java2
-rw-r--r--tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug205700TreeViewerTest.java2
-rw-r--r--tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug256889TableViewerTest.java2
-rw-r--r--tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug287765Test.java2
-rw-r--r--tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug327004TreeViewerTest.java2
-rw-r--r--tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/ComboViewerComparerTest.java2
-rw-r--r--tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/ListViewerRefreshTest.java2
-rw-r--r--tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/SimpleVirtualLazyTreeViewerTest.java2
-rw-r--r--tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TestLazyModelContentProvider.java2
-rw-r--r--tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TestModelContentProvider.java4
-rw-r--r--tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TestModelLazyTreeContentProvider.java2
-rw-r--r--tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TreeViewerComparatorTest.java2
-rw-r--r--tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/ViewerComparatorTest.java2
-rw-r--r--tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/LazyDeferredVirtualTableView.java2
-rw-r--r--tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/LazyVirtualTableView.java2
-rw-r--r--tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/StyledCellLabelProviderTests.java2
-rw-r--r--tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/VirtualTableView.java2
29 files changed, 196 insertions, 29 deletions
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/labelProviders/CompositeLabelProviderTest.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/labelProviders/CompositeLabelProviderTest.java
index bb52aab..b665bef 100644
--- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/labelProviders/CompositeLabelProviderTest.java
+++ b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/labelProviders/CompositeLabelProviderTest.java
@@ -57,7 +57,7 @@ public abstract class CompositeLabelProviderTest extends ViewerTestCase {
* @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer,
* java.lang.Object, java.lang.Object)
*/
- public void inputChanged(Viewer<TestElement> viewer, TestElement oldInput, TestElement newInput) {
+ public void inputChanged(Viewer<? extends TestElement> viewer, TestElement oldInput, TestElement newInput) {
}
@@ -108,7 +108,7 @@ public abstract class CompositeLabelProviderTest extends ViewerTestCase {
public void dispose() {
}
- public void inputChanged(Viewer<TestElement> viewer, TestElement oldInput, TestElement newInput) {
+ public void inputChanged(Viewer<? extends TestElement> viewer, TestElement oldInput, TestElement newInput) {
}
}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/labelProviders/DecoratingStyledCellLabelProviderTest.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/labelProviders/DecoratingStyledCellLabelProviderTest.java
index f11df84..da9c2b9 100644
--- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/labelProviders/DecoratingStyledCellLabelProviderTest.java
+++ b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/labelProviders/DecoratingStyledCellLabelProviderTest.java
@@ -30,6 +30,7 @@ import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.jface.viewers.StyledString;
import org.eclipse.jface.viewers.TableLayout;
import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerCell;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
@@ -194,7 +195,7 @@ public class DecoratingStyledCellLabelProviderTest extends ViewerTestCase {
* @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer,
* java.lang.Object, java.lang.Object)
*/
- public void inputChanged(org.eclipse.jface.viewers.Viewer<Object> viewer,
+ public void inputChanged(Viewer<? extends Object> viewer,
Object oldInput, Object newInput) {
}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/AllTests.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/AllTests.java
index 363cafc..bcc3617 100644
--- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/AllTests.java
+++ b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/AllTests.java
@@ -66,5 +66,6 @@ public class AllTests extends TestSuite {
addTestSuite(Bug287765Test.class);
addTestSuite(StyledStringBuilderTest.class);
addTestSuite(TreeManagerTest.class);
+ addTestSuite(ArrayContentProviderTest.class);
}
}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/ArrayContentProviderTest.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/ArrayContentProviderTest.java
new file mode 100644
index 0000000..c3f8e02
--- /dev/null
+++ b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/ArrayContentProviderTest.java
@@ -0,0 +1,165 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Hendrik Still and others.
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Hendrik Still<hendrik.still@gammas.de> - initial API and implementation
+ ******************************************************************************/
+
+package org.eclipse.jface.tests.viewers;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.runtime.AssertionFailedException;
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.ListViewer;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * @since 3.5
+ *
+ */
+public class ArrayContentProviderTest extends TestCase {
+
+ private Shell shell;
+
+ protected void setUp() throws Exception {
+ super.setUp();
+
+ shell = new Shell();
+ shell.setLayout(new GridLayout());
+ shell.setSize(new Point(500, 200));
+
+ shell.open();
+ }
+
+ private List<String> getInput(){
+ List<String> input = new ArrayList<String>();
+ input.add("Test 1");
+ input.add("Test 2");
+
+ return input;
+ }
+
+ /**
+ * Tests of ArrayContentProvider works as typed ContentProvider
+ * @throws Exception
+ */
+ public void testGenericArrayProvider() throws Exception {
+ ListViewer<String, List<String>> listViewer = new ListViewer<String, List<String>>(shell);
+ listViewer.setContentProvider(new ArrayContentProvider<String>(String.class));
+ listViewer.setInput(getInput());
+
+
+ String[] items = listViewer.getList().getItems();
+ assertEquals(items[0], "Test 1");
+ assertEquals(items[1], "Test 2");
+ }
+
+ /**
+ * Tests of ArrayContentProvider works as typed ContentProvider with array as input type
+ * @throws Exception
+ */
+ public void testGenericArrayProviderWithArray() throws Exception {
+ ListViewer<String, String[]> listViewer = new ListViewer<String, String[]>(shell);
+ listViewer.setContentProvider(new ArrayContentProvider<String>(String.class));
+
+ String[] input = new String[2];
+ input[0] = "Test 1";
+ input[1] = "Test 2";
+
+
+ listViewer.setInput(input);
+
+
+ String[] items = listViewer.getList().getItems();
+ assertEquals(items[0], "Test 1");
+ assertEquals(items[1], "Test 2");
+ }
+
+ /**
+ * Tests of ArrayContentProvider works as typed ContentProvider for a super type
+ * @throws Exception
+ */
+ public void testGenericArrayProviderWithSuperType() throws Exception {
+ ListViewer<String, List<String>> listViewer = new ListViewer<String, List<String>>(shell);
+ listViewer.setContentProvider(new ArrayContentProvider<Object>(Object.class));
+ listViewer.setInput(getInput());
+
+
+ String[] items = listViewer.getList().getItems();
+ assertEquals(items[0], "Test 1");
+ assertEquals(items[1], "Test 2");
+ }
+
+
+ /**
+ * Tests if ArrayContentProvider throws Exception if wrong typed input is set.
+ * @throws Exception
+ */
+ public void testWrongInputType() throws Exception {
+ ListViewer<String, TestElement[]> listViewer = new ListViewer<String, TestElement[]>(
+ shell);
+ listViewer.setContentProvider(new ArrayContentProvider<String>(
+ String.class));
+ TestElement[] input = new TestElement[1];
+ try {
+ listViewer.setInput(input);
+ fail("No AssertionFailedException");
+ } catch (AssertionFailedException e) {
+ }
+ }
+
+ /**
+ * Tests if ArrayContentProvider works as RawType without type information
+ * @throws Exception
+ */
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ public void testNonGenericArrayProvider() throws Exception {
+ ListViewer listViewer = new ListViewer(shell);
+ listViewer.setContentProvider(new ArrayContentProvider());
+ listViewer.setInput(getInput());
+
+
+ String[] items = listViewer.getList().getItems();
+ assertEquals(items[0], "Test 1");
+ assertEquals(items[1], "Test 2");
+ }
+
+ /**
+ * Tests if ArrayContentProvider.getInstance() returns the correct instances.
+ * @throws Exception
+ */
+ public void testGenericArrayProviderSingelton() throws Exception {
+ ArrayContentProvider<String> firstArrayContentProviderOfString = ArrayContentProvider.getInstance(String.class);
+ ArrayContentProvider<String> secondArrayContentProviderOfString = ArrayContentProvider.getInstance(String.class);
+ ArrayContentProvider<Integer> firstArrayContentProviderOfInteger = ArrayContentProvider.getInstance(Integer.class);
+ assertSame(firstArrayContentProviderOfString, secondArrayContentProviderOfString);
+ assertNotSame(firstArrayContentProviderOfString, firstArrayContentProviderOfInteger);
+ }
+
+ /**
+ * Tests if ArrayContentProvider.getInstance() returns the correct instances in case of rawtypes.
+ * @throws Exception
+ */
+ @SuppressWarnings("rawtypes")
+ public void testNonGenericArrayProviderSingelton() throws Exception {
+ ArrayContentProvider firstArrayContentProvider = ArrayContentProvider.getInstance();
+ ArrayContentProvider secondArrayContentProvider = ArrayContentProvider.getInstance();
+ assertSame(firstArrayContentProvider,secondArrayContentProvider);
+ }
+
+ protected void tearDown() throws Exception {
+ shell.close();
+ super.tearDown();
+ }
+
+}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug138608Test.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug138608Test.java
index 04ebdc0..c3e2241 100644
--- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug138608Test.java
+++ b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug138608Test.java
@@ -144,7 +144,7 @@ public class Bug138608Test extends ViewerTestCase {
public void dispose() {
}
- public void inputChanged(Viewer<TreeNode<String>> viewer, TreeNode<String> oldInput, TreeNode<String> newInput) {
+ public void inputChanged(Viewer<? extends TreeNode<String>> viewer, TreeNode<String> oldInput, TreeNode<String> newInput) {
}
}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug180504TableViewerTest.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug180504TableViewerTest.java
index 83aeefc..6209e62 100644
--- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug180504TableViewerTest.java
+++ b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug180504TableViewerTest.java
@@ -43,7 +43,7 @@ public class Bug180504TableViewerTest extends ViewerTestCase {
protected StructuredViewer createViewer(Composite parent) {
tableViewer = new TableViewer<String,List<String>>(parent, SWT.FULL_SELECTION);
- tableViewer.setContentProvider(new ArrayContentProvider());
+ tableViewer.setContentProvider(new ArrayContentProvider<String>(String.class));
tableViewer.setCellEditors(new CellEditor[] { new TextCellEditor(
tableViewer.getTable()) });
tableViewer.setColumnProperties(new String[] { "0" });
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug180504TreeViewerTest.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug180504TreeViewerTest.java
index dea8839..a7b4f72 100644
--- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug180504TreeViewerTest.java
+++ b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug180504TreeViewerTest.java
@@ -79,7 +79,7 @@ public class Bug180504TreeViewerTest extends ViewerTestCase {
}
- public void inputChanged(Viewer<MyModel> viewer, MyModel oldInput,
+ public void inputChanged(Viewer<? extends MyModel> viewer, MyModel oldInput,
MyModel newInput) {
}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug200337TableViewerTest.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug200337TableViewerTest.java
index 89c10b7..b805fa9 100644
--- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug200337TableViewerTest.java
+++ b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug200337TableViewerTest.java
@@ -41,7 +41,7 @@ public class Bug200337TableViewerTest extends ViewerTestCase {
protected StructuredViewer createViewer(Composite parent) {
tableViewer = new TableViewer<String,List<String>>(parent, SWT.FULL_SELECTION);
- tableViewer.setContentProvider(new ArrayContentProvider());
+ tableViewer.setContentProvider(new ArrayContentProvider<String>(String.class));
tableViewer.setCellEditors(new CellEditor[] { new TextCellEditor(
tableViewer.getTable()) });
tableViewer.setColumnProperties(new String[] { "0" });
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug200558Test.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug200558Test.java
index a0030e3..7d10b21 100644
--- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug200558Test.java
+++ b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug200558Test.java
@@ -45,7 +45,7 @@ public class Bug200558Test extends ViewerTestCase {
public void dispose() {
}
- public void inputChanged(Viewer<Object> viewer, Object oldInput,
+ public void inputChanged(Viewer<? extends Object> viewer, Object oldInput,
Object newInput) {
}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug201002TableViewerTest.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug201002TableViewerTest.java
index b8c8688..dcdb25e 100644
--- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug201002TableViewerTest.java
+++ b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug201002TableViewerTest.java
@@ -40,7 +40,7 @@ public class Bug201002TableViewerTest extends ViewerTestCase {
protected StructuredViewer createViewer(Composite parent) {
tableViewer = new TableViewer<String,List<String>>(parent, SWT.FULL_SELECTION);
- tableViewer.setContentProvider(new ArrayContentProvider());
+ tableViewer.setContentProvider(new ArrayContentProvider<String>(String.class));
tableViewer.setCellEditors(new CellEditor[] { new TextCellEditor(
tableViewer.getTable()) });
tableViewer.setColumnProperties(new String[] { "0" });
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug201002TreeViewerTest.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug201002TreeViewerTest.java
index 796c196..386b37e 100644
--- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug201002TreeViewerTest.java
+++ b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug201002TreeViewerTest.java
@@ -77,7 +77,7 @@ public class Bug201002TreeViewerTest extends ViewerTestCase {
}
- public void inputChanged(Viewer<MyModel> viewer, MyModel oldInput,
+ public void inputChanged(Viewer<? extends MyModel> viewer, MyModel oldInput,
MyModel newInput) {
}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug203657TableViewerTest.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug203657TableViewerTest.java
index ed61cd7..db29045 100644
--- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug203657TableViewerTest.java
+++ b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug203657TableViewerTest.java
@@ -45,7 +45,7 @@ public class Bug203657TableViewerTest extends ViewerTestCase {
protected StructuredViewer createViewer(Composite parent) {
tableViewer = new TableViewer<String,List<String>>(parent, SWT.FULL_SELECTION);
- tableViewer.setContentProvider(new ArrayContentProvider());
+ tableViewer.setContentProvider(new ArrayContentProvider<String>(String.class));
tableViewer.setCellEditors(new CellEditor[] { new TextCellEditor(
tableViewer.getTable()) });
tableViewer.setColumnProperties(new String[] { "0" });
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug203657TreeViewerTest.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug203657TreeViewerTest.java
index dac528d..057b59d 100644
--- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug203657TreeViewerTest.java
+++ b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug203657TreeViewerTest.java
@@ -80,7 +80,7 @@ public class Bug203657TreeViewerTest extends ViewerTestCase {
}
- public void inputChanged(Viewer<MyModel> viewer, MyModel oldInput,
+ public void inputChanged(Viewer<? extends MyModel> viewer, MyModel oldInput,
MyModel newInput) {
}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug205700TreeViewerTest.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug205700TreeViewerTest.java
index 9cbe754..f9bbc21 100644
--- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug205700TreeViewerTest.java
+++ b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug205700TreeViewerTest.java
@@ -221,7 +221,7 @@ public class Bug205700TreeViewerTest extends TestCase {
// nothing
}
- public void inputChanged(Viewer<TreeNode> viewer, TreeNode oldInput, TreeNode newInput) {
+ public void inputChanged(Viewer<? extends TreeNode> viewer, TreeNode oldInput, TreeNode newInput) {
// nothing
}
}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug256889TableViewerTest.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug256889TableViewerTest.java
index 7317609..8060cce 100644
--- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug256889TableViewerTest.java
+++ b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug256889TableViewerTest.java
@@ -74,7 +74,7 @@ public class Bug256889TableViewerTest extends ViewerTestCase {
public void dispose() {
}
- public void inputChanged(Viewer<List<String>> arg0, List<String> arg1, List<String> arg2) {
+ public void inputChanged(Viewer<? extends List<String>> arg0, List<String> arg1, List<String> arg2) {
}
});
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug287765Test.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug287765Test.java
index 1887c47..5a30071 100644
--- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug287765Test.java
+++ b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug287765Test.java
@@ -108,7 +108,7 @@ public class Bug287765Test extends TestCase {
public void dispose() {
}
- public void inputChanged(Viewer<Node> viewer, Node oldInput, Node newInput) {
+ public void inputChanged(Viewer<? extends Node> viewer, Node oldInput, Node newInput) {
}
}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug327004TreeViewerTest.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug327004TreeViewerTest.java
index cabaf86..f98e28e 100644
--- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug327004TreeViewerTest.java
+++ b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/Bug327004TreeViewerTest.java
@@ -45,7 +45,7 @@ public class Bug327004TreeViewerTest extends ViewerTestCase {
}
- public void inputChanged(Viewer<TreeNode<String>[]> viewer,
+ public void inputChanged(Viewer<? extends TreeNode<String>[]> viewer,
TreeNode<String>[] oldInput, TreeNode<String>[] newInput) {
// Do nothing
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/ComboViewerComparerTest.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/ComboViewerComparerTest.java
index c191335..02b92a3 100644
--- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/ComboViewerComparerTest.java
+++ b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/ComboViewerComparerTest.java
@@ -48,7 +48,7 @@ public class ComboViewerComparerTest extends TestCase {
}
public void testSetSelection() {
- viewer.setContentProvider(new ArrayContentProvider());
+ viewer.setContentProvider(new ArrayContentProvider<String>(String.class));
viewer.setComparer(new IElementComparer() {
public boolean equals(final Object element1, final Object element2) {
TestElement testElement1 = (TestElement) element1;
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/ListViewerRefreshTest.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/ListViewerRefreshTest.java
index f845918..a2336fb 100644
--- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/ListViewerRefreshTest.java
+++ b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/ListViewerRefreshTest.java
@@ -159,7 +159,7 @@ public class ListViewerRefreshTest extends TestCase {
public void dispose() {
}
- public void inputChanged(Viewer<List<String>> viewer, List<String> oldInput, List<String> newInput) {
+ public void inputChanged(Viewer<? extends List<String>> viewer, List<String> oldInput, List<String> newInput) {
}
}
}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/SimpleVirtualLazyTreeViewerTest.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/SimpleVirtualLazyTreeViewerTest.java
index e13e3f0..7d4b336 100644
--- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/SimpleVirtualLazyTreeViewerTest.java
+++ b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/SimpleVirtualLazyTreeViewerTest.java
@@ -64,7 +64,7 @@ public class SimpleVirtualLazyTreeViewerTest extends ViewerTestCase {
// do nothing
}
- public void inputChanged(Viewer<String> viewer, String oldInput, String newInput) {
+ public void inputChanged(Viewer<? extends String> viewer, String oldInput, String newInput) {
this.input = newInput;
}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TestLazyModelContentProvider.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TestLazyModelContentProvider.java
index 7bb83c5..ebb1419 100644
--- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TestLazyModelContentProvider.java
+++ b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TestLazyModelContentProvider.java
@@ -58,7 +58,7 @@ public class TestLazyModelContentProvider extends TestModelContentProvider imple
/* (non-Javadoc)
* @see org.eclipse.jface.tests.viewers.TestModelContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
- public void inputChanged(Viewer<TestElement> viewer, TestElement oldInput, TestElement newInput) {
+ public void inputChanged(Viewer<? extends TestElement> viewer, TestElement oldInput, TestElement newInput) {
input = newInput;
((TableViewer<TestElement,TestElement>)viewer).setItemCount(input==null?0:input.getChildCount());
super.inputChanged(viewer, oldInput, newInput);
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TestModelContentProvider.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TestModelContentProvider.java
index c174c8e..1919ba9 100644
--- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TestModelContentProvider.java
+++ b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TestModelContentProvider.java
@@ -24,7 +24,7 @@ import org.eclipse.jface.viewers.Viewer;
public class TestModelContentProvider implements ITestModelListener,
IStructuredContentProvider<TestElement,TestElement>, ITreeContentProvider<TestElement,TestElement> {
- Viewer<TestElement> fViewer;
+ Viewer<? extends TestElement> fViewer;
public void dispose() {
}
@@ -102,7 +102,7 @@ public class TestModelContentProvider implements ITestModelListener,
return element.getChildCount() > 0;
}
- public void inputChanged(Viewer<TestElement> viewer, TestElement oldInput, TestElement newInput) {
+ public void inputChanged(Viewer<? extends TestElement> viewer, TestElement oldInput, TestElement newInput) {
fViewer = viewer;
TestElement oldElement = oldInput;
if (oldElement != null) {
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TestModelLazyTreeContentProvider.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TestModelLazyTreeContentProvider.java
index dd514d0..ece3da1 100644
--- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TestModelLazyTreeContentProvider.java
+++ b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TestModelLazyTreeContentProvider.java
@@ -49,7 +49,7 @@ public class TestModelLazyTreeContentProvider extends TestModelContentProvider
return false;
}
- public void inputChanged(Viewer<TestElement> viewer, TestElement oldInput,
+ public void inputChanged(Viewer<? extends TestElement> viewer, TestElement oldInput,
final TestElement newInput) {
super.inputChanged(viewer, oldInput, newInput);
}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TreeViewerComparatorTest.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TreeViewerComparatorTest.java
index 7f9ffdf..9491aee 100644
--- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TreeViewerComparatorTest.java
+++ b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/TreeViewerComparatorTest.java
@@ -89,7 +89,7 @@ public class TreeViewerComparatorTest extends ViewerComparatorTest{
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
- public void inputChanged(Viewer<Object> viewer, Object oldInput, Object newInput) {
+ public void inputChanged(Viewer<? extends Object> viewer, Object oldInput, Object newInput) {
List<Object> oldElement = (List<Object>) oldInput;
if (oldElement != null) {
Iterator<Object> iter = oldElement.iterator();
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/ViewerComparatorTest.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/ViewerComparatorTest.java
index 677e84e..ce14187 100644
--- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/ViewerComparatorTest.java
+++ b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/ViewerComparatorTest.java
@@ -154,7 +154,7 @@ public abstract class ViewerComparatorTest extends ViewerTestCase {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
- public void inputChanged(Viewer<Object> viewer, Object oldInput, Object newInput) {
+ public void inputChanged(Viewer<? extends Object> viewer, Object oldInput, Object newInput) {
if (oldInput != null){
((Team) oldInput).removeListener(this);;
}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/LazyDeferredVirtualTableView.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/LazyDeferredVirtualTableView.java
index 3b823c5..0396142 100644
--- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/LazyDeferredVirtualTableView.java
+++ b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/LazyDeferredVirtualTableView.java
@@ -126,7 +126,7 @@ public class LazyDeferredVirtualTableView extends VirtualTableView {
* @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer,
* java.lang.Object, java.lang.Object)
*/
- public void inputChanged(Viewer<Object> viewer, Object oldInput,
+ public void inputChanged(Viewer<? extends Object> viewer, Object oldInput,
Object newInput) {
// Do nothing.
}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/LazyVirtualTableView.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/LazyVirtualTableView.java
index 2d235d6..6c39100 100644
--- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/LazyVirtualTableView.java
+++ b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/LazyVirtualTableView.java
@@ -65,7 +65,7 @@ public class LazyVirtualTableView extends VirtualTableView {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
- public void inputChanged(Viewer<Object> viewer, Object oldInput, Object newInput) {
+ public void inputChanged(Viewer<? extends Object> viewer, Object oldInput, Object newInput) {
// Do nothing.
}
};
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/StyledCellLabelProviderTests.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/StyledCellLabelProviderTests.java
index 2c222e1..cb78e3b 100644
--- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/StyledCellLabelProviderTests.java
+++ b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/StyledCellLabelProviderTests.java
@@ -357,7 +357,7 @@ public class StyledCellLabelProviderTests {
public void dispose() {
}
- public void inputChanged(Viewer<Object> viewer, Object oldInput, Object newInput) {
+ public void inputChanged(Viewer<? extends Object> viewer, Object oldInput, Object newInput) {
}
}
}
diff --git a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/VirtualTableView.java b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/VirtualTableView.java
index 30df723..6b3aa4b 100644
--- a/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/VirtualTableView.java
+++ b/tests/org.eclipse.ui.tests/Eclipse JFace Tests/org/eclipse/jface/tests/viewers/interactive/VirtualTableView.java
@@ -124,7 +124,7 @@ public class VirtualTableView extends ViewPart {
* @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer,
* java.lang.Object, java.lang.Object)
*/
- public void inputChanged(Viewer<Object> viewer, Object oldInput,
+ public void inputChanged(Viewer<? extends Object> viewer, Object oldInput,
Object newInput) {
// Nothing to do here.