| /** |
| * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) |
| * 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{ |
| * Christophe Loetz (Loetz GmbH&Co.KG) - Initial implementation |
| * |
| */ |
| package org.eclipse.osbp.xtext.perspective.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| import org.eclipse.emf.common.notify.NotificationChain; |
| |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.InternalEObject; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| import org.eclipse.osbp.xtext.perspective.PerspectiveDslPackage; |
| import org.eclipse.osbp.xtext.perspective.PerspectivePart; |
| import org.eclipse.osbp.xtext.perspective.PerspectiveView; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Perspective Part</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.osbp.xtext.perspective.impl.PerspectivePartImpl#isDescription <em>Description</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.perspective.impl.PerspectivePartImpl#getDescriptionValue <em>Description Value</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.perspective.impl.PerspectivePartImpl#getIconURI <em>Icon URI</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.perspective.impl.PerspectivePartImpl#getView <em>View</em>}</li> |
| * <li>{@link org.eclipse.osbp.xtext.perspective.impl.PerspectivePartImpl#isIsClosable <em>Is Closable</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class PerspectivePartImpl extends PerspectiveElementImpl implements PerspectivePart { |
| /** |
| * 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 default value of the '{@link #getIconURI() <em>Icon URI</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getIconURI() |
| * @generated |
| * @ordered |
| */ |
| protected static final String ICON_URI_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getIconURI() <em>Icon URI</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getIconURI() |
| * @generated |
| * @ordered |
| */ |
| protected String iconURI = ICON_URI_EDEFAULT; |
| |
| /** |
| * The cached value of the '{@link #getView() <em>View</em>}' containment reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getView() |
| * @generated |
| * @ordered |
| */ |
| protected PerspectiveView view; |
| |
| /** |
| * The default value of the '{@link #isIsClosable() <em>Is Closable</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isIsClosable() |
| * @generated |
| * @ordered |
| */ |
| protected static final boolean IS_CLOSABLE_EDEFAULT = false; |
| |
| /** |
| * The cached value of the '{@link #isIsClosable() <em>Is Closable</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isIsClosable() |
| * @generated |
| * @ordered |
| */ |
| protected boolean isClosable = IS_CLOSABLE_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected PerspectivePartImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return PerspectiveDslPackage.Literals.PERSPECTIVE_PART; |
| } |
| |
| /** |
| * <!-- 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, PerspectiveDslPackage.PERSPECTIVE_PART__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, PerspectiveDslPackage.PERSPECTIVE_PART__DESCRIPTION_VALUE, oldDescriptionValue, descriptionValue)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getIconURI() { |
| return iconURI; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setIconURI(String newIconURI) { |
| String oldIconURI = iconURI; |
| iconURI = newIconURI; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, PerspectiveDslPackage.PERSPECTIVE_PART__ICON_URI, oldIconURI, iconURI)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public PerspectiveView getView() { |
| return view; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public NotificationChain basicSetView(PerspectiveView newView, NotificationChain msgs) { |
| PerspectiveView oldView = view; |
| view = newView; |
| if (eNotificationRequired()) { |
| ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, PerspectiveDslPackage.PERSPECTIVE_PART__VIEW, oldView, newView); |
| if (msgs == null) msgs = notification; else msgs.add(notification); |
| } |
| return msgs; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setView(PerspectiveView newView) { |
| if (newView != view) { |
| NotificationChain msgs = null; |
| if (view != null) |
| msgs = ((InternalEObject)view).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - PerspectiveDslPackage.PERSPECTIVE_PART__VIEW, null, msgs); |
| if (newView != null) |
| msgs = ((InternalEObject)newView).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - PerspectiveDslPackage.PERSPECTIVE_PART__VIEW, null, msgs); |
| msgs = basicSetView(newView, msgs); |
| if (msgs != null) msgs.dispatch(); |
| } |
| else if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, PerspectiveDslPackage.PERSPECTIVE_PART__VIEW, newView, newView)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean isIsClosable() { |
| return isClosable; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setIsClosable(boolean newIsClosable) { |
| boolean oldIsClosable = isClosable; |
| isClosable = newIsClosable; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, PerspectiveDslPackage.PERSPECTIVE_PART__IS_CLOSABLE, oldIsClosable, isClosable)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case PerspectiveDslPackage.PERSPECTIVE_PART__VIEW: |
| return basicSetView(null, msgs); |
| } |
| return super.eInverseRemove(otherEnd, featureID, msgs); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case PerspectiveDslPackage.PERSPECTIVE_PART__DESCRIPTION: |
| return isDescription(); |
| case PerspectiveDslPackage.PERSPECTIVE_PART__DESCRIPTION_VALUE: |
| return getDescriptionValue(); |
| case PerspectiveDslPackage.PERSPECTIVE_PART__ICON_URI: |
| return getIconURI(); |
| case PerspectiveDslPackage.PERSPECTIVE_PART__VIEW: |
| return getView(); |
| case PerspectiveDslPackage.PERSPECTIVE_PART__IS_CLOSABLE: |
| return isIsClosable(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case PerspectiveDslPackage.PERSPECTIVE_PART__DESCRIPTION: |
| setDescription((Boolean)newValue); |
| return; |
| case PerspectiveDslPackage.PERSPECTIVE_PART__DESCRIPTION_VALUE: |
| setDescriptionValue((String)newValue); |
| return; |
| case PerspectiveDslPackage.PERSPECTIVE_PART__ICON_URI: |
| setIconURI((String)newValue); |
| return; |
| case PerspectiveDslPackage.PERSPECTIVE_PART__VIEW: |
| setView((PerspectiveView)newValue); |
| return; |
| case PerspectiveDslPackage.PERSPECTIVE_PART__IS_CLOSABLE: |
| setIsClosable((Boolean)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case PerspectiveDslPackage.PERSPECTIVE_PART__DESCRIPTION: |
| setDescription(DESCRIPTION_EDEFAULT); |
| return; |
| case PerspectiveDslPackage.PERSPECTIVE_PART__DESCRIPTION_VALUE: |
| setDescriptionValue(DESCRIPTION_VALUE_EDEFAULT); |
| return; |
| case PerspectiveDslPackage.PERSPECTIVE_PART__ICON_URI: |
| setIconURI(ICON_URI_EDEFAULT); |
| return; |
| case PerspectiveDslPackage.PERSPECTIVE_PART__VIEW: |
| setView((PerspectiveView)null); |
| return; |
| case PerspectiveDslPackage.PERSPECTIVE_PART__IS_CLOSABLE: |
| setIsClosable(IS_CLOSABLE_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case PerspectiveDslPackage.PERSPECTIVE_PART__DESCRIPTION: |
| return description != DESCRIPTION_EDEFAULT; |
| case PerspectiveDslPackage.PERSPECTIVE_PART__DESCRIPTION_VALUE: |
| return DESCRIPTION_VALUE_EDEFAULT == null ? descriptionValue != null : !DESCRIPTION_VALUE_EDEFAULT.equals(descriptionValue); |
| case PerspectiveDslPackage.PERSPECTIVE_PART__ICON_URI: |
| return ICON_URI_EDEFAULT == null ? iconURI != null : !ICON_URI_EDEFAULT.equals(iconURI); |
| case PerspectiveDslPackage.PERSPECTIVE_PART__VIEW: |
| return view != null; |
| case PerspectiveDslPackage.PERSPECTIVE_PART__IS_CLOSABLE: |
| return isClosable != IS_CLOSABLE_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(" (description: "); |
| result.append(description); |
| result.append(", descriptionValue: "); |
| result.append(descriptionValue); |
| result.append(", iconURI: "); |
| result.append(iconURI); |
| result.append(", isClosable: "); |
| result.append(isClosable); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //PerspectivePartImpl |