| /** |
| * Copyright (c) 2013 itemis AG and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * Mark Broerkens - initial API and implementation |
| * |
| */ |
| package org.eclipse.rmf.reqif10.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| import org.eclipse.rmf.reqif10.AccessControlledElement; |
| import org.eclipse.rmf.reqif10.ReqIF10Package; |
| |
| /** |
| * <!-- begin-user-doc --> An implementation of the model object '<em><b>Access Controlled Element</b></em>'. <!-- |
| * end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.rmf.reqif10.impl.AccessControlledElementImpl#isEditable <em>Editable</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public abstract class AccessControlledElementImpl extends IdentifiableImpl implements AccessControlledElement { |
| /** |
| * The default value of the '{@link #isEditable() <em>Editable</em>}' attribute. <!-- begin-user-doc --> <!-- |
| * end-user-doc --> |
| * |
| * @see #isEditable() |
| * @generated |
| * @ordered |
| */ |
| protected static final boolean EDITABLE_EDEFAULT = false; |
| |
| /** |
| * The cached value of the '{@link #isEditable() <em>Editable</em>}' attribute. <!-- begin-user-doc --> <!-- |
| * end-user-doc --> |
| * |
| * @see #isEditable() |
| * @generated |
| * @ordered |
| */ |
| protected boolean editable = EDITABLE_EDEFAULT; |
| |
| /** |
| * This is true if the Editable attribute has been set. <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| * @ordered |
| */ |
| protected boolean editableESet; |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| protected AccessControlledElementImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return ReqIF10Package.Literals.ACCESS_CONTROLLED_ELEMENT; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public boolean isEditable() { |
| return editable; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public void setEditable(boolean newEditable) { |
| boolean oldEditable = editable; |
| editable = newEditable; |
| boolean oldEditableESet = editableESet; |
| editableESet = true; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ReqIF10Package.ACCESS_CONTROLLED_ELEMENT__EDITABLE, oldEditable, editable, |
| !oldEditableESet)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public void unsetEditable() { |
| boolean oldEditable = editable; |
| boolean oldEditableESet = editableESet; |
| editable = EDITABLE_EDEFAULT; |
| editableESet = false; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.UNSET, ReqIF10Package.ACCESS_CONTROLLED_ELEMENT__EDITABLE, oldEditable, |
| EDITABLE_EDEFAULT, oldEditableESet)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public boolean isSetEditable() { |
| return editableESet; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case ReqIF10Package.ACCESS_CONTROLLED_ELEMENT__EDITABLE: |
| return isEditable(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case ReqIF10Package.ACCESS_CONTROLLED_ELEMENT__EDITABLE: |
| setEditable((Boolean) newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case ReqIF10Package.ACCESS_CONTROLLED_ELEMENT__EDITABLE: |
| unsetEditable(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case ReqIF10Package.ACCESS_CONTROLLED_ELEMENT__EDITABLE: |
| return isSetEditable(); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public String toString() { |
| if (eIsProxy()) |
| return super.toString(); |
| |
| StringBuffer result = new StringBuffer(super.toString()); |
| result.append(" (editable: "); //$NON-NLS-1$ |
| if (editableESet) |
| result.append(editable); |
| else |
| result.append("<unset>"); //$NON-NLS-1$ |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } // AccessControlledElementImpl |