/******************************************************************************* * Copyright (c) 2006-2012 * Software Technology Group, Dresden University of Technology * DevBoost GmbH, Berlin, Amtsgericht Charlottenburg, HRB 140026 * * 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: * Software Technology Group - TU Dresden, Germany; * DevBoost GmbH - Berlin, Germany * - initial API and implementation ******************************************************************************/ /** * <copyright> * </copyright> * * $Id$ */ package org.oasisopen.names.tc.opendocument.xmlns.form.impl; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.impl.EObjectImpl; import org.eclipse.emf.ecore.util.BasicFeatureMap; import org.eclipse.emf.ecore.util.FeatureMap; import org.eclipse.emf.ecore.util.InternalEList; import org.oasisopen.names.tc.opendocument.xmlns.form.ColumnType; import org.oasisopen.names.tc.opendocument.xmlns.form.FormPackage; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Column Type</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link org.oasisopen.names.tc.opendocument.xmlns.form.impl.ColumnTypeImpl#getColumnControlsGroup <em>Column Controls Group</em>}</li> * <li>{@link org.oasisopen.names.tc.opendocument.xmlns.form.impl.ColumnTypeImpl#getColumnControls <em>Column Controls</em>}</li> * <li>{@link org.oasisopen.names.tc.opendocument.xmlns.form.impl.ColumnTypeImpl#getControlImplementation <em>Control Implementation</em>}</li> * <li>{@link org.oasisopen.names.tc.opendocument.xmlns.form.impl.ColumnTypeImpl#getLabel <em>Label</em>}</li> * <li>{@link org.oasisopen.names.tc.opendocument.xmlns.form.impl.ColumnTypeImpl#getName <em>Name</em>}</li> * <li>{@link org.oasisopen.names.tc.opendocument.xmlns.form.impl.ColumnTypeImpl#getTextStyleName <em>Text Style Name</em>}</li> * </ul> * </p> * * @generated */ public class ColumnTypeImpl extends EObjectImpl implements ColumnType { /** * The cached value of the '{@link #getColumnControlsGroup() <em>Column Controls Group</em>}' attribute list. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getColumnControlsGroup() * @generated * @ordered */ protected FeatureMap columnControlsGroup; /** * The default value of the '{@link #getControlImplementation() <em>Control Implementation</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getControlImplementation() * @generated * @ordered */ protected static final String CONTROL_IMPLEMENTATION_EDEFAULT = null; /** * The cached value of the '{@link #getControlImplementation() <em>Control Implementation</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getControlImplementation() * @generated * @ordered */ protected String controlImplementation = CONTROL_IMPLEMENTATION_EDEFAULT; /** * The default value of the '{@link #getLabel() <em>Label</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getLabel() * @generated * @ordered */ protected static final String LABEL_EDEFAULT = null; /** * The cached value of the '{@link #getLabel() <em>Label</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getLabel() * @generated * @ordered */ protected String label = LABEL_EDEFAULT; /** * The default value of the '{@link #getName() <em>Name</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getName() * @generated * @ordered */ protected static final String NAME_EDEFAULT = null; /** * The cached value of the '{@link #getName() <em>Name</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getName() * @generated * @ordered */ protected String name = NAME_EDEFAULT; /** * The default value of the '{@link #getTextStyleName() <em>Text Style Name</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getTextStyleName() * @generated * @ordered */ protected static final String TEXT_STYLE_NAME_EDEFAULT = null; /** * The cached value of the '{@link #getTextStyleName() <em>Text Style Name</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getTextStyleName() * @generated * @ordered */ protected String textStyleName = TEXT_STYLE_NAME_EDEFAULT; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected ColumnTypeImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return FormPackage.eINSTANCE.getColumnType(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public FeatureMap getColumnControlsGroup() { if (columnControlsGroup == null) { columnControlsGroup = new BasicFeatureMap(this, FormPackage.COLUMN_TYPE__COLUMN_CONTROLS_GROUP); } return columnControlsGroup; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EList<EObject> getColumnControls() { return getColumnControlsGroup().list(FormPackage.eINSTANCE.getColumnType_ColumnControls()); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getControlImplementation() { return controlImplementation; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setControlImplementation(String newControlImplementation) { String oldControlImplementation = controlImplementation; controlImplementation = newControlImplementation; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, FormPackage.COLUMN_TYPE__CONTROL_IMPLEMENTATION, oldControlImplementation, controlImplementation)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getLabel() { return label; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setLabel(String newLabel) { String oldLabel = label; label = newLabel; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, FormPackage.COLUMN_TYPE__LABEL, oldLabel, label)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getName() { return name; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setName(String newName) { String oldName = name; name = newName; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, FormPackage.COLUMN_TYPE__NAME, oldName, name)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String getTextStyleName() { return textStyleName; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setTextStyleName(String newTextStyleName) { String oldTextStyleName = textStyleName; textStyleName = newTextStyleName; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, FormPackage.COLUMN_TYPE__TEXT_STYLE_NAME, oldTextStyleName, textStyleName)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { switch (featureID) { case FormPackage.COLUMN_TYPE__COLUMN_CONTROLS_GROUP: return ((InternalEList<?>)getColumnControlsGroup()).basicRemove(otherEnd, msgs); case FormPackage.COLUMN_TYPE__COLUMN_CONTROLS: return ((InternalEList<?>)getColumnControls()).basicRemove(otherEnd, 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 FormPackage.COLUMN_TYPE__COLUMN_CONTROLS_GROUP: if (coreType) return getColumnControlsGroup(); return ((FeatureMap.Internal)getColumnControlsGroup()).getWrapper(); case FormPackage.COLUMN_TYPE__COLUMN_CONTROLS: return getColumnControls(); case FormPackage.COLUMN_TYPE__CONTROL_IMPLEMENTATION: return getControlImplementation(); case FormPackage.COLUMN_TYPE__LABEL: return getLabel(); case FormPackage.COLUMN_TYPE__NAME: return getName(); case FormPackage.COLUMN_TYPE__TEXT_STYLE_NAME: return getTextStyleName(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case FormPackage.COLUMN_TYPE__COLUMN_CONTROLS_GROUP: ((FeatureMap.Internal)getColumnControlsGroup()).set(newValue); return; case FormPackage.COLUMN_TYPE__CONTROL_IMPLEMENTATION: setControlImplementation((String)newValue); return; case FormPackage.COLUMN_TYPE__LABEL: setLabel((String)newValue); return; case FormPackage.COLUMN_TYPE__NAME: setName((String)newValue); return; case FormPackage.COLUMN_TYPE__TEXT_STYLE_NAME: setTextStyleName((String)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case FormPackage.COLUMN_TYPE__COLUMN_CONTROLS_GROUP: getColumnControlsGroup().clear(); return; case FormPackage.COLUMN_TYPE__CONTROL_IMPLEMENTATION: setControlImplementation(CONTROL_IMPLEMENTATION_EDEFAULT); return; case FormPackage.COLUMN_TYPE__LABEL: setLabel(LABEL_EDEFAULT); return; case FormPackage.COLUMN_TYPE__NAME: setName(NAME_EDEFAULT); return; case FormPackage.COLUMN_TYPE__TEXT_STYLE_NAME: setTextStyleName(TEXT_STYLE_NAME_EDEFAULT); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case FormPackage.COLUMN_TYPE__COLUMN_CONTROLS_GROUP: return columnControlsGroup != null && !columnControlsGroup.isEmpty(); case FormPackage.COLUMN_TYPE__COLUMN_CONTROLS: return !getColumnControls().isEmpty(); case FormPackage.COLUMN_TYPE__CONTROL_IMPLEMENTATION: return CONTROL_IMPLEMENTATION_EDEFAULT == null ? controlImplementation != null : !CONTROL_IMPLEMENTATION_EDEFAULT.equals(controlImplementation); case FormPackage.COLUMN_TYPE__LABEL: return LABEL_EDEFAULT == null ? label != null : !LABEL_EDEFAULT.equals(label); case FormPackage.COLUMN_TYPE__NAME: return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); case FormPackage.COLUMN_TYPE__TEXT_STYLE_NAME: return TEXT_STYLE_NAME_EDEFAULT == null ? textStyleName != null : !TEXT_STYLE_NAME_EDEFAULT.equals(textStyleName); } 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(" (columnControlsGroup: "); result.append(columnControlsGroup); result.append(", controlImplementation: "); result.append(controlImplementation); result.append(", label: "); result.append(label); result.append(", name: "); result.append(name); result.append(", textStyleName: "); result.append(textStyleName); result.append(')'); return result.toString(); } } //ColumnTypeImpl