| /** |
| * 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 org.eclipse.emf.common.notify.Notification; |
| import org.eclipse.emf.common.notify.NotificationChain; |
| |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.InternalEObject; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| import org.eclipse.osbp.xtext.action.ActionButton; |
| import org.eclipse.osbp.xtext.action.ActionDSLPackage; |
| import org.eclipse.osbp.xtext.action.ActionType; |
| |
| import org.eclipse.osbp.xtext.functionlibrarydsl.FunctionLibraryFunction; |
| import org.eclipse.osbp.xtext.functionlibrarydsl.FunctionLibraryGroup; |
| |
| import org.eclipse.osbp.xtext.messagedsl.MessageItem; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Action Button</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.osbp.xtext.action.impl.ActionButtonImpl#isDescription <em>Description</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.action.impl.ActionButtonImpl#getDescriptionValue <em>Description Value</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.action.impl.ActionButtonImpl#getIconURI <em>Icon URI</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.action.impl.ActionButtonImpl#getGroup <em>Group</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.action.impl.ActionButtonImpl#getCanexecute <em>Canexecute</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.action.impl.ActionButtonImpl#getExecuteparameter <em>Executeparameter</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.action.impl.ActionButtonImpl#getActionType <em>Action Type</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.action.impl.ActionButtonImpl#getMessage <em>Message</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class ActionButtonImpl extends ActionBaseImpl implements ActionButton { |
| /** |
| * The default value of the '{@link #isDescription() <em>Description</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isDescription() |
| * @generated |
| * @ordered |
| */ |
| protected static final boolean DESCRIPTION_EDEFAULT = false; |
| |
| /** |
| * The cached value of the '{@link #isDescription() <em>Description</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isDescription() |
| * @generated |
| * @ordered |
| */ |
| protected boolean description = DESCRIPTION_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getDescriptionValue() <em>Description Value</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getDescriptionValue() |
| * @generated |
| * @ordered |
| */ |
| protected static final String DESCRIPTION_VALUE_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getDescriptionValue() <em>Description Value</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getDescriptionValue() |
| * @generated |
| * @ordered |
| */ |
| protected String descriptionValue = DESCRIPTION_VALUE_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getIconURI() <em>Icon URI</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getIconURI() |
| * @generated |
| * @ordered |
| */ |
| protected static final String ICON_URI_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getIconURI() <em>Icon URI</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getIconURI() |
| * @generated |
| * @ordered |
| */ |
| protected String iconURI = ICON_URI_EDEFAULT; |
| |
| /** |
| * The cached value of the '{@link #getGroup() <em>Group</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getGroup() |
| * @generated |
| * @ordered |
| */ |
| protected FunctionLibraryGroup group; |
| |
| /** |
| * The cached value of the '{@link #getCanexecute() <em>Canexecute</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getCanexecute() |
| * @generated |
| * @ordered |
| */ |
| protected FunctionLibraryFunction canexecute; |
| |
| /** |
| * The cached value of the '{@link #getExecuteparameter() <em>Executeparameter</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getExecuteparameter() |
| * @generated |
| * @ordered |
| */ |
| protected FunctionLibraryFunction executeparameter; |
| |
| /** |
| * The cached value of the '{@link #getActionType() <em>Action Type</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getActionType() |
| * @generated |
| * @ordered |
| */ |
| protected ActionType actionType; |
| |
| /** |
| * The cached value of the '{@link #getMessage() <em>Message</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getMessage() |
| * @generated |
| * @ordered |
| */ |
| protected MessageItem message; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected ActionButtonImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return ActionDSLPackage.Literals.ACTION_BUTTON; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean isDescription() { |
| return description; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setDescription(boolean newDescription) { |
| boolean oldDescription = description; |
| description = newDescription; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ActionDSLPackage.ACTION_BUTTON__DESCRIPTION, oldDescription, description)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getDescriptionValue() { |
| return descriptionValue; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setDescriptionValue(String newDescriptionValue) { |
| String oldDescriptionValue = descriptionValue; |
| descriptionValue = newDescriptionValue; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ActionDSLPackage.ACTION_BUTTON__DESCRIPTION_VALUE, oldDescriptionValue, descriptionValue)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getIconURI() { |
| return iconURI; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setIconURI(String newIconURI) { |
| String oldIconURI = iconURI; |
| iconURI = newIconURI; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ActionDSLPackage.ACTION_BUTTON__ICON_URI, oldIconURI, iconURI)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public FunctionLibraryGroup getGroup() { |
| if (group != null && group.eIsProxy()) { |
| InternalEObject oldGroup = (InternalEObject)group; |
| group = (FunctionLibraryGroup)eResolveProxy(oldGroup); |
| if (group != oldGroup) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, ActionDSLPackage.ACTION_BUTTON__GROUP, oldGroup, group)); |
| } |
| } |
| return group; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public FunctionLibraryGroup basicGetGroup() { |
| return group; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setGroup(FunctionLibraryGroup newGroup) { |
| FunctionLibraryGroup oldGroup = group; |
| group = newGroup; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ActionDSLPackage.ACTION_BUTTON__GROUP, oldGroup, group)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public FunctionLibraryFunction getCanexecute() { |
| if (canexecute != null && canexecute.eIsProxy()) { |
| InternalEObject oldCanexecute = (InternalEObject)canexecute; |
| canexecute = (FunctionLibraryFunction)eResolveProxy(oldCanexecute); |
| if (canexecute != oldCanexecute) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, ActionDSLPackage.ACTION_BUTTON__CANEXECUTE, oldCanexecute, canexecute)); |
| } |
| } |
| return canexecute; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public FunctionLibraryFunction basicGetCanexecute() { |
| return canexecute; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setCanexecute(FunctionLibraryFunction newCanexecute) { |
| FunctionLibraryFunction oldCanexecute = canexecute; |
| canexecute = newCanexecute; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ActionDSLPackage.ACTION_BUTTON__CANEXECUTE, oldCanexecute, canexecute)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public FunctionLibraryFunction getExecuteparameter() { |
| if (executeparameter != null && executeparameter.eIsProxy()) { |
| InternalEObject oldExecuteparameter = (InternalEObject)executeparameter; |
| executeparameter = (FunctionLibraryFunction)eResolveProxy(oldExecuteparameter); |
| if (executeparameter != oldExecuteparameter) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, ActionDSLPackage.ACTION_BUTTON__EXECUTEPARAMETER, oldExecuteparameter, executeparameter)); |
| } |
| } |
| return executeparameter; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public FunctionLibraryFunction basicGetExecuteparameter() { |
| return executeparameter; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setExecuteparameter(FunctionLibraryFunction newExecuteparameter) { |
| FunctionLibraryFunction oldExecuteparameter = executeparameter; |
| executeparameter = newExecuteparameter; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ActionDSLPackage.ACTION_BUTTON__EXECUTEPARAMETER, oldExecuteparameter, executeparameter)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public ActionType getActionType() { |
| return actionType; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetActionType(ActionType newActionType, NotificationChain msgs) { |
| ActionType oldActionType = actionType; |
| actionType = newActionType; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ActionDSLPackage.ACTION_BUTTON__ACTION_TYPE, oldActionType, newActionType); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setActionType(ActionType newActionType) { |
| if (newActionType != actionType) { |
| NotificationChain msgs = null; |
| if (actionType != null) |
| msgs = ((InternalEObject)actionType).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ActionDSLPackage.ACTION_BUTTON__ACTION_TYPE, null, msgs); |
| if (newActionType != null) |
| msgs = ((InternalEObject)newActionType).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ActionDSLPackage.ACTION_BUTTON__ACTION_TYPE, null, msgs); |
| msgs = basicSetActionType(newActionType, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ActionDSLPackage.ACTION_BUTTON__ACTION_TYPE, newActionType, newActionType)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public MessageItem getMessage() { |
| if (message != null && message.eIsProxy()) { |
| InternalEObject oldMessage = (InternalEObject)message; |
| message = (MessageItem)eResolveProxy(oldMessage); |
| if (message != oldMessage) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, ActionDSLPackage.ACTION_BUTTON__MESSAGE, oldMessage, message)); |
| } |
| } |
| return message; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public MessageItem basicGetMessage() { |
| return message; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setMessage(MessageItem newMessage) { |
| MessageItem oldMessage = message; |
| message = newMessage; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, ActionDSLPackage.ACTION_BUTTON__MESSAGE, oldMessage, message)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case ActionDSLPackage.ACTION_BUTTON__ACTION_TYPE: |
| return basicSetActionType(null, 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_BUTTON__DESCRIPTION: |
| return isDescription(); |
| case ActionDSLPackage.ACTION_BUTTON__DESCRIPTION_VALUE: |
| return getDescriptionValue(); |
| case ActionDSLPackage.ACTION_BUTTON__ICON_URI: |
| return getIconURI(); |
| case ActionDSLPackage.ACTION_BUTTON__GROUP: |
| if (resolve) return getGroup(); |
| return basicGetGroup(); |
| case ActionDSLPackage.ACTION_BUTTON__CANEXECUTE: |
| if (resolve) return getCanexecute(); |
| return basicGetCanexecute(); |
| case ActionDSLPackage.ACTION_BUTTON__EXECUTEPARAMETER: |
| if (resolve) return getExecuteparameter(); |
| return basicGetExecuteparameter(); |
| case ActionDSLPackage.ACTION_BUTTON__ACTION_TYPE: |
| return getActionType(); |
| case ActionDSLPackage.ACTION_BUTTON__MESSAGE: |
| if (resolve) return getMessage(); |
| return basicGetMessage(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case ActionDSLPackage.ACTION_BUTTON__DESCRIPTION: |
| setDescription((Boolean)newValue); |
| return; |
| case ActionDSLPackage.ACTION_BUTTON__DESCRIPTION_VALUE: |
| setDescriptionValue((String)newValue); |
| return; |
| case ActionDSLPackage.ACTION_BUTTON__ICON_URI: |
| setIconURI((String)newValue); |
| return; |
| case ActionDSLPackage.ACTION_BUTTON__GROUP: |
| setGroup((FunctionLibraryGroup)newValue); |
| return; |
| case ActionDSLPackage.ACTION_BUTTON__CANEXECUTE: |
| setCanexecute((FunctionLibraryFunction)newValue); |
| return; |
| case ActionDSLPackage.ACTION_BUTTON__EXECUTEPARAMETER: |
| setExecuteparameter((FunctionLibraryFunction)newValue); |
| return; |
| case ActionDSLPackage.ACTION_BUTTON__ACTION_TYPE: |
| setActionType((ActionType)newValue); |
| return; |
| case ActionDSLPackage.ACTION_BUTTON__MESSAGE: |
| setMessage((MessageItem)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case ActionDSLPackage.ACTION_BUTTON__DESCRIPTION: |
| setDescription(DESCRIPTION_EDEFAULT); |
| return; |
| case ActionDSLPackage.ACTION_BUTTON__DESCRIPTION_VALUE: |
| setDescriptionValue(DESCRIPTION_VALUE_EDEFAULT); |
| return; |
| case ActionDSLPackage.ACTION_BUTTON__ICON_URI: |
| setIconURI(ICON_URI_EDEFAULT); |
| return; |
| case ActionDSLPackage.ACTION_BUTTON__GROUP: |
| setGroup((FunctionLibraryGroup)null); |
| return; |
| case ActionDSLPackage.ACTION_BUTTON__CANEXECUTE: |
| setCanexecute((FunctionLibraryFunction)null); |
| return; |
| case ActionDSLPackage.ACTION_BUTTON__EXECUTEPARAMETER: |
| setExecuteparameter((FunctionLibraryFunction)null); |
| return; |
| case ActionDSLPackage.ACTION_BUTTON__ACTION_TYPE: |
| setActionType((ActionType)null); |
| return; |
| case ActionDSLPackage.ACTION_BUTTON__MESSAGE: |
| setMessage((MessageItem)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case ActionDSLPackage.ACTION_BUTTON__DESCRIPTION: |
| return description != DESCRIPTION_EDEFAULT; |
| case ActionDSLPackage.ACTION_BUTTON__DESCRIPTION_VALUE: |
| return DESCRIPTION_VALUE_EDEFAULT == null ? descriptionValue != null : !DESCRIPTION_VALUE_EDEFAULT.equals(descriptionValue); |
| case ActionDSLPackage.ACTION_BUTTON__ICON_URI: |
| return ICON_URI_EDEFAULT == null ? iconURI != null : !ICON_URI_EDEFAULT.equals(iconURI); |
| case ActionDSLPackage.ACTION_BUTTON__GROUP: |
| return group != null; |
| case ActionDSLPackage.ACTION_BUTTON__CANEXECUTE: |
| return canexecute != null; |
| case ActionDSLPackage.ACTION_BUTTON__EXECUTEPARAMETER: |
| return executeparameter != null; |
| case ActionDSLPackage.ACTION_BUTTON__ACTION_TYPE: |
| return actionType != null; |
| case ActionDSLPackage.ACTION_BUTTON__MESSAGE: |
| return message != null; |
| } |
| 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(" (description: "); |
| result.append(description); |
| result.append(", descriptionValue: "); |
| result.append(descriptionValue); |
| result.append(", iconURI: "); |
| result.append(iconURI); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //ActionButtonImpl |