| /** |
| * 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 v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation |
| * |
| * generated from ActionDSL.xcore |
| * |
| * |
| */ |
| package org.eclipse.osbp.xtext.action.impl; |
| |
| import java.util.Collection; |
| |
| import org.eclipse.emf.common.notify.NotificationChain; |
| |
| import org.eclipse.emf.common.util.EList; |
| |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.InternalEObject; |
| |
| import org.eclipse.emf.ecore.util.EObjectContainmentEList; |
| import org.eclipse.emf.ecore.util.InternalEList; |
| |
| import org.eclipse.osbp.dsl.semantic.common.types.impl.LPackageImpl; |
| |
| import org.eclipse.osbp.xtext.action.ActionCommand; |
| import org.eclipse.osbp.xtext.action.ActionDSLPackage; |
| import org.eclipse.osbp.xtext.action.ActionPackage; |
| import org.eclipse.osbp.xtext.action.ActionToolbar; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Action Package</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.osbp.xtext.action.impl.ActionPackageImpl#getCommands <em>Commands</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.action.impl.ActionPackageImpl#getToolbars <em>Toolbars</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class ActionPackageImpl extends LPackageImpl implements ActionPackage { |
| /** |
| * The cached value of the '{@link #getCommands() <em>Commands</em>}' containment reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getCommands() |
| * @generated |
| * @ordered |
| */ |
| protected EList<ActionCommand> commands; |
| |
| /** |
| * The cached value of the '{@link #getToolbars() <em>Toolbars</em>}' containment reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getToolbars() |
| * @generated |
| * @ordered |
| */ |
| protected EList<ActionToolbar> toolbars; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected ActionPackageImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return ActionDSLPackage.Literals.ACTION_PACKAGE; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<ActionCommand> getCommands() { |
| if (commands == null) { |
| commands = new EObjectContainmentEList<ActionCommand>(ActionCommand.class, this, ActionDSLPackage.ACTION_PACKAGE__COMMANDS); |
| } |
| return commands; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<ActionToolbar> getToolbars() { |
| if (toolbars == null) { |
| toolbars = new EObjectContainmentEList<ActionToolbar>(ActionToolbar.class, this, ActionDSLPackage.ACTION_PACKAGE__TOOLBARS); |
| } |
| return toolbars; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case ActionDSLPackage.ACTION_PACKAGE__COMMANDS: |
| return ((InternalEList<?>)getCommands()).basicRemove(otherEnd, msgs); |
| case ActionDSLPackage.ACTION_PACKAGE__TOOLBARS: |
| return ((InternalEList<?>)getToolbars()).basicRemove(otherEnd, msgs); |
| } |
| return super.eInverseRemove(otherEnd, featureID, msgs); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case ActionDSLPackage.ACTION_PACKAGE__COMMANDS: |
| return getCommands(); |
| case ActionDSLPackage.ACTION_PACKAGE__TOOLBARS: |
| return getToolbars(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @SuppressWarnings("unchecked") |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case ActionDSLPackage.ACTION_PACKAGE__COMMANDS: |
| getCommands().clear(); |
| getCommands().addAll((Collection<? extends ActionCommand>)newValue); |
| return; |
| case ActionDSLPackage.ACTION_PACKAGE__TOOLBARS: |
| getToolbars().clear(); |
| getToolbars().addAll((Collection<? extends ActionToolbar>)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case ActionDSLPackage.ACTION_PACKAGE__COMMANDS: |
| getCommands().clear(); |
| return; |
| case ActionDSLPackage.ACTION_PACKAGE__TOOLBARS: |
| getToolbars().clear(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case ActionDSLPackage.ACTION_PACKAGE__COMMANDS: |
| return commands != null && !commands.isEmpty(); |
| case ActionDSLPackage.ACTION_PACKAGE__TOOLBARS: |
| return toolbars != null && !toolbars.isEmpty(); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //ActionPackageImpl |