| /** |
| * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (Heidelberg) |
| * 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 |
| * |
| * Based on ideas from Xtext, Xtend, Xcore |
| * |
| * Contributors: |
| * Joerg Riegel - Initial implementation |
| * |
| */ |
| package org.eclipse.osbp.xtext.dialogdsl.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.osbp.dsl.semantic.dto.LDto; |
| |
| import org.eclipse.osbp.ecview.semantic.uimodel.UiView; |
| |
| import org.eclipse.osbp.xtext.action.ActionToolbar; |
| |
| import org.eclipse.osbp.xtext.dialogdsl.Dialog; |
| import org.eclipse.osbp.xtext.dialogdsl.DialogDSLPackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Dialog</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.osbp.xtext.dialogdsl.impl.DialogImpl#isDescription <em>Description</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.dialogdsl.impl.DialogImpl#getDescriptionValue <em>Description Value</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.dialogdsl.impl.DialogImpl#getUiView <em>Ui View</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.dialogdsl.impl.DialogImpl#getToolbar <em>Toolbar</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.dialogdsl.impl.DialogImpl#isEmbedded <em>Embedded</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.dialogdsl.impl.DialogImpl#isStateful <em>Stateful</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.dialogdsl.impl.DialogImpl#isAutowire <em>Autowire</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.dialogdsl.impl.DialogImpl#getDto <em>Dto</em>}</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class DialogImpl extends DialogBaseImpl implements Dialog { |
| /** |
| * The default value of the '{@link #isDescription() <em>Description</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isDescription() |
| * @generated |
| * @ordered |
| */ |
| protected static final boolean DESCRIPTION_EDEFAULT = false; |
| |
| /** |
| * The cached value of the '{@link #isDescription() <em>Description</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isDescription() |
| * @generated |
| * @ordered |
| */ |
| protected boolean description = DESCRIPTION_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getDescriptionValue() <em>Description Value</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getDescriptionValue() |
| * @generated |
| * @ordered |
| */ |
| protected static final String DESCRIPTION_VALUE_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getDescriptionValue() <em>Description Value</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getDescriptionValue() |
| * @generated |
| * @ordered |
| */ |
| protected String descriptionValue = DESCRIPTION_VALUE_EDEFAULT; |
| |
| /** |
| * The cached value of the '{@link #getUiView() <em>Ui View</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getUiView() |
| * @generated |
| * @ordered |
| */ |
| protected UiView uiView; |
| |
| /** |
| * The cached value of the '{@link #getToolbar() <em>Toolbar</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getToolbar() |
| * @generated |
| * @ordered |
| */ |
| protected ActionToolbar toolbar; |
| |
| /** |
| * The default value of the '{@link #isEmbedded() <em>Embedded</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isEmbedded() |
| * @generated |
| * @ordered |
| */ |
| protected static final boolean EMBEDDED_EDEFAULT = false; |
| |
| /** |
| * The cached value of the '{@link #isEmbedded() <em>Embedded</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isEmbedded() |
| * @generated |
| * @ordered |
| */ |
| protected boolean embedded = EMBEDDED_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #isStateful() <em>Stateful</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isStateful() |
| * @generated |
| * @ordered |
| */ |
| protected static final boolean STATEFUL_EDEFAULT = false; |
| |
| /** |
| * The cached value of the '{@link #isStateful() <em>Stateful</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isStateful() |
| * @generated |
| * @ordered |
| */ |
| protected boolean stateful = STATEFUL_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #isAutowire() <em>Autowire</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isAutowire() |
| * @generated |
| * @ordered |
| */ |
| protected static final boolean AUTOWIRE_EDEFAULT = false; |
| |
| /** |
| * The cached value of the '{@link #isAutowire() <em>Autowire</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isAutowire() |
| * @generated |
| * @ordered |
| */ |
| protected boolean autowire = AUTOWIRE_EDEFAULT; |
| |
| /** |
| * The cached value of the '{@link #getDto() <em>Dto</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getDto() |
| * @generated |
| * @ordered |
| */ |
| protected LDto dto; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected DialogImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return DialogDSLPackage.Literals.DIALOG; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean isDescription() { |
| return description; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setDescription(boolean newDescription) { |
| boolean oldDescription = description; |
| description = newDescription; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, DialogDSLPackage.DIALOG__DESCRIPTION, oldDescription, description)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getDescriptionValue() { |
| return descriptionValue; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setDescriptionValue(String newDescriptionValue) { |
| String oldDescriptionValue = descriptionValue; |
| descriptionValue = newDescriptionValue; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, DialogDSLPackage.DIALOG__DESCRIPTION_VALUE, oldDescriptionValue, descriptionValue)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public UiView getUiView() { |
| if (uiView != null && uiView.eIsProxy()) { |
| InternalEObject oldUiView = (InternalEObject)uiView; |
| uiView = (UiView)eResolveProxy(oldUiView); |
| if (uiView != oldUiView) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, DialogDSLPackage.DIALOG__UI_VIEW, oldUiView, uiView)); |
| } |
| } |
| return uiView; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public UiView basicGetUiView() { |
| return uiView; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setUiView(UiView newUiView) { |
| UiView oldUiView = uiView; |
| uiView = newUiView; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, DialogDSLPackage.DIALOG__UI_VIEW, oldUiView, uiView)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public ActionToolbar getToolbar() { |
| if (toolbar != null && toolbar.eIsProxy()) { |
| InternalEObject oldToolbar = (InternalEObject)toolbar; |
| toolbar = (ActionToolbar)eResolveProxy(oldToolbar); |
| if (toolbar != oldToolbar) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, DialogDSLPackage.DIALOG__TOOLBAR, oldToolbar, toolbar)); |
| } |
| } |
| return toolbar; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public ActionToolbar basicGetToolbar() { |
| return toolbar; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setToolbar(ActionToolbar newToolbar) { |
| ActionToolbar oldToolbar = toolbar; |
| toolbar = newToolbar; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, DialogDSLPackage.DIALOG__TOOLBAR, oldToolbar, toolbar)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean isEmbedded() { |
| return embedded; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setEmbedded(boolean newEmbedded) { |
| boolean oldEmbedded = embedded; |
| embedded = newEmbedded; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, DialogDSLPackage.DIALOG__EMBEDDED, oldEmbedded, embedded)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean isStateful() { |
| return stateful; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setStateful(boolean newStateful) { |
| boolean oldStateful = stateful; |
| stateful = newStateful; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, DialogDSLPackage.DIALOG__STATEFUL, oldStateful, stateful)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean isAutowire() { |
| return autowire; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setAutowire(boolean newAutowire) { |
| boolean oldAutowire = autowire; |
| autowire = newAutowire; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, DialogDSLPackage.DIALOG__AUTOWIRE, oldAutowire, autowire)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public LDto getDto() { |
| if (dto != null && dto.eIsProxy()) { |
| InternalEObject oldDto = (InternalEObject)dto; |
| dto = (LDto)eResolveProxy(oldDto); |
| if (dto != oldDto) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, DialogDSLPackage.DIALOG__DTO, oldDto, dto)); |
| } |
| } |
| return dto; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public LDto basicGetDto() { |
| return dto; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setDto(LDto newDto) { |
| LDto oldDto = dto; |
| dto = newDto; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, DialogDSLPackage.DIALOG__DTO, oldDto, dto)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case DialogDSLPackage.DIALOG__DESCRIPTION: |
| return isDescription(); |
| case DialogDSLPackage.DIALOG__DESCRIPTION_VALUE: |
| return getDescriptionValue(); |
| case DialogDSLPackage.DIALOG__UI_VIEW: |
| if (resolve) return getUiView(); |
| return basicGetUiView(); |
| case DialogDSLPackage.DIALOG__TOOLBAR: |
| if (resolve) return getToolbar(); |
| return basicGetToolbar(); |
| case DialogDSLPackage.DIALOG__EMBEDDED: |
| return isEmbedded(); |
| case DialogDSLPackage.DIALOG__STATEFUL: |
| return isStateful(); |
| case DialogDSLPackage.DIALOG__AUTOWIRE: |
| return isAutowire(); |
| case DialogDSLPackage.DIALOG__DTO: |
| if (resolve) return getDto(); |
| return basicGetDto(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case DialogDSLPackage.DIALOG__DESCRIPTION: |
| setDescription((Boolean)newValue); |
| return; |
| case DialogDSLPackage.DIALOG__DESCRIPTION_VALUE: |
| setDescriptionValue((String)newValue); |
| return; |
| case DialogDSLPackage.DIALOG__UI_VIEW: |
| setUiView((UiView)newValue); |
| return; |
| case DialogDSLPackage.DIALOG__TOOLBAR: |
| setToolbar((ActionToolbar)newValue); |
| return; |
| case DialogDSLPackage.DIALOG__EMBEDDED: |
| setEmbedded((Boolean)newValue); |
| return; |
| case DialogDSLPackage.DIALOG__STATEFUL: |
| setStateful((Boolean)newValue); |
| return; |
| case DialogDSLPackage.DIALOG__AUTOWIRE: |
| setAutowire((Boolean)newValue); |
| return; |
| case DialogDSLPackage.DIALOG__DTO: |
| setDto((LDto)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case DialogDSLPackage.DIALOG__DESCRIPTION: |
| setDescription(DESCRIPTION_EDEFAULT); |
| return; |
| case DialogDSLPackage.DIALOG__DESCRIPTION_VALUE: |
| setDescriptionValue(DESCRIPTION_VALUE_EDEFAULT); |
| return; |
| case DialogDSLPackage.DIALOG__UI_VIEW: |
| setUiView((UiView)null); |
| return; |
| case DialogDSLPackage.DIALOG__TOOLBAR: |
| setToolbar((ActionToolbar)null); |
| return; |
| case DialogDSLPackage.DIALOG__EMBEDDED: |
| setEmbedded(EMBEDDED_EDEFAULT); |
| return; |
| case DialogDSLPackage.DIALOG__STATEFUL: |
| setStateful(STATEFUL_EDEFAULT); |
| return; |
| case DialogDSLPackage.DIALOG__AUTOWIRE: |
| setAutowire(AUTOWIRE_EDEFAULT); |
| return; |
| case DialogDSLPackage.DIALOG__DTO: |
| setDto((LDto)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case DialogDSLPackage.DIALOG__DESCRIPTION: |
| return description != DESCRIPTION_EDEFAULT; |
| case DialogDSLPackage.DIALOG__DESCRIPTION_VALUE: |
| return DESCRIPTION_VALUE_EDEFAULT == null ? descriptionValue != null : !DESCRIPTION_VALUE_EDEFAULT.equals(descriptionValue); |
| case DialogDSLPackage.DIALOG__UI_VIEW: |
| return uiView != null; |
| case DialogDSLPackage.DIALOG__TOOLBAR: |
| return toolbar != null; |
| case DialogDSLPackage.DIALOG__EMBEDDED: |
| return embedded != EMBEDDED_EDEFAULT; |
| case DialogDSLPackage.DIALOG__STATEFUL: |
| return stateful != STATEFUL_EDEFAULT; |
| case DialogDSLPackage.DIALOG__AUTOWIRE: |
| return autowire != AUTOWIRE_EDEFAULT; |
| case DialogDSLPackage.DIALOG__DTO: |
| return dto != null; |
| } |
| 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(" (description: "); |
| result.append(description); |
| result.append(", descriptionValue: "); |
| result.append(descriptionValue); |
| result.append(", embedded: "); |
| result.append(embedded); |
| result.append(", stateful: "); |
| result.append(stateful); |
| result.append(", autowire: "); |
| result.append(autowire); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //DialogImpl |