| /***************************************************************************** |
| * Copyright (c) 2010, 2018 CEA LIST |
| * |
| * 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 Noyrit florian.noyrit@cea.fr - Initial API and implementation |
| * |
| *****************************************************************************/ |
| package org.eclipse.papyrus.diagramtemplate.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| import org.eclipse.papyrus.diagramtemplate.DiagramTemplatePackage; |
| import org.eclipse.papyrus.diagramtemplate.Selection; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Selection</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.papyrus.diagramtemplate.impl.SelectionImpl#isRecursively <em>Recursively</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class SelectionImpl extends AbstractSelectionImpl implements Selection { |
| /** |
| * The default value of the '{@link #isRecursively() <em>Recursively</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @see #isRecursively() |
| * @generated |
| * @ordered |
| */ |
| protected static final boolean RECURSIVELY_EDEFAULT = false; |
| |
| /** |
| * The cached value of the '{@link #isRecursively() <em>Recursively</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @see #isRecursively() |
| * @generated |
| * @ordered |
| */ |
| protected boolean recursively = RECURSIVELY_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| protected SelectionImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return DiagramTemplatePackage.Literals.SELECTION; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public boolean isRecursively() { |
| return recursively; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public void setRecursively(boolean newRecursively) { |
| boolean oldRecursively = recursively; |
| recursively = newRecursively; |
| if (eNotificationRequired()) { |
| eNotify(new ENotificationImpl(this, Notification.SET, DiagramTemplatePackage.SELECTION__RECURSIVELY, oldRecursively, recursively)); |
| } |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case DiagramTemplatePackage.SELECTION__RECURSIVELY: |
| return isRecursively(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case DiagramTemplatePackage.SELECTION__RECURSIVELY: |
| setRecursively((Boolean) newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case DiagramTemplatePackage.SELECTION__RECURSIVELY: |
| setRecursively(RECURSIVELY_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case DiagramTemplatePackage.SELECTION__RECURSIVELY: |
| return recursively != RECURSIVELY_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(" (recursively: "); |
| result.append(recursively); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } // SelectionImpl |