/** * 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.Orientation; import org.eclipse.wazaabi.mm.core.styles.CoreStylesPackage; import org.eclipse.wazaabi.mm.core.styles.SashFormLayoutRule; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Sash Form Layout Rule</b></em>'. * <!-- end-user-doc --> * <p> * The following features are implemented: * <ul> * <li>{@link org.eclipse.wazaabi.mm.core.styles.impl.SashFormLayoutRuleImpl#getOrientation <em>Orientation</em>}</li> * </ul> * </p> * * @generated */ public class SashFormLayoutRuleImpl extends LayoutRuleImpl implements SashFormLayoutRule { /** * The default value of the '{@link #getOrientation() <em>Orientation</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getOrientation() * @generated * @ordered */ protected static final Orientation ORIENTATION_EDEFAULT = Orientation.VERTICAL; /** * The cached value of the '{@link #getOrientation() <em>Orientation</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @see #getOrientation() * @generated * @ordered */ protected Orientation orientation = ORIENTATION_EDEFAULT; /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected SashFormLayoutRuleImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return CoreStylesPackage.Literals.SASH_FORM_LAYOUT_RULE; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Orientation getOrientation() { return orientation; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setOrientation(Orientation newOrientation) { Orientation oldOrientation = orientation; orientation = newOrientation == null ? ORIENTATION_EDEFAULT : newOrientation; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, CoreStylesPackage.SASH_FORM_LAYOUT_RULE__ORIENTATION, oldOrientation, orientation)); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { case CoreStylesPackage.SASH_FORM_LAYOUT_RULE__ORIENTATION: return getOrientation(); } 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_FORM_LAYOUT_RULE__ORIENTATION: setOrientation((Orientation)newValue); return; } super.eSet(featureID, newValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public void eUnset(int featureID) { switch (featureID) { case CoreStylesPackage.SASH_FORM_LAYOUT_RULE__ORIENTATION: setOrientation(ORIENTATION_EDEFAULT); return; } super.eUnset(featureID); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean eIsSet(int featureID) { switch (featureID) { case CoreStylesPackage.SASH_FORM_LAYOUT_RULE__ORIENTATION: return orientation != ORIENTATION_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(" (orientation: "); result.append(orientation); result.append(')'); return result.toString(); } } //SashFormLayoutRuleImpl