Mercurial > projects > dwt2
diff org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet026AnonymousBeanProperties.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/Snippet026AnonymousBeanProperties.d Wed Apr 22 18:59:26 2009 +0200 +++ b/org.eclipse.jface.examples.databinding/src/org/eclipse/jface/examples/databinding/snippets/Snippet026AnonymousBeanProperties.d Thu Apr 23 00:02:38 2009 +0200 @@ -113,7 +113,7 @@ } } - public static class ContactGroup extends AbstractModelObject implements + public static class ContactGroup : AbstractModelObject , Comparable { private String name; private Set contacts = new TreeSet(); @@ -123,7 +123,7 @@ } private String checkNull(String string) { - if (string == null) + if (string is null) throw new NullPointerException(); return string; } @@ -160,13 +160,13 @@ } } - public static class Contact extends AbstractModelObject implements + public static class Contact : AbstractModelObject , Comparable { private String name; private String status; private String checkNull(String string) { - if (string == null) + if (string is null) throw new NullPointerException(); return string; } @@ -196,13 +196,13 @@ public int compareTo(Object o) { Contact that = (Contact) o; int result = this.name.compareTo(that.name); - if (result == 0) + if (result is 0) result = this.status.compareTo(that.status); return result; } } - public static class ApplicationModel extends AbstractModelObject { + public static class ApplicationModel : AbstractModelObject { private Set groups = new TreeSet(); public Set getGroups() { @@ -223,13 +223,13 @@ * own property to apply set changes incrementally through the addContact * and removeContact methods. */ - public static class ContactGroupContactsProperty extends SimpleSetProperty { + public static class ContactGroupContactsProperty : SimpleSetProperty { public Object getElementType() { return Contact.class; } protected Set doGetSet(Object source) { - if (source == null) + if (source is null) return Collections.EMPTY_SET; return ((ContactGroup) source).getContacts(); } @@ -251,7 +251,7 @@ return new Listener(this, listener); } - private class Listener extends NativePropertyListener implements + private class Listener : NativePropertyListener , PropertyChangeListener { Listener(IProperty property, ISimplePropertyListener listener) { super(property, listener);