| /** |
| * Copyright (c) 2011, 2015 - Lunifera GmbH (Gross Enzersdorf, Austria), 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 2.0 |
| * which accompanies this distribution, and is available at |
| * https://www.eclipse.org/legal/epl-2.0/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| * Contributors: |
| * Florian Pirchner - Initial implementation |
| */ |
| package org.eclipse.osbp.vaaclipse.ui.preferences.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.osbp.vaaclipse.ui.preferences.model.ScaleFieldEditor; |
| |
| import org.eclipse.osbp.vaaclipse.ui.preferences.model.metadata.PreferencesPackage; |
| |
| /** |
| * <!-- begin-user-doc --> An implementation of the model object ' |
| * <em><b>Scale Field Editor</b></em>'. <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li> |
| * {@link org.eclipse.osbp.vaaclipse.ui.preferences.model.impl.ScaleFieldEditorImpl#getMinValue |
| * <em>Min Value</em>}</li> |
| * <li> |
| * {@link org.eclipse.osbp.vaaclipse.ui.preferences.model.impl.ScaleFieldEditorImpl#getMaxValue |
| * <em>Max Value</em>}</li> |
| * <li> |
| * {@link org.eclipse.osbp.vaaclipse.ui.preferences.model.impl.ScaleFieldEditorImpl#getIncrementValue |
| * <em>Increment Value</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class ScaleFieldEditorImpl extends FieldEditorImpl<Integer> implements |
| ScaleFieldEditor { |
| /** |
| * The default value of the '{@link #getMinValue() <em>Min Value</em>}' |
| * attribute. <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @see #getMinValue() |
| * @generated |
| * @ordered |
| */ |
| protected static final Integer MIN_VALUE_EDEFAULT = new Integer(0); |
| |
| /** |
| * The cached value of the '{@link #getMinValue() <em>Min Value</em>}' |
| * attribute. <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @see #getMinValue() |
| * @generated |
| * @ordered |
| */ |
| protected Integer minValue = MIN_VALUE_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getMaxValue() <em>Max Value</em>}' |
| * attribute. <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @see #getMaxValue() |
| * @generated |
| * @ordered |
| */ |
| protected static final Integer MAX_VALUE_EDEFAULT = new Integer(100); |
| |
| /** |
| * The cached value of the '{@link #getMaxValue() <em>Max Value</em>}' |
| * attribute. <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @see #getMaxValue() |
| * @generated |
| * @ordered |
| */ |
| protected Integer maxValue = MAX_VALUE_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getIncrementValue() |
| * <em>Increment Value</em>}' attribute. <!-- begin-user-doc --> <!-- |
| * end-user-doc --> |
| * |
| * @see #getIncrementValue() |
| * @generated |
| * @ordered |
| */ |
| protected static final Integer INCREMENT_VALUE_EDEFAULT = new Integer(1); |
| |
| /** |
| * The cached value of the '{@link #getIncrementValue() |
| * <em>Increment Value</em>}' attribute. <!-- begin-user-doc --> <!-- |
| * end-user-doc --> |
| * |
| * @see #getIncrementValue() |
| * @generated |
| * @ordered |
| */ |
| protected Integer incrementValue = INCREMENT_VALUE_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| protected ScaleFieldEditorImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return PreferencesPackage.Literals.SCALE_FIELD_EDITOR; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> This is specialized for the |
| * more specific type known in this context. |
| * |
| * @generated |
| */ |
| @Override |
| public void setDefaultValueTyped(Integer newDefaultValueTyped) { |
| super.setDefaultValueTyped(newDefaultValueTyped); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public Integer getMinValue() { |
| return minValue; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public void setMinValue(Integer newMinValue) { |
| Integer oldMinValue = minValue; |
| minValue = newMinValue; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, |
| PreferencesPackage.SCALE_FIELD_EDITOR__MIN_VALUE, |
| oldMinValue, minValue)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public Integer getMaxValue() { |
| return maxValue; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public void setMaxValue(Integer newMaxValue) { |
| Integer oldMaxValue = maxValue; |
| maxValue = newMaxValue; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, |
| PreferencesPackage.SCALE_FIELD_EDITOR__MAX_VALUE, |
| oldMaxValue, maxValue)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public Integer getIncrementValue() { |
| return incrementValue; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public void setIncrementValue(Integer newIncrementValue) { |
| Integer oldIncrementValue = incrementValue; |
| incrementValue = newIncrementValue; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, |
| PreferencesPackage.SCALE_FIELD_EDITOR__INCREMENT_VALUE, |
| oldIncrementValue, incrementValue)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case PreferencesPackage.SCALE_FIELD_EDITOR__MIN_VALUE: |
| return getMinValue(); |
| case PreferencesPackage.SCALE_FIELD_EDITOR__MAX_VALUE: |
| return getMaxValue(); |
| case PreferencesPackage.SCALE_FIELD_EDITOR__INCREMENT_VALUE: |
| return getIncrementValue(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case PreferencesPackage.SCALE_FIELD_EDITOR__MIN_VALUE: |
| setMinValue((Integer) newValue); |
| return; |
| case PreferencesPackage.SCALE_FIELD_EDITOR__MAX_VALUE: |
| setMaxValue((Integer) newValue); |
| return; |
| case PreferencesPackage.SCALE_FIELD_EDITOR__INCREMENT_VALUE: |
| setIncrementValue((Integer) newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case PreferencesPackage.SCALE_FIELD_EDITOR__MIN_VALUE: |
| setMinValue(MIN_VALUE_EDEFAULT); |
| return; |
| case PreferencesPackage.SCALE_FIELD_EDITOR__MAX_VALUE: |
| setMaxValue(MAX_VALUE_EDEFAULT); |
| return; |
| case PreferencesPackage.SCALE_FIELD_EDITOR__INCREMENT_VALUE: |
| setIncrementValue(INCREMENT_VALUE_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case PreferencesPackage.SCALE_FIELD_EDITOR__MIN_VALUE: |
| return MIN_VALUE_EDEFAULT == null ? minValue != null |
| : !MIN_VALUE_EDEFAULT.equals(minValue); |
| case PreferencesPackage.SCALE_FIELD_EDITOR__MAX_VALUE: |
| return MAX_VALUE_EDEFAULT == null ? maxValue != null |
| : !MAX_VALUE_EDEFAULT.equals(maxValue); |
| case PreferencesPackage.SCALE_FIELD_EDITOR__INCREMENT_VALUE: |
| return INCREMENT_VALUE_EDEFAULT == null ? incrementValue != null |
| : !INCREMENT_VALUE_EDEFAULT.equals(incrementValue); |
| } |
| 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(" (minValue: "); |
| result.append(minValue); |
| result.append(", maxValue: "); |
| result.append(maxValue); |
| result.append(", incrementValue: "); |
| result.append(incrementValue); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } // ScaleFieldEditorImpl |