summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorHendrik Still2013-08-07 07:42:09 (EDT)
committer Gerrit Code Review @ Eclipse.org2013-08-12 14:32:02 (EDT)
commit5ccf110dcd23225e36764b336e3a6b1ab8987f08 (patch)
treeb18c6fa300349406c951ab710bcf1215f8eb963e
parent2965a67eaaa70d4c692bd3747e911a3726ccdf08 (diff)
downloadeclipse.platform.ui-5ccf110dcd23225e36764b336e3a6b1ab8987f08.zip
eclipse.platform.ui-5ccf110dcd23225e36764b336e3a6b1ab8987f08.tar.gz
eclipse.platform.ui-5ccf110dcd23225e36764b336e3a6b1ab8987f08.tar.bz2
Bug 414565 - [JFace][snippets] Update JFace snippets to generifiedrefs/changes/43/15243/3
viewers Change-Id: I9c06b217132b53d7bb3966d39f73b15150f11570 Signed-off-by: Hendrik Still <hendrik.still@gammas.de>
-rw-r--r--examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet063ComboViewer.java36
1 files changed, 9 insertions, 27 deletions
diff --git a/examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet063ComboViewer.java b/examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet063ComboViewer.java
index 0f26c0a..47cbe4e 100644
--- a/examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet063ComboViewer.java
+++ b/examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet063ComboViewer.java
@@ -30,37 +30,18 @@ import org.eclipse.swt.widgets.Shell;
*
*/
public class Snippet063ComboViewer {
- private class MyContentProvider implements IStructuredContentProvider {
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.jface.viewers.IStructuredContentProvider#getElements(
- * java.lang.Object)
- */
- public Object[] getElements(Object inputElement) {
- return (MyModel[]) inputElement;
- }
+ private class MyContentProvider implements IStructuredContentProvider<MyModel,MyModel[]> {
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.viewers.IContentProvider#dispose()
- */
public void dispose() {
}
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse
- * .jface.viewers.Viewer, java.lang.Object, java.lang.Object)
- */
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ public void inputChanged(Viewer<MyModel[]> viewer, MyModel[] oldInput,
+ MyModel[] newInput) {
+ }
+ public MyModel[] getElements(MyModel[] inputElement) {
+ return inputElement;
}
}
@@ -72,6 +53,7 @@ public class Snippet063ComboViewer {
this.counter = counter;
}
+ @Override
public String toString() {
return "Item " + this.counter;
}
@@ -84,8 +66,8 @@ public class Snippet063ComboViewer {
final Label l = new Label(shell, SWT.None);
l.setText("Choose Item:");
- final ComboViewer v = new ComboViewer(shell);
- v.setLabelProvider(new LabelProvider());
+ final ComboViewer<MyModel,MyModel[]> v = new ComboViewer<MyModel,MyModel[]>(shell);
+ v.setLabelProvider(new LabelProvider<MyModel>());
v.setContentProvider(new MyContentProvider());
MyModel[] model = createModel();