blob: 7a9a4cd908a68a48d604eb9b1c54afb9881ee9d9 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2011-2013 EclipseSource Muenchen GmbH and others.
*
* 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:
* EclipseSource Munich GmbH - initial API and implementation
******************************************************************************/
package org.eclipse.emf.ecp.view.spi.rule.model.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecp.view.spi.rule.model.EnableRule;
import org.eclipse.emf.ecp.view.spi.rule.model.RulePackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Enable Rule</b></em>'.
*
* @since 1.2
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.emf.ecp.view.spi.rule.model.impl.EnableRuleImpl#isDisable <em>Disable</em>}</li>
* </ul>
*
* @generated
*/
public class EnableRuleImpl extends RuleImpl implements EnableRule {
/**
* The default value of the '{@link #isDisable() <em>Disable</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @see #isDisable()
* @generated
* @ordered
*/
protected static final boolean DISABLE_EDEFAULT = false;
/**
* The cached value of the '{@link #isDisable() <em>Disable</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @see #isDisable()
* @generated
* @ordered
*/
protected boolean disable = DISABLE_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
protected EnableRuleImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return RulePackage.Literals.ENABLE_RULE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public boolean isDisable() {
return disable;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public void setDisable(boolean newDisable) {
final boolean oldDisable = disable;
disable = newDisable;
if (eNotificationRequired()) {
eNotify(
new ENotificationImpl(this, Notification.SET, RulePackage.ENABLE_RULE__DISABLE, oldDisable, disable));
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case RulePackage.ENABLE_RULE__DISABLE:
return isDisable();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case RulePackage.ENABLE_RULE__DISABLE:
setDisable((Boolean) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case RulePackage.ENABLE_RULE__DISABLE:
setDisable(DISABLE_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case RulePackage.ENABLE_RULE__DISABLE:
return disable != DISABLE_EDEFAULT;
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
*
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) {
return super.toString();
}
final StringBuffer result = new StringBuffer(super.toString());
result.append(" (disable: "); //$NON-NLS-1$
result.append(disable);
result.append(')');
return result.toString();
}
} // EnableRuleImpl