Mercurial > projects > dwt2
comparison org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet017TableViewerWithDerivedColumns.d @ 100:e884642ad36e
more work on examples
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Thu, 23 Apr 2009 00:02:38 +0200 |
parents | 5d5bd660917f |
children |
comparison
equal
deleted
inserted
replaced
99:5d5bd660917f | 100:e884642ad36e |
---|---|
101 } | 101 } |
102 | 102 |
103 private static Person UNKNOWN = new Person("unknown", null, null); | 103 private static Person UNKNOWN = new Person("unknown", null, null); |
104 | 104 |
105 // The data model class. This is normally a persistent class of some sort. | 105 // The data model class. This is normally a persistent class of some sort. |
106 static class Person extends AbstractModelObject { | 106 static class Person : AbstractModelObject { |
107 // A property... | 107 // A property... |
108 String name = "Donald Duck"; | 108 String name = "Donald Duck"; |
109 Person mother; | 109 Person mother; |
110 Person father; | 110 Person father; |
111 | 111 |
243 // Since we're using a JFace Viewer, we do first wrap our Table... | 243 // Since we're using a JFace Viewer, we do first wrap our Table... |
244 TableViewer peopleViewer = new TableViewer(duckFamily); | 244 TableViewer peopleViewer = new TableViewer(duckFamily); |
245 peopleViewer.addFilter(new ViewerFilter() { | 245 peopleViewer.addFilter(new ViewerFilter() { |
246 public bool select(Viewer viewer, Object parentElement, | 246 public bool select(Viewer viewer, Object parentElement, |
247 Object element) { | 247 Object element) { |
248 return element != UNKNOWN; | 248 return element !is UNKNOWN; |
249 } | 249 } |
250 }); | 250 }); |
251 | 251 |
252 // Bind viewers to model | 252 // Bind viewers to model |
253 ViewerSupport.bind(peopleViewer, viewModel.getPeople(), | 253 ViewerSupport.bind(peopleViewer, viewModel.getPeople(), |