| /** |
| * Copyright (c) 2011, 2015 - Lunifera GmbH (Gross Enzersdorf, Austria), Loetz GmbH&Co.KG (69115 Heidelberg, Germany) |
| * 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: |
| * Florian Pirchner - Initial implementation |
| */ |
| package org.eclipse.osbp.ecview.core.extension.model.extension.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| import org.eclipse.emf.ecore.EClass; |
| |
| import org.eclipse.emf.ecore.InternalEObject; |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; |
| |
| import org.eclipse.osbp.ecview.core.common.model.core.YAlignment; |
| import org.eclipse.osbp.ecview.core.common.model.core.YEmbeddable; |
| import org.eclipse.osbp.ecview.core.extension.model.extension.ExtensionModelPackage; |
| import org.eclipse.osbp.ecview.core.extension.model.extension.YCssLayoutCellStyle; |
| |
| // TODO: Auto-generated Javadoc |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>YCss Layout Cell Style</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.osbp.ecview.core.extension.model.extension.impl.YCssLayoutCellStyleImpl#getTarget <em>Target</em>}</li> |
| * <li>{@link org.eclipse.osbp.ecview.core.extension.model.extension.impl.YCssLayoutCellStyleImpl#getAlignment <em>Alignment</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class YCssLayoutCellStyleImpl extends MinimalEObjectImpl.Container implements YCssLayoutCellStyle { |
| /** |
| * The cached value of the '{@link #getTarget() <em>Target</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getTarget() |
| * @generated |
| * @ordered |
| */ |
| protected YEmbeddable target; |
| /** |
| * The default value of the '{@link #getAlignment() <em>Alignment</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getAlignment() |
| * @generated |
| * @ordered |
| */ |
| protected static final YAlignment ALIGNMENT_EDEFAULT = YAlignment.UNDEFINED; |
| /** |
| * The cached value of the '{@link #getAlignment() <em>Alignment</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getAlignment() |
| * @generated |
| * @ordered |
| */ |
| protected YAlignment alignment = ALIGNMENT_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @generated |
| */ |
| protected YCssLayoutCellStyleImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @return the e class |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return ExtensionModelPackage.Literals.YCSS_LAYOUT_CELL_STYLE; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @return the cached value of the '{@link #getTarget() <em>Target</em>}' |
| * reference |
| * @generated |
| */ |
| public YEmbeddable getTarget() { |
| if (target != null && target.eIsProxy()) { |
| InternalEObject oldTarget = (InternalEObject)target; |
| target = (YEmbeddable)eResolveProxy(oldTarget); |
| if (target != oldTarget) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, ExtensionModelPackage.YCSS_LAYOUT_CELL_STYLE__TARGET, oldTarget, target)); |
| } |
| } |
| return target; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @return the y embeddable |
| * @generated |
| */ |
| public YEmbeddable basicGetTarget() { |
| return target; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @param newTarget |
| * the new cached value of the '{@link #getTarget() |
| * <em>Target</em>}' reference |
| * @generated |
| */ |
| public void setTarget(YEmbeddable newTarget) { |
| YEmbeddable oldTarget = target; |
| target = newTarget; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ExtensionModelPackage.YCSS_LAYOUT_CELL_STYLE__TARGET, oldTarget, target)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @return the cached value of the '{@link #getAlignment() |
| * <em>Alignment</em>}' attribute |
| * @generated |
| */ |
| public YAlignment getAlignment() { |
| return alignment; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @param newAlignment |
| * the new cached value of the '{@link #getAlignment() |
| * <em>Alignment</em>}' attribute |
| * @generated |
| */ |
| public void setAlignment(YAlignment newAlignment) { |
| YAlignment oldAlignment = alignment; |
| alignment = newAlignment == null ? ALIGNMENT_EDEFAULT : newAlignment; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ExtensionModelPackage.YCSS_LAYOUT_CELL_STYLE__ALIGNMENT, oldAlignment, alignment)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @param featureID |
| * the feature id |
| * @param resolve |
| * the resolve |
| * @param coreType |
| * the core type |
| * @return the object |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case ExtensionModelPackage.YCSS_LAYOUT_CELL_STYLE__TARGET: |
| if (resolve) return getTarget(); |
| return basicGetTarget(); |
| case ExtensionModelPackage.YCSS_LAYOUT_CELL_STYLE__ALIGNMENT: |
| return getAlignment(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @param featureID |
| * the feature id |
| * @param newValue |
| * the new value |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case ExtensionModelPackage.YCSS_LAYOUT_CELL_STYLE__TARGET: |
| setTarget((YEmbeddable)newValue); |
| return; |
| case ExtensionModelPackage.YCSS_LAYOUT_CELL_STYLE__ALIGNMENT: |
| setAlignment((YAlignment)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @param featureID |
| * the feature id |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case ExtensionModelPackage.YCSS_LAYOUT_CELL_STYLE__TARGET: |
| setTarget((YEmbeddable)null); |
| return; |
| case ExtensionModelPackage.YCSS_LAYOUT_CELL_STYLE__ALIGNMENT: |
| setAlignment(ALIGNMENT_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @param featureID |
| * the feature id |
| * @return true, if successful |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case ExtensionModelPackage.YCSS_LAYOUT_CELL_STYLE__TARGET: |
| return target != null; |
| case ExtensionModelPackage.YCSS_LAYOUT_CELL_STYLE__ALIGNMENT: |
| return alignment != ALIGNMENT_EDEFAULT; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc -->. |
| * |
| * @return the string |
| * @generated |
| */ |
| @Override |
| public String toString() { |
| if (eIsProxy()) return super.toString(); |
| |
| StringBuffer result = new StringBuffer(super.toString()); |
| result.append(" (alignment: "); |
| result.append(alignment); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //YCssLayoutCellStyleImpl |