Changes between Version 1 and Version 2 of CustomizeProperties


Ignore:
Timestamp:
Mar 14, 2008, 1:50:21 PM (16 years ago)
Author:
jdamerow
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • CustomizeProperties

    v1 v2  
    99What to do:
    1010
    11   - Write a class like the following. This is the file choose itself.
     11  * Write a class like the following. This is the file choose itself.
    1212{{{
    1313public class FileChooserCellEditor extends DialogCellEditor {
     
    2828}}}
    2929
    30   - Write a property descriptor for all your properties:
     30  * Write a property descriptor for all your properties:
    3131{{{
    3232public class ExhibitionPropertyDescriptor extends
     
    5252}
    5353}}}
     54
     55  * Change your XXXPropertySection in the package "sheet" as follows:
     56{{{
     57/**
     58 * @generated NOT
     59 */
     60public IPropertySource getPropertySource(Object object) {
     61   if (object instanceof IPropertySource) {
     62        return (IPropertySource) object;
     63   }
     64   AdapterFactory af = getAdapterFactory(object);
     65   if (af != null) {
     66        IItemPropertySource ips = (IItemPropertySource) af.adapt(object,
     67                                IItemPropertySource.class);
     68        if (ips != null) {
     69           return new EMFCompositePropertySource(object, ips,
     70                                        null) {
     71                protected IPropertyDescriptor newPropertyDescriptor(
     72                        IItemPropertyDescriptor itemPropertyDescriptor) {
     73                        return new ExhibitionPropertyDescriptor(object,
     74                                itemPropertyDescriptor, getCategory());
     75                }
     76           };
     77        }
     78   }
     79   if (object instanceof IAdaptable) {
     80        return (IPropertySource) ((IAdaptable) object)
     81                .getAdapter(IPropertySource.class);
     82        }
     83   return null;
     84}
     85}}}