/** * Copyright (c) 2008 Olivier Moises * * 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: * Olivier Moises- initial API and implementation */ package org.eclipse.wazaabi.mm.core.styles.collections.impl; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.wazaabi.mm.core.styles.collections.ColumnDescriptor; import org.eclipse.wazaabi.mm.core.styles.collections.CoreCollectionsStylesPackage; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Column Descriptor</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link org.eclipse.wazaabi.mm.core.styles.collections.impl.ColumnDescriptorImpl#getWidth <em>Width</em>}</li> * </ul> * </p> * * @generated */ public class ColumnDescriptorImpl extends AbstractColumnDescriptorImpl implements ColumnDescriptor { /** * The default value of the '{@link #getWidth() <em>Width</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getWidth() * @generated * @ordered */ protected static final int WIDTH_EDEFAULT = 20; /** * The cached value of the '{@link #getWidth() <em>Width</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getWidth() * @generated * @ordered */ protected int width = WIDTH_EDEFAULT; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected ColumnDescriptorImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return CoreCollectionsStylesPackage.Literals.COLUMN_DESCRIPTOR; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public int getWidth() { return width; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setWidth(int newWidth) { int oldWidth = width; width = newWidth; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, CoreCollectionsStylesPackage.COLUMN_DESCRIPTOR__WIDTH, oldWidth, width)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case CoreCollectionsStylesPackage.COLUMN_DESCRIPTOR__WIDTH: return getWidth(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case CoreCollectionsStylesPackage.COLUMN_DESCRIPTOR__WIDTH: setWidth((Integer)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case CoreCollectionsStylesPackage.COLUMN_DESCRIPTOR__WIDTH: setWidth(WIDTH_EDEFAULT); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case CoreCollectionsStylesPackage.COLUMN_DESCRIPTOR__WIDTH: return width != WIDTH_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(" (width: "); result.append(width); result.append(')'); return result.toString(); } } //ColumnDescriptorImpl