diff options
Diffstat (limited to 'tutorial/org.eclipse.emf.examples.library.edit/src/org/eclipse/emf/examples/extlibrary/provider/PersonItemProvider.java')
-rw-r--r-- | tutorial/org.eclipse.emf.examples.library.edit/src/org/eclipse/emf/examples/extlibrary/provider/PersonItemProvider.java | 207 |
1 files changed, 83 insertions, 124 deletions
diff --git a/tutorial/org.eclipse.emf.examples.library.edit/src/org/eclipse/emf/examples/extlibrary/provider/PersonItemProvider.java b/tutorial/org.eclipse.emf.examples.library.edit/src/org/eclipse/emf/examples/extlibrary/provider/PersonItemProvider.java index c3548d7a0..48a1ea59c 100644 --- a/tutorial/org.eclipse.emf.examples.library.edit/src/org/eclipse/emf/examples/extlibrary/provider/PersonItemProvider.java +++ b/tutorial/org.eclipse.emf.examples.library.edit/src/org/eclipse/emf/examples/extlibrary/provider/PersonItemProvider.java @@ -10,7 +10,6 @@ */ package org.eclipse.emf.examples.extlibrary.provider; - import java.util.Collection; import java.util.List; @@ -34,40 +33,30 @@ import org.eclipse.emf.examples.extlibrary.EXTLibraryPackage; import org.eclipse.emf.examples.extlibrary.Person; /** - * This is the item provider adapter for a {@link org.eclipse.emf.examples.extlibrary.Person} object. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + * This is the item provider adapter for a {@link org.eclipse.emf.examples.extlibrary.Person} object. <!-- + * begin-user-doc --> <!-- end-user-doc --> + * * @generated */ -public class PersonItemProvider - extends ItemProviderAdapter - implements - IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider, - IItemPropertySource -{ - /** - * This constructs an instance from a factory and a notifier. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> +public class PersonItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. <!-- begin-user-doc --> <!-- end-user-doc + * --> + * * @generated */ - public PersonItemProvider(AdapterFactory adapterFactory) - { + public PersonItemProvider(AdapterFactory adapterFactory) { super(adapterFactory); } - /** - * This returns the property descriptors for the adapted class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + /** + * This returns the property descriptors for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc + * --> + * * @generated */ - @Override - public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) - { + @Override + public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) { if (itemPropertyDescriptors == null) { super.getPropertyDescriptors(object); @@ -78,146 +67,116 @@ public class PersonItemProvider return itemPropertyDescriptors; } - /** - * This adds a property descriptor for the Address feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + /** + * This adds a property descriptor for the Address feature. <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ - protected void addAddressPropertyDescriptor(Object object) - { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_Addressable_address_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_Addressable_address_feature", "_UI_Addressable_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - EXTLibraryPackage.Literals.ADDRESSABLE__ADDRESS, - true, - false, - false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, - null, - null)); + protected void addAddressPropertyDescriptor(Object object) { + itemPropertyDescriptors.add(createItemPropertyDescriptor( + ((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), + getString("_UI_Addressable_address_feature"), //$NON-NLS-1$ + getString("_UI_PropertyDescriptor_description", "_UI_Addressable_address_feature", //$NON-NLS-1$ //$NON-NLS-2$ + "_UI_Addressable_type"), //$NON-NLS-1$ + EXTLibraryPackage.Literals.ADDRESSABLE__ADDRESS, true, false, false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } - /** - * This adds a property descriptor for the First Name feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + /** + * This adds a property descriptor for the First Name feature. <!-- begin-user-doc --> <!-- end-user-doc + * --> + * * @generated */ - protected void addFirstNamePropertyDescriptor(Object object) - { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_Person_firstName_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_Person_firstName_feature", "_UI_Person_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - EXTLibraryPackage.Literals.PERSON__FIRST_NAME, - true, - false, - false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, - null, - null)); + protected void addFirstNamePropertyDescriptor(Object object) { + itemPropertyDescriptors.add(createItemPropertyDescriptor( + ((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), + getString("_UI_Person_firstName_feature"), //$NON-NLS-1$ + getString("_UI_PropertyDescriptor_description", "_UI_Person_firstName_feature", //$NON-NLS-1$ //$NON-NLS-2$ + "_UI_Person_type"), //$NON-NLS-1$ + EXTLibraryPackage.Literals.PERSON__FIRST_NAME, true, false, false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } - /** - * This adds a property descriptor for the Last Name feature. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + /** + * This adds a property descriptor for the Last Name feature. <!-- begin-user-doc --> <!-- end-user-doc + * --> + * * @generated */ - protected void addLastNamePropertyDescriptor(Object object) - { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_Person_lastName_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_Person_lastName_feature", "_UI_Person_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - EXTLibraryPackage.Literals.PERSON__LAST_NAME, - true, - false, - false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, - null, - null)); + protected void addLastNamePropertyDescriptor(Object object) { + itemPropertyDescriptors.add(createItemPropertyDescriptor( + ((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), + getString("_UI_Person_lastName_feature"), //$NON-NLS-1$ + getString("_UI_PropertyDescriptor_description", "_UI_Person_lastName_feature", //$NON-NLS-1$ //$NON-NLS-2$ + "_UI_Person_type"), //$NON-NLS-1$ + EXTLibraryPackage.Literals.PERSON__LAST_NAME, true, false, false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } - /** - * This returns Person.gif. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + /** + * This returns Person.gif. <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ - @Override - public Object getImage(Object object) - { + @Override + public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/Person")); //$NON-NLS-1$ } - /** - * This returns the label text for the adapted class. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + /** + * This returns the label text for the adapted class. <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ - @Override - public String getText(Object object) - { + @Override + public String getText(Object object) { String label = ((Person)object).getLastName(); - return label == null || label.length() == 0 ? - getString("_UI_Person_type") : //$NON-NLS-1$ - getString("_UI_Person_type") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$ + return label == null || label.length() == 0 ? getString("_UI_Person_type") : //$NON-NLS-1$ + getString("_UI_Person_type") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$ } - /** - * This handles model notifications by calling {@link #updateChildren} to update any cached - * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached children and + * by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. <!-- begin-user-doc + * --> <!-- end-user-doc --> + * * @generated */ - @Override - public void notifyChanged(Notification notification) - { + @Override + public void notifyChanged(Notification notification) { updateChildren(notification); switch (notification.getFeatureID(Person.class)) { case EXTLibraryPackage.PERSON__ADDRESS: case EXTLibraryPackage.PERSON__FIRST_NAME: case EXTLibraryPackage.PERSON__LAST_NAME: - fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + fireNotifyChanged( + new ViewerNotification(notification, notification.getNotifier(), false, true)); return; } super.notifyChanged(notification); } - /** - * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children - * that can be created under this object. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children that can be + * created under this object. <!-- begin-user-doc --> <!-- end-user-doc --> + * * @generated */ - @Override - protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) - { + @Override + protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); } - /** - * Return the resource locator for this item provider's resources. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> + /** + * Return the resource locator for this item provider's resources. <!-- begin-user-doc --> <!-- + * end-user-doc --> + * * @generated */ - @Override - public ResourceLocator getResourceLocator() - { + @Override + public ResourceLocator getResourceLocator() { return EXTLibraryEditPlugin.INSTANCE; } |