/** * 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.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.CoreStylesPackage; import org.eclipse.wazaabi.mm.core.styles.SashRule; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Sash Rule</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link org.eclipse.wazaabi.mm.core.styles.impl.SashRuleImpl#getWeight <em>Weight</em>}</li> * </ul> * </p> * * @generated */ public class SashRuleImpl extends LayoutDataRuleImpl implements SashRule { /** * The default value of the '{@link #getWeight() <em>Weight</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getWeight() * @generated * @ordered */ protected static final int WEIGHT_EDEFAULT = 0; /** * The cached value of the '{@link #getWeight() <em>Weight</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getWeight() * @generated * @ordered */ protected int weight = WEIGHT_EDEFAULT; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected SashRuleImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return CoreStylesPackage.Literals.SASH_RULE; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public int getWeight() { return weight; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setWeight(int newWeight) { int oldWeight = weight; weight = newWeight; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, CoreStylesPackage.SASH_RULE__WEIGHT, oldWeight, weight)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case CoreStylesPackage.SASH_RULE__WEIGHT: return getWeight(); } return super.eGet(featureID, resolve, coreType); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case CoreStylesPackage.SASH_RULE__WEIGHT: setWeight((Integer)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case CoreStylesPackage.SASH_RULE__WEIGHT: setWeight(WEIGHT_EDEFAULT); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case CoreStylesPackage.SASH_RULE__WEIGHT: return weight != WEIGHT_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(" (weight: "); result.append(weight); result.append(')'); return result.toString(); } } //SashRuleImpl