blob: e5cbe8484d1dcbbff8fb5b15def6c1c8205be809 [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 v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Based on ideas from Xtext, Xtend, Xcore
*
* Contributors:
* Joerg Riegel - Initial implementation
*
*/
package org.eclipse.osbp.xtext.chart.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.osbp.xtext.chart.ChartDSLPackage;
import org.eclipse.osbp.xtext.chart.ChartTree;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Chart Tree</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.osbp.xtext.chart.impl.ChartTreeImpl#isMap <em>Map</em>}</li>
* <li>{@link org.eclipse.osbp.xtext.chart.impl.ChartTreeImpl#isCollapsible <em>Collapsible</em>}</li>
* </ul>
*
* @generated
*/
public class ChartTreeImpl extends ChartLazyResolverImpl implements ChartTree {
/**
* The default value of the '{@link #isMap() <em>Map</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isMap()
* @generated
* @ordered
*/
protected static final boolean MAP_EDEFAULT = false;
/**
* The cached value of the '{@link #isMap() <em>Map</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isMap()
* @generated
* @ordered
*/
protected boolean map = MAP_EDEFAULT;
/**
* The default value of the '{@link #isCollapsible() <em>Collapsible</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isCollapsible()
* @generated
* @ordered
*/
protected static final boolean COLLAPSIBLE_EDEFAULT = false;
/**
* The cached value of the '{@link #isCollapsible() <em>Collapsible</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isCollapsible()
* @generated
* @ordered
*/
protected boolean collapsible = COLLAPSIBLE_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ChartTreeImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return ChartDSLPackage.Literals.CHART_TREE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isMap() {
return map;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setMap(boolean newMap) {
boolean oldMap = map;
map = newMap;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ChartDSLPackage.CHART_TREE__MAP, oldMap, map));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isCollapsible() {
return collapsible;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setCollapsible(boolean newCollapsible) {
boolean oldCollapsible = collapsible;
collapsible = newCollapsible;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ChartDSLPackage.CHART_TREE__COLLAPSIBLE, oldCollapsible, collapsible));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case ChartDSLPackage.CHART_TREE__MAP:
return isMap();
case ChartDSLPackage.CHART_TREE__COLLAPSIBLE:
return isCollapsible();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case ChartDSLPackage.CHART_TREE__MAP:
setMap((Boolean)newValue);
return;
case ChartDSLPackage.CHART_TREE__COLLAPSIBLE:
setCollapsible((Boolean)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case ChartDSLPackage.CHART_TREE__MAP:
setMap(MAP_EDEFAULT);
return;
case ChartDSLPackage.CHART_TREE__COLLAPSIBLE:
setCollapsible(COLLAPSIBLE_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ChartDSLPackage.CHART_TREE__MAP:
return map != MAP_EDEFAULT;
case ChartDSLPackage.CHART_TREE__COLLAPSIBLE:
return collapsible != COLLAPSIBLE_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(" (map: ");
result.append(map);
result.append(", collapsible: ");
result.append(collapsible);
result.append(')');
return result.toString();
}
} //ChartTreeImpl