blob: c32815bda342cb71c75c6d275e0fe65006d98f27 [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
*/
package org.eclipse.osbp.infogrid.model.gridsource.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.emf.ecore.impl.MinimalEObjectImpl;
import org.eclipse.osbp.infogrid.model.gridsource.CxGridNestedField;
import org.eclipse.osbp.infogrid.model.gridsource.CxGridProperty;
import org.eclipse.osbp.infogrid.model.gridsource.CxGridSourcePackage;
import org.eclipse.osbp.infogrid.model.gridsource.style.CxGridPropStyle;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Cx Grid Property</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.osbp.infogrid.model.gridsource.impl.CxGridPropertyImpl#getPath <em>Path</em>}</li>
* <li>{@link org.eclipse.osbp.infogrid.model.gridsource.impl.CxGridPropertyImpl#getStyle <em>Style</em>}</li>
* <li>{@link org.eclipse.osbp.infogrid.model.gridsource.impl.CxGridPropertyImpl#getDotPath <em>Dot Path</em>}</li>
* <li>{@link org.eclipse.osbp.infogrid.model.gridsource.impl.CxGridPropertyImpl#isEditable <em>Editable</em>}</li>
* <li>{@link org.eclipse.osbp.infogrid.model.gridsource.impl.CxGridPropertyImpl#getSourceFQN <em>Source FQN</em>}</li>
* </ul>
*
* @generated
*/
public class CxGridPropertyImpl extends MinimalEObjectImpl.Container implements CxGridProperty {
/**
* The cached value of the '{@link #getPath() <em>Path</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getPath()
* @generated
* @ordered
*/
protected CxGridNestedField path;
/**
* The cached value of the '{@link #getStyle() <em>Style</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getStyle()
* @generated
* @ordered
*/
protected CxGridPropStyle style;
/**
* The default value of the '{@link #getDotPath() <em>Dot Path</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDotPath()
* @generated
* @ordered
*/
protected static final String DOT_PATH_EDEFAULT = null;
/**
* The cached value of the '{@link #getDotPath() <em>Dot Path</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getDotPath()
* @generated
* @ordered
*/
protected String dotPath = DOT_PATH_EDEFAULT;
/**
* The default value of the '{@link #isEditable() <em>Editable</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isEditable()
* @generated
* @ordered
*/
protected static final boolean EDITABLE_EDEFAULT = false;
/**
* The cached value of the '{@link #isEditable() <em>Editable</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isEditable()
* @generated
* @ordered
*/
protected boolean editable = EDITABLE_EDEFAULT;
/**
* The default value of the '{@link #getSourceFQN() <em>Source FQN</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getSourceFQN()
* @generated
* @ordered
*/
protected static final String SOURCE_FQN_EDEFAULT = null;
/**
* The cached value of the '{@link #getSourceFQN() <em>Source FQN</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getSourceFQN()
* @generated
* @ordered
*/
protected String sourceFQN = SOURCE_FQN_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected CxGridPropertyImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return CxGridSourcePackage.Literals.CX_GRID_PROPERTY;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public CxGridNestedField getPath() {
return path;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetPath(CxGridNestedField newPath, NotificationChain msgs) {
CxGridNestedField oldPath = path;
path = newPath;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, CxGridSourcePackage.CX_GRID_PROPERTY__PATH, oldPath, newPath);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setPath(CxGridNestedField newPath) {
if (newPath != path) {
NotificationChain msgs = null;
if (path != null)
msgs = ((InternalEObject)path).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - CxGridSourcePackage.CX_GRID_PROPERTY__PATH, null, msgs);
if (newPath != null)
msgs = ((InternalEObject)newPath).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - CxGridSourcePackage.CX_GRID_PROPERTY__PATH, null, msgs);
msgs = basicSetPath(newPath, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, CxGridSourcePackage.CX_GRID_PROPERTY__PATH, newPath, newPath));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public CxGridPropStyle getStyle() {
return style;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetStyle(CxGridPropStyle newStyle, NotificationChain msgs) {
CxGridPropStyle oldStyle = style;
style = newStyle;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, CxGridSourcePackage.CX_GRID_PROPERTY__STYLE, oldStyle, newStyle);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setStyle(CxGridPropStyle newStyle) {
if (newStyle != style) {
NotificationChain msgs = null;
if (style != null)
msgs = ((InternalEObject)style).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - CxGridSourcePackage.CX_GRID_PROPERTY__STYLE, null, msgs);
if (newStyle != null)
msgs = ((InternalEObject)newStyle).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - CxGridSourcePackage.CX_GRID_PROPERTY__STYLE, null, msgs);
msgs = basicSetStyle(newStyle, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, CxGridSourcePackage.CX_GRID_PROPERTY__STYLE, newStyle, newStyle));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getDotPath() {
return dotPath;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setDotPath(String newDotPath) {
String oldDotPath = dotPath;
dotPath = newDotPath;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, CxGridSourcePackage.CX_GRID_PROPERTY__DOT_PATH, oldDotPath, dotPath));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isEditable() {
return editable;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setEditable(boolean newEditable) {
boolean oldEditable = editable;
editable = newEditable;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, CxGridSourcePackage.CX_GRID_PROPERTY__EDITABLE, oldEditable, editable));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public String getSourceFQN() {
return sourceFQN;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setSourceFQN(String newSourceFQN) {
String oldSourceFQN = sourceFQN;
sourceFQN = newSourceFQN;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, CxGridSourcePackage.CX_GRID_PROPERTY__SOURCE_FQN, oldSourceFQN, sourceFQN));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case CxGridSourcePackage.CX_GRID_PROPERTY__PATH:
return basicSetPath(null, msgs);
case CxGridSourcePackage.CX_GRID_PROPERTY__STYLE:
return basicSetStyle(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 CxGridSourcePackage.CX_GRID_PROPERTY__PATH:
return getPath();
case CxGridSourcePackage.CX_GRID_PROPERTY__STYLE:
return getStyle();
case CxGridSourcePackage.CX_GRID_PROPERTY__DOT_PATH:
return getDotPath();
case CxGridSourcePackage.CX_GRID_PROPERTY__EDITABLE:
return isEditable();
case CxGridSourcePackage.CX_GRID_PROPERTY__SOURCE_FQN:
return getSourceFQN();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case CxGridSourcePackage.CX_GRID_PROPERTY__PATH:
setPath((CxGridNestedField)newValue);
return;
case CxGridSourcePackage.CX_GRID_PROPERTY__STYLE:
setStyle((CxGridPropStyle)newValue);
return;
case CxGridSourcePackage.CX_GRID_PROPERTY__DOT_PATH:
setDotPath((String)newValue);
return;
case CxGridSourcePackage.CX_GRID_PROPERTY__EDITABLE:
setEditable((Boolean)newValue);
return;
case CxGridSourcePackage.CX_GRID_PROPERTY__SOURCE_FQN:
setSourceFQN((String)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case CxGridSourcePackage.CX_GRID_PROPERTY__PATH:
setPath((CxGridNestedField)null);
return;
case CxGridSourcePackage.CX_GRID_PROPERTY__STYLE:
setStyle((CxGridPropStyle)null);
return;
case CxGridSourcePackage.CX_GRID_PROPERTY__DOT_PATH:
setDotPath(DOT_PATH_EDEFAULT);
return;
case CxGridSourcePackage.CX_GRID_PROPERTY__EDITABLE:
setEditable(EDITABLE_EDEFAULT);
return;
case CxGridSourcePackage.CX_GRID_PROPERTY__SOURCE_FQN:
setSourceFQN(SOURCE_FQN_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case CxGridSourcePackage.CX_GRID_PROPERTY__PATH:
return path != null;
case CxGridSourcePackage.CX_GRID_PROPERTY__STYLE:
return style != null;
case CxGridSourcePackage.CX_GRID_PROPERTY__DOT_PATH:
return DOT_PATH_EDEFAULT == null ? dotPath != null : !DOT_PATH_EDEFAULT.equals(dotPath);
case CxGridSourcePackage.CX_GRID_PROPERTY__EDITABLE:
return editable != EDITABLE_EDEFAULT;
case CxGridSourcePackage.CX_GRID_PROPERTY__SOURCE_FQN:
return SOURCE_FQN_EDEFAULT == null ? sourceFQN != null : !SOURCE_FQN_EDEFAULT.equals(sourceFQN);
}
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(" (dotPath: ");
result.append(dotPath);
result.append(", editable: ");
result.append(editable);
result.append(", sourceFQN: ");
result.append(sourceFQN);
result.append(')');
return result.toString();
}
} //CxGridPropertyImpl