/** * Copyright (c) 2015 Obeo. * 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.htm * Contributors: Obeo - initial API and implementation */ package org.eclipse.eef.impl; import org.eclipse.eef.EEFWidgetAction; import org.eclipse.eef.EefPackage; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; /** * <!-- begin-user-doc --> An implementation of the model object '<em><b>EEF Widget Action</b></em>'. <!-- end-user-doc * --> * <p> * The following features are implemented: * <ul> * <li>{@link org.eclipse.eef.impl.EEFWidgetActionImpl#getLabelExpression <em>Label Expression</em>}</li> * <li>{@link org.eclipse.eef.impl.EEFWidgetActionImpl#getActionExpression <em>Action Expression</em>}</li> * </ul> * </p> * * @generated */ public class EEFWidgetActionImpl extends MinimalEObjectImpl.Container implements EEFWidgetAction { /** * The default value of the '{@link #getLabelExpression() <em>Label Expression</em>}' attribute. <!-- begin-user-doc * --> <!-- end-user-doc --> * * @see #getLabelExpression() * @generated * @ordered */ protected static final String LABEL_EXPRESSION_EDEFAULT = null; /** * The cached value of the '{@link #getLabelExpression() <em>Label Expression</em>}' attribute. <!-- begin-user-doc * --> <!-- end-user-doc --> * * @see #getLabelExpression() * @generated * @ordered */ protected String labelExpression = EEFWidgetActionImpl.LABEL_EXPRESSION_EDEFAULT; /** * The default value of the '{@link #getActionExpression() <em>Action Expression</em>}' attribute. <!-- * begin-user-doc --> <!-- end-user-doc --> * * @see #getActionExpression() * @generated * @ordered */ protected static final String ACTION_EXPRESSION_EDEFAULT = null; /** * The cached value of the '{@link #getActionExpression() <em>Action Expression</em>}' attribute. <!-- * begin-user-doc --> <!-- end-user-doc --> * * @see #getActionExpression() * @generated * @ordered */ protected String actionExpression = EEFWidgetActionImpl.ACTION_EXPRESSION_EDEFAULT; /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ protected EEFWidgetActionImpl() { super(); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override protected EClass eStaticClass() { return EefPackage.Literals.EEF_WIDGET_ACTION; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public String getLabelExpression() { return labelExpression; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public void setLabelExpression(String newLabelExpression) { String oldLabelExpression = labelExpression; labelExpression = newLabelExpression; if (eNotificationRequired()) { eNotify(new ENotificationImpl(this, Notification.SET, EefPackage.EEF_WIDGET_ACTION__LABEL_EXPRESSION, oldLabelExpression, labelExpression)); } } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public String getActionExpression() { return actionExpression; } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public void setActionExpression(String newActionExpression) { String oldActionExpression = actionExpression; actionExpression = newActionExpression; if (eNotificationRequired()) { eNotify(new ENotificationImpl(this, Notification.SET, EefPackage.EEF_WIDGET_ACTION__ACTION_EXPRESSION, oldActionExpression, actionExpression)); } } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case EefPackage.EEF_WIDGET_ACTION__LABEL_EXPRESSION: return getLabelExpression(); case EefPackage.EEF_WIDGET_ACTION__ACTION_EXPRESSION: return getActionExpression(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case EefPackage.EEF_WIDGET_ACTION__LABEL_EXPRESSION: setLabelExpression((String) newValue); return; case EefPackage.EEF_WIDGET_ACTION__ACTION_EXPRESSION: setActionExpression((String) newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case EefPackage.EEF_WIDGET_ACTION__LABEL_EXPRESSION: setLabelExpression(EEFWidgetActionImpl.LABEL_EXPRESSION_EDEFAULT); return; case EefPackage.EEF_WIDGET_ACTION__ACTION_EXPRESSION: setActionExpression(EEFWidgetActionImpl.ACTION_EXPRESSION_EDEFAULT); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case EefPackage.EEF_WIDGET_ACTION__LABEL_EXPRESSION: return EEFWidgetActionImpl.LABEL_EXPRESSION_EDEFAULT == null ? labelExpression != null : !EEFWidgetActionImpl.LABEL_EXPRESSION_EDEFAULT.equals(labelExpression); case EefPackage.EEF_WIDGET_ACTION__ACTION_EXPRESSION: return EEFWidgetActionImpl.ACTION_EXPRESSION_EDEFAULT == null ? actionExpression != null : !EEFWidgetActionImpl.ACTION_EXPRESSION_EDEFAULT.equals(actionExpression); } 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(" (labelExpression: "); //$NON-NLS-1$ result.append(labelExpression); result.append(", actionExpression: "); //$NON-NLS-1$ result.append(actionExpression); result.append(')'); return result.toString(); } } // EEFWidgetActionImpl