| /** |
| */ |
| package org.eclipse.emf.ecp.ecview.common.model.core.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.EObject; |
| import org.eclipse.emf.ecore.EStructuralFeature; |
| import org.eclipse.emf.ecore.InternalEObject; |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; |
| import org.eclipse.emf.ecp.ecview.common.model.binding.BindingFactory; |
| import org.eclipse.emf.ecp.ecview.common.model.binding.YECViewModelValueBindingEndpoint; |
| import org.eclipse.emf.ecp.ecview.common.model.core.CoreModelPackage; |
| import org.eclipse.emf.ecp.ecview.common.model.core.YDialog; |
| import org.eclipse.emf.ecp.ecview.common.model.core.YLayout; |
| import org.eclipse.emf.ecp.ecview.common.model.core.YOpenDialogCommand; |
| import org.eclipse.emf.ecp.ecview.common.model.core.YView; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>YOpen Dialog Command</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.emf.ecp.ecview.common.model.core.impl.YOpenDialogCommandImpl#getId <em>Id</em>}</li> |
| * <li>{@link org.eclipse.emf.ecp.ecview.common.model.core.impl.YOpenDialogCommandImpl#getName <em>Name</em>}</li> |
| * <li>{@link org.eclipse.emf.ecp.ecview.common.model.core.impl.YOpenDialogCommandImpl#getDialog <em>Dialog</em>}</li> |
| * <li>{@link org.eclipse.emf.ecp.ecview.common.model.core.impl.YOpenDialogCommandImpl#getTrigger <em>Trigger</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class YOpenDialogCommandImpl extends MinimalEObjectImpl.Container implements YOpenDialogCommand { |
| /** |
| * The default value of the '{@link #getId() <em>Id</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getId() |
| * @generated |
| * @ordered |
| */ |
| protected static final String ID_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getId() <em>Id</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getId() |
| * @generated |
| * @ordered |
| */ |
| protected String id = ID_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 cached value of the '{@link #getDialog() <em>Dialog</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getDialog() |
| * @generated |
| * @ordered |
| */ |
| protected YDialog dialog; |
| |
| /** |
| * The default value of the '{@link #getTrigger() <em>Trigger</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getTrigger() |
| * @generated |
| * @ordered |
| */ |
| protected static final Object TRIGGER_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getTrigger() <em>Trigger</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getTrigger() |
| * @generated |
| * @ordered |
| */ |
| protected Object trigger = TRIGGER_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected YOpenDialogCommandImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return CoreModelPackage.Literals.YOPEN_DIALOG_COMMAND; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getId() { |
| return id; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setId(String newId) { |
| String oldId = id; |
| id = newId; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, CoreModelPackage.YOPEN_DIALOG_COMMAND__ID, oldId, id)); |
| } |
| |
| /** |
| * <!-- 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, CoreModelPackage.YOPEN_DIALOG_COMMAND__NAME, oldName, name)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public YDialog getDialog() { |
| if (dialog != null && dialog.eIsProxy()) { |
| InternalEObject oldDialog = (InternalEObject)dialog; |
| dialog = (YDialog)eResolveProxy(oldDialog); |
| if (dialog != oldDialog) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, CoreModelPackage.YOPEN_DIALOG_COMMAND__DIALOG, oldDialog, dialog)); |
| } |
| } |
| return dialog; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public YDialog basicGetDialog() { |
| return dialog; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setDialog(YDialog newDialog) { |
| YDialog oldDialog = dialog; |
| dialog = newDialog; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, CoreModelPackage.YOPEN_DIALOG_COMMAND__DIALOG, oldDialog, dialog)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public Object getTrigger() { |
| return trigger; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setTrigger(Object newTrigger) { |
| Object oldTrigger = trigger; |
| trigger = newTrigger; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, CoreModelPackage.YOPEN_DIALOG_COMMAND__TRIGGER, oldTrigger, trigger)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * @generated |
| */ |
| public YView getViewGen() { |
| // TODO: implement this method |
| // Ensure that you remove @generated or mark it @generated NOT |
| throw new UnsupportedOperationException(); |
| } |
| |
| public YView getView() { |
| return findViewGeneric(eContainer()); |
| } |
| |
| protected YView findViewGeneric(EObject container) { |
| if (container == null) { |
| return null; |
| } |
| if (container instanceof YView) { |
| return (YView) container; |
| } else if (container instanceof YLayout) { |
| return ((YLayout) container).getView(); |
| } else { |
| EObject parent = container.eContainer(); |
| return findViewGeneric(parent); |
| } |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public YECViewModelValueBindingEndpoint createTriggerDialogEndpointGen() { |
| // TODO: implement this method |
| // Ensure that you remove @generated or mark it @generated NOT |
| throw new UnsupportedOperationException(); |
| } |
| |
| public YECViewModelValueBindingEndpoint createTriggerDialogEndpoint() { |
| YECViewModelValueBindingEndpoint endpoint = BindingFactory.eINSTANCE |
| .createYECViewModelValueBindingEndpoint(); |
| endpoint.setElement(this); |
| endpoint.getFeatures() |
| .add((EStructuralFeature) CoreModelPackage.Literals.YOPEN_DIALOG_COMMAND__TRIGGER); |
| return endpoint; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case CoreModelPackage.YOPEN_DIALOG_COMMAND__ID: |
| return getId(); |
| case CoreModelPackage.YOPEN_DIALOG_COMMAND__NAME: |
| return getName(); |
| case CoreModelPackage.YOPEN_DIALOG_COMMAND__DIALOG: |
| if (resolve) return getDialog(); |
| return basicGetDialog(); |
| case CoreModelPackage.YOPEN_DIALOG_COMMAND__TRIGGER: |
| return getTrigger(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case CoreModelPackage.YOPEN_DIALOG_COMMAND__ID: |
| setId((String)newValue); |
| return; |
| case CoreModelPackage.YOPEN_DIALOG_COMMAND__NAME: |
| setName((String)newValue); |
| return; |
| case CoreModelPackage.YOPEN_DIALOG_COMMAND__DIALOG: |
| setDialog((YDialog)newValue); |
| return; |
| case CoreModelPackage.YOPEN_DIALOG_COMMAND__TRIGGER: |
| setTrigger(newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case CoreModelPackage.YOPEN_DIALOG_COMMAND__ID: |
| setId(ID_EDEFAULT); |
| return; |
| case CoreModelPackage.YOPEN_DIALOG_COMMAND__NAME: |
| setName(NAME_EDEFAULT); |
| return; |
| case CoreModelPackage.YOPEN_DIALOG_COMMAND__DIALOG: |
| setDialog((YDialog)null); |
| return; |
| case CoreModelPackage.YOPEN_DIALOG_COMMAND__TRIGGER: |
| setTrigger(TRIGGER_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case CoreModelPackage.YOPEN_DIALOG_COMMAND__ID: |
| return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id); |
| case CoreModelPackage.YOPEN_DIALOG_COMMAND__NAME: |
| return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); |
| case CoreModelPackage.YOPEN_DIALOG_COMMAND__DIALOG: |
| return dialog != null; |
| case CoreModelPackage.YOPEN_DIALOG_COMMAND__TRIGGER: |
| return TRIGGER_EDEFAULT == null ? trigger != null : !TRIGGER_EDEFAULT.equals(trigger); |
| } |
| 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(" (id: "); |
| result.append(id); |
| result.append(", name: "); |
| result.append(name); |
| result.append(", trigger: "); |
| result.append(trigger); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //YOpenDialogCommandImpl |