public Object getFeature(Object thisObject) { return itemPropertyDescriptor.getFeature(object); }
/** * This returns the interface name of this property. * This is the key that is passed around and must uniquely identify this descriptor. */ public String getId(Object thisObject) { return itemPropertyDescriptor.getId(object); }
/** * This does the delegated job of determining whether the property value from the given object supports set (and reset). */ public boolean canSetProperty(Object thisObject) { return itemPropertyDescriptor.canSetProperty(object); }
/** * This convenience method finds a particular descriptor * given its {@link IItemPropertyDescriptor#getId(Object) ID} or {@link IItemPropertyDescriptor#getFeature(Object) feature}. */ public IItemPropertyDescriptor getPropertyDescriptor(Object object, Object propertyId) { for (IItemPropertyDescriptor itemPropertyDescriptor : getPropertyDescriptors(object)) { if (propertyId.equals(itemPropertyDescriptor.getId(object)) || propertyId.equals(itemPropertyDescriptor.getFeature(object))) { return itemPropertyDescriptor; } } return null; }
/** * This returns the group of properties into which this one should be placed. */ public String getCategory(Object thisObject) { return itemPropertyDescriptor.getCategory(object); }
/** * This returns the description to be displayed in the property sheet when this property is selected. */ public String getDescription(Object thisObject) { return itemPropertyDescriptor.getDescription(object); }
/** * This returns the name of the property to be displayed in the property sheet. */ public String getDisplayName(Object thisObject) { return itemPropertyDescriptor.getDisplayName(object); }
public Collection<?> getChoiceOfValues(Object thisObject) { return itemPropertyDescriptor.getChoiceOfValues(object); }
/** * {@link IItemPropertySource#getPropertyDescriptor IItemPropertySource.getPropertyDescriptor} is implemented by * iterating over the descriptors returned by {@link #getPropertyDescriptors getPropertyDescriptors}, and returning * the first descriptor whose {@link IItemPropertyDescriptor#getId(Object) ID} * or {@link IItemPropertyDescriptor#getFeature(Object) feature} matches the specified ID, * or <code>null</code> if none match. */ public IItemPropertyDescriptor getPropertyDescriptor(Object object, Object propertyId) { for (IItemPropertyDescriptor descriptor : getPropertyDescriptors(object)) { if (propertyId.equals(descriptor.getId(object)) || propertyId.equals(descriptor.getFeature(object))) { return descriptor; } } return null; }
@Override public void setPropertyValue(Object thisObject, final Object value) { final MappingDomain domain = mapping.getMappingRoot().getDomain(); final Object feature = itemPropertyDescriptor.getFeature(value); CompoundCommand compound = new StrictCompoundCommand(); final Command copyCommand = CopyCommand.create(domain, typeMappingHelper); compound.append(copyCommand); compound.append (new CommandWrapper() { @Override protected Command createCommand() { return SetCommand.create(domain, copyCommand.getResult().iterator().next(), feature, value); } }); compound.append (new CommandWrapper() { @Override protected Command createCommand() { return SetCommand.create(domain, mapping, MappingPackage.eINSTANCE.getMapping_Helper(), copyCommand.getResult().iterator().next()); } }); domain.getCommandStack().execute(compound); }
@Override public void setPropertyValue(Object thisObject, final Object value) { final MappingDomain domain = mapping.getMappingRoot().getDomain(); final Object feature = itemPropertyDescriptor.getFeature(value); CompoundCommand compound = new StrictCompoundCommand(); final Command copyCommand = CopyCommand.create(domain, typeMappingHelper); compound.append(copyCommand); compound.append (new CommandWrapper() { @Override protected Command createCommand() { return SetCommand.create(domain, copyCommand.getResult().iterator().next(), feature, value); } }); compound.append (new CommandWrapper() { @Override protected Command createCommand() { return SetCommand.create(domain, mapping, MappingPackage.eINSTANCE.getMapping_Helper(), copyCommand.getResult().iterator().next()); } }); domain.getCommandStack().execute(compound); }
Object feature = delegatedItemPropertyDescriptor.getFeature(object); if (feature != XSDPackage.eINSTANCE.getXSDFeature_Constraint() && feature != XSDPackage.eINSTANCE.getXSDFeature_Value() &&