| /** |
| * Copyright (c) 2011-2016 EclipseSource Muenchen GmbH and others. |
| * |
| * 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: |
| * EclipseSource Munich - initial API and implementation |
| */ |
| package org.eclipse.emf.ecp.view.template.style.tab.model.impl; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; |
| import org.eclipse.emf.ecp.view.template.model.VTStyleProperty; |
| import org.eclipse.emf.ecp.view.template.style.tab.model.TabType; |
| import org.eclipse.emf.ecp.view.template.style.tab.model.VTTabPackage; |
| import org.eclipse.emf.ecp.view.template.style.tab.model.VTTabStyleProperty; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Style Property</b></em>'. |
| * |
| * @since 1.8 |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * </p> |
| * <ul> |
| * <li>{@link org.eclipse.emf.ecp.view.template.style.tab.model.impl.VTTabStylePropertyImpl#getType <em>Type</em> |
| * }</li> |
| * </ul> |
| * |
| * @generated |
| */ |
| public class VTTabStylePropertyImpl extends MinimalEObjectImpl.Container implements VTTabStyleProperty { |
| /** |
| * The default value of the '{@link #getType() <em>Type</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @see #getType() |
| * @generated |
| * @ordered |
| */ |
| protected static final TabType TYPE_EDEFAULT = TabType.BOTTOM; |
| |
| /** |
| * The cached value of the '{@link #getType() <em>Type</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @see #getType() |
| * @generated |
| * @ordered |
| */ |
| protected TabType type = TYPE_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| protected VTTabStylePropertyImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return VTTabPackage.Literals.TAB_STYLE_PROPERTY; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public TabType getType() { |
| return type; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public void setType(TabType newType) { |
| final TabType oldType = type; |
| type = newType == null ? TYPE_EDEFAULT : newType; |
| if (eNotificationRequired()) { |
| eNotify( |
| new ENotificationImpl(this, Notification.SET, VTTabPackage.TAB_STYLE_PROPERTY__TYPE, oldType, type)); |
| } |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case VTTabPackage.TAB_STYLE_PROPERTY__TYPE: |
| return getType(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case VTTabPackage.TAB_STYLE_PROPERTY__TYPE: |
| setType((TabType) newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case VTTabPackage.TAB_STYLE_PROPERTY__TYPE: |
| setType(TYPE_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case VTTabPackage.TAB_STYLE_PROPERTY__TYPE: |
| return type != TYPE_EDEFAULT; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public String toString() { |
| if (eIsProxy()) { |
| return super.toString(); |
| } |
| |
| final StringBuffer result = new StringBuffer(super.toString()); |
| result.append(" (type: "); //$NON-NLS-1$ |
| result.append(type); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| @Override |
| public boolean equalStyles(VTStyleProperty styleProperty) { |
| if (!VTTabStyleProperty.class.isInstance(styleProperty)) { |
| return false; |
| } |
| return getType() == VTTabStyleProperty.class.cast(styleProperty).getType(); |
| } |
| |
| } // VTTabStylePropertyImpl |