blob: df89222826b1075b59a081c1114356d423e9ed1d [file] [log] [blame]
/**
* 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
*
* 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.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.ActionCommand;
import org.eclipse.osbp.xtext.action.ActionDSLPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Action Button</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <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#getCommand <em>Command</em>}</li>
* </ul>
*
* @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 #getCommand() <em>Command</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getCommand()
* @generated
* @ordered
*/
protected ActionCommand command;
/**
* <!-- 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 ActionCommand getCommand() {
if (command != null && command.eIsProxy()) {
InternalEObject oldCommand = (InternalEObject)command;
command = (ActionCommand)eResolveProxy(oldCommand);
if (command != oldCommand) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, ActionDSLPackage.ACTION_BUTTON__COMMAND, oldCommand, command));
}
}
return command;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ActionCommand basicGetCommand() {
return command;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setCommand(ActionCommand newCommand) {
ActionCommand oldCommand = command;
command = newCommand;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ActionDSLPackage.ACTION_BUTTON__COMMAND, oldCommand, command));
}
/**
* <!-- 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__COMMAND:
if (resolve) return getCommand();
return basicGetCommand();
}
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__COMMAND:
setCommand((ActionCommand)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__COMMAND:
setCommand((ActionCommand)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__COMMAND:
return command != 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