Mercurial > projects > dwt2
comparison org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet025TableViewerWithPropertyDerivedColumns.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 |
235 // Since we're using a JFace Viewer, we do first wrap our Table... | 235 // Since we're using a JFace Viewer, we do first wrap our Table... |
236 TableViewer peopleViewer = new TableViewer(duckFamily); | 236 TableViewer peopleViewer = new TableViewer(duckFamily); |
237 peopleViewer.addFilter(new ViewerFilter() { | 237 peopleViewer.addFilter(new ViewerFilter() { |
238 public bool select(Viewer viewer, Object parentElement, | 238 public bool select(Viewer viewer, Object parentElement, |
239 Object element) { | 239 Object element) { |
240 return element != UNKNOWN; | 240 return element !is UNKNOWN; |
241 } | 241 } |
242 }); | 242 }); |
243 | 243 |
244 ViewerSupport.bind(peopleViewer, viewModel.getPeople(), | 244 ViewerSupport.bind(peopleViewer, viewModel.getPeople(), |
245 BeanProperties.values(Person.class, new String[] { "name", | 245 BeanProperties.values(Person.class, new String[] { "name", |