/** | |
* ******************************************************************************* | |
* Copyright (c) 2008 Hatha Systems. | |
* 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: | |
* Nikolai Mansourov (Hatha Systems) - initial API and implementation | |
* ******************************************************************************* | |
* | |
* $Id$ | |
*/ | |
package org.eclipse.gmt.modisco.omg.kdm.ui.impl; | |
import org.eclipse.emf.common.notify.Notification; | |
import org.eclipse.emf.ecore.EClass; | |
import org.eclipse.emf.ecore.InternalEObject; | |
import org.eclipse.emf.ecore.impl.ENotificationImpl; | |
import org.eclipse.gmt.modisco.omg.kdm.core.impl.KDMRelationshipImpl; | |
import org.eclipse.gmt.modisco.omg.kdm.ui.UILayout; | |
import org.eclipse.gmt.modisco.omg.kdm.ui.UIResource; | |
import org.eclipse.gmt.modisco.omg.kdm.ui.UiPackage; | |
/** | |
* <!-- begin-user-doc --> | |
* An implementation of the model object '<em><b>UI Layout</b></em>'. | |
* <!-- end-user-doc --> | |
* <p> | |
* The following features are implemented: | |
* <ul> | |
* <li>{@link org.eclipse.gmt.modisco.omg.kdm.ui.impl.UILayoutImpl#getTo <em>To</em>}</li> | |
* <li>{@link org.eclipse.gmt.modisco.omg.kdm.ui.impl.UILayoutImpl#getFrom <em>From</em>}</li> | |
* </ul> | |
* </p> | |
* | |
* @generated | |
*/ | |
public class UILayoutImpl extends KDMRelationshipImpl implements UILayout { | |
/** | |
* The cached value of the '{@link #getTo() <em>To</em>}' reference. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getTo() | |
* @generated | |
* @ordered | |
*/ | |
protected UIResource to; | |
/** | |
* The cached value of the '{@link #getFrom() <em>From</em>}' reference. | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @see #getFrom() | |
* @generated | |
* @ordered | |
*/ | |
protected UIResource from; | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
protected UILayoutImpl() { | |
super(); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
protected EClass eStaticClass() { | |
return UiPackage.Literals.UI_LAYOUT; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public UIResource getTo() { | |
if (to != null && to.eIsProxy()) { | |
InternalEObject oldTo = (InternalEObject)to; | |
to = (UIResource)eResolveProxy(oldTo); | |
if (to != oldTo) { | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.RESOLVE, UiPackage.UI_LAYOUT__TO, oldTo, to)); | |
} | |
} | |
return to; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public UIResource basicGetTo() { | |
return to; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public void setTo(UIResource newTo) { | |
UIResource oldTo = to; | |
to = newTo; | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, UiPackage.UI_LAYOUT__TO, oldTo, to)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public UIResource getFrom() { | |
if (from != null && from.eIsProxy()) { | |
InternalEObject oldFrom = (InternalEObject)from; | |
from = (UIResource)eResolveProxy(oldFrom); | |
if (from != oldFrom) { | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.RESOLVE, UiPackage.UI_LAYOUT__FROM, oldFrom, from)); | |
} | |
} | |
return from; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public UIResource basicGetFrom() { | |
return from; | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
public void setFrom(UIResource newFrom) { | |
UIResource oldFrom = from; | |
from = newFrom; | |
if (eNotificationRequired()) | |
eNotify(new ENotificationImpl(this, Notification.SET, UiPackage.UI_LAYOUT__FROM, oldFrom, from)); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public Object eGet(int featureID, boolean resolve, boolean coreType) { | |
switch (featureID) { | |
case UiPackage.UI_LAYOUT__TO: | |
if (resolve) return getTo(); | |
return basicGetTo(); | |
case UiPackage.UI_LAYOUT__FROM: | |
if (resolve) return getFrom(); | |
return basicGetFrom(); | |
} | |
return super.eGet(featureID, resolve, coreType); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void eSet(int featureID, Object newValue) { | |
switch (featureID) { | |
case UiPackage.UI_LAYOUT__TO: | |
setTo((UIResource)newValue); | |
return; | |
case UiPackage.UI_LAYOUT__FROM: | |
setFrom((UIResource)newValue); | |
return; | |
} | |
super.eSet(featureID, newValue); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public void eUnset(int featureID) { | |
switch (featureID) { | |
case UiPackage.UI_LAYOUT__TO: | |
setTo((UIResource)null); | |
return; | |
case UiPackage.UI_LAYOUT__FROM: | |
setFrom((UIResource)null); | |
return; | |
} | |
super.eUnset(featureID); | |
} | |
/** | |
* <!-- begin-user-doc --> | |
* <!-- end-user-doc --> | |
* @generated | |
*/ | |
@Override | |
public boolean eIsSet(int featureID) { | |
switch (featureID) { | |
case UiPackage.UI_LAYOUT__TO: | |
return to != null; | |
case UiPackage.UI_LAYOUT__FROM: | |
return from != null; | |
} | |
return super.eIsSet(featureID); | |
} | |
} //UILayoutImpl |