| /** |
| * Copyright (c) 2011, 2016 - 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 2.0 |
| * which accompanies this distribution, and is available at |
| * https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| * Based on ideas from Xtext, Xtend, Xcore |
| * |
| * Contributors: |
| * Loetz GmbH&Co.KG - Initial implementation |
| * Jose C. Dominguez - ongoing development |
| * |
| */ |
| package org.eclipse.osbp.xtext.strategy.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| |
| import org.eclipse.emf.ecore.EClass; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| import org.eclipse.osbp.xtext.strategy.LayoutingEnum; |
| import org.eclipse.osbp.xtext.strategy.LayoutingStrategy; |
| import org.eclipse.osbp.xtext.strategy.StrategyDSLPackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Layouting Strategy</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.osbp.xtext.strategy.impl.LayoutingStrategyImpl#getLayout <em>Layout</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class LayoutingStrategyImpl extends StrategyBaseImpl implements LayoutingStrategy { |
| /** |
| * The default value of the '{@link #getLayout() <em>Layout</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getLayout() |
| * @generated |
| * @ordered |
| */ |
| protected static final LayoutingEnum LAYOUT_EDEFAULT = LayoutingEnum.HORIZONTAL; |
| |
| /** |
| * The cached value of the '{@link #getLayout() <em>Layout</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getLayout() |
| * @generated |
| * @ordered |
| */ |
| protected LayoutingEnum layout = LAYOUT_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected LayoutingStrategyImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return StrategyDSLPackage.Literals.LAYOUTING_STRATEGY; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public LayoutingEnum getLayout() { |
| return layout; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setLayout(LayoutingEnum newLayout) { |
| LayoutingEnum oldLayout = layout; |
| layout = newLayout == null ? LAYOUT_EDEFAULT : newLayout; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, StrategyDSLPackage.LAYOUTING_STRATEGY__LAYOUT, oldLayout, layout)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case StrategyDSLPackage.LAYOUTING_STRATEGY__LAYOUT: |
| return getLayout(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case StrategyDSLPackage.LAYOUTING_STRATEGY__LAYOUT: |
| setLayout((LayoutingEnum)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case StrategyDSLPackage.LAYOUTING_STRATEGY__LAYOUT: |
| setLayout(LAYOUT_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case StrategyDSLPackage.LAYOUTING_STRATEGY__LAYOUT: |
| return layout != LAYOUT_EDEFAULT; |
| } |
| 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(" (layout: "); |
| result.append(layout); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //LayoutingStrategyImpl |