Mercurial > projects > dwt2
diff org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet018CheckboxTableViewerCheckedSelection.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 |
line wrap: on
line diff
--- a/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet018CheckboxTableViewerCheckedSelection.d Wed Apr 22 18:59:26 2009 +0200 +++ b/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet018CheckboxTableViewerCheckedSelection.d Thu Apr 23 00:02:38 2009 +0200 @@ -144,7 +144,7 @@ } // The data model class. - static class Person extends AbstractModelObject { + static class Person : AbstractModelObject { private String name; private Set friends = new HashSet(); @@ -177,7 +177,7 @@ // The ViewModel is responsible for getting the objects to edit from the // data access tier. Since this snippet doesn't have any persistent objects // to retrieve, this ViewModel just instantiates a model object to edit. - static class ViewModel extends AbstractModelObject { + static class ViewModel : AbstractModelObject { private List people = new ArrayList(); public List getPeople() { @@ -304,13 +304,13 @@ InputDialog dlg = new InputDialog(shell, "Add Person", "Enter name:", "<Name>", new IInputValidator() { public String isValid(String newText) { - if (newText == null - || newText.length() == 0) + if (newText is null + || newText.length() is 0) return "Name cannot be empty"; return null; } }); - if (dlg.open() == Window.OK) { + if (dlg.open() is Window.OK) { Person person = new Person(); person.setName(dlg.getValue()); people.add(person); @@ -341,7 +341,7 @@ IObservableValue personSelected = new ComputedValue(bool.TYPE) { protected Object calculate() { - return bool.valueOf(selectedPerson.getValue() != null); + return bool.valueOf(selectedPerson.getValue() !is null); } }; dbc.bindValue(SWTObservables.observeEnabled(removePersonButton),