/** * Returns whether a value's single property is settable. By default, this returns whether the structural feature is * {@link org.eclipse.emf.ecore.EStructuralFeature#isChangeable changeable}. Subclasses may use this in creating a * property descriptor, and user subclasses may override it to restrict or allow setting of the property. */ protected boolean isPropertySettable() { return feature.isChangeable(); }
public String getChangeableFlag() { String result = !getEcoreFeature().isChangeable() ? "!" : ""; return result + "IS_CHANGEABLE"; }
public String getChangeableFlag() { String result = !getEcoreFeature().isChangeable() ? "!" : ""; return result + "IS_CHANGEABLE"; }
public boolean isChangeable() { return getEcoreFeature().isChangeable(); }
@Override public Object getValue(EObject object, EStructuralFeature feature) { if (feature == EcorePackage.Literals.ESTRUCTURAL_FEATURE__CHANGEABLE) { return ((EStructuralFeature)object).isChangeable() ? Boolean.FALSE : Boolean.TRUE; // EMOF.isReadOnly = !Ecore.changeable } else { return super.getValue(object, feature); } }
/** * Returns whether the entry attribute is changeable. */ @Override protected boolean isPropertySettable() { return getEntryFeature().isChangeable(); }
@Override public Object getValue(EObject object, EStructuralFeature feature) { if (feature == EcorePackage.Literals.ESTRUCTURAL_FEATURE__CHANGEABLE) { return ((EStructuralFeature)object).isChangeable() ? Boolean.FALSE : Boolean.TRUE; // EMOF.isReadOnly = !Ecore.changeable } else { return super.getValue(object, feature); } }
public boolean isChangeable() { return getEcoreFeature().isChangeable(); }
@Override protected Entry validate(int index, Entry object) { if (modCount == 0) return object; Entry result = super.validate(index, object); EStructuralFeature eStructuralFeature = object.getEStructuralFeature(); if (!eStructuralFeature.isChangeable() || !featureMapValidator.isValid(eStructuralFeature)) { throw new RuntimeException ("Invalid entry feature '" + eStructuralFeature.getEContainingClass().getName() + "." + eStructuralFeature.getName() + "'"); } return result; }
@Override protected Entry validate(int index, Entry object) { if (modCount == 0) return object; Entry result = super.validate(index, object); EStructuralFeature eStructuralFeature = object.getEStructuralFeature(); if (!eStructuralFeature.isChangeable() || !featureMapValidator.isValid(eStructuralFeature)) { throw new RuntimeException ("Invalid entry feature '" + eStructuralFeature.getEContainingClass().getName() + "." + eStructuralFeature.getName() + "'"); } return result; }
@Override protected Entry validate(int index, Entry object) { if (modCount == 0) return object; Entry result = super.validate(index, object); EStructuralFeature eStructuralFeature = object.getEStructuralFeature(); if (!eStructuralFeature.isChangeable() || !featureMapValidator.isValid(eStructuralFeature)) { throw new RuntimeException ("Invalid entry feature '" + eStructuralFeature.getEContainingClass().getName() + "." + eStructuralFeature.getName() + "'"); } return result; }
@Override protected Entry validate(int index, Entry object) { if (modCount == 0) return object; Entry result = super.validate(index, object); EStructuralFeature eStructuralFeature = object.getEStructuralFeature(); if (!eStructuralFeature.isChangeable() || !featureMapValidator.isValid(eStructuralFeature)) { throw new RuntimeException ("Invalid entry feature '" + eStructuralFeature.getEContainingClass().getName() + "." + eStructuralFeature.getName() + "'"); } return result; }
protected void eDynamicUnset(int dynamicFeatureID, EStructuralFeature eFeature) { if (dynamicFeatureID < 0) { eOpenUnset(eFeature); } else { if (!eFeature.isChangeable()) { throw new IllegalArgumentException("The feature '" + eFeature.getName() + "' is not a valid changeable feature"); } eSettingDelegate(eFeature).dynamicUnset(this, eSettings(), dynamicFeatureID); } }
protected void eDynamicSet(int dynamicFeatureID, EStructuralFeature eFeature, Object newValue) { if (dynamicFeatureID < 0) { eOpenSet(eFeature, newValue); } else { if (!eFeature.isChangeable()) { throw new IllegalArgumentException("The feature '" + eFeature.getName() + "' is not a valid changeable feature"); } eSettingDelegate(eFeature).dynamicSet(this, eSettings(), dynamicFeatureID, newValue); } }
protected void eDynamicUnset(int dynamicFeatureID, EStructuralFeature eFeature) { if (dynamicFeatureID < 0) { eOpenUnset(eFeature); } else { if (!eFeature.isChangeable()) { throw new IllegalArgumentException("The feature '" + eFeature.getName() + "' is not a valid changeable feature"); } eSettingDelegate(eFeature).dynamicUnset(this, eSettings(), dynamicFeatureID); } }
protected void eDynamicSet(int dynamicFeatureID, EStructuralFeature eFeature, Object newValue) { if (dynamicFeatureID < 0) { eOpenSet(eFeature, newValue); } else { if (!eFeature.isChangeable()) { throw new IllegalArgumentException("The feature '" + eFeature.getName() + "' is not a valid changeable feature"); } eSettingDelegate(eFeature).dynamicSet(this, eSettings(), dynamicFeatureID, newValue); } }
public void eUnset(int featureID) { EStructuralFeature eFeature = eClass().getEStructuralFeature(featureID); int dynamicFeatureID = featureID - eStaticFeatureCount(); if (dynamicFeatureID < 0) { if (eFeature == null) { throw new IllegalArgumentException("The feature ID" + featureID + " is not a valid feature ID"); } else if (!eFeature.isChangeable()) { throw new IllegalArgumentException("The feature '" + eFeature.getName() + "' is not a valid changeable feature"); } else { eUnset(eFeature); /* backward compatibility with old generated overrides */ } } else { assert eFeature != null : "Invalid featureID: " + featureID; eDynamicUnset(dynamicFeatureID, eFeature); } }
/** */ @Override public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) { // if (itemPropertyDescriptors == null) { itemPropertyDescriptors = new ArrayList<IItemPropertyDescriptor>(); for (EStructuralFeature eFeature : ((EObject)object).eClass().getEAllStructuralFeatures()) { if (!(eFeature instanceof EReference) || !((EReference)eFeature).isContainment()) { itemPropertyDescriptors.add (new ItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getFeatureText(eFeature), getResourceLocator().getString ("_UI_Property_description", new Object [] { getFeatureText(eFeature), eFeature.getEType().getName() }), eFeature, eFeature.isChangeable(), ItemPropertyDescriptor.GENERIC_VALUE_IMAGE)); } } } return itemPropertyDescriptors; }
public GenFeature getRootFeature() { EClass documentRoot = getExtendedMetaData().getDocumentRoot(getEcorePackage()); if (documentRoot != null) { for (EStructuralFeature eStructuralFeature : getExtendedMetaData().getAllElements(documentRoot)) { if (eStructuralFeature instanceof EReference && !((EClass)eStructuralFeature.getEType()).isAbstract() && eStructuralFeature.isChangeable()) { return findGenFeature(eStructuralFeature); } } } return null; }
public GenFeature getRootFeature() { EClass documentRoot = getExtendedMetaData().getDocumentRoot(getEcorePackage()); if (documentRoot != null) { for (EStructuralFeature eStructuralFeature : getExtendedMetaData().getAllElements(documentRoot)) { if (eStructuralFeature instanceof EReference && !((EClass)eStructuralFeature.getEType()).isAbstract() && eStructuralFeature.isChangeable()) { return findGenFeature(eStructuralFeature); } } } return null; }