blob: cb95a2ba68234073a96a0aa33f623f8d9b6e81e3 [file] [log] [blame]
/**
* 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.BooleanFieldEditor;
import org.eclipse.osbp.vaaclipse.ui.preferences.model.BooleanFieldStyle;
import org.eclipse.osbp.vaaclipse.ui.preferences.model.metadata.PreferencesPackage;
/**
* <!-- begin-user-doc --> An implementation of the model object '
* <em><b>Boolean Field Editor</b></em>'. <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>
* {@link org.eclipse.osbp.vaaclipse.ui.preferences.model.impl.BooleanFieldEditorImpl#getStyle
* <em>Style</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class BooleanFieldEditorImpl extends FieldEditorImpl<Boolean> implements
BooleanFieldEditor {
/**
* The default value of the '{@link #getStyle() <em>Style</em>}' attribute.
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @see #getStyle()
* @generated
* @ordered
*/
protected static final BooleanFieldStyle STYLE_EDEFAULT = BooleanFieldStyle.DEFAULT;
/**
* The cached value of the '{@link #getStyle() <em>Style</em>}' attribute.
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @see #getStyle()
* @generated
* @ordered
*/
protected BooleanFieldStyle style = STYLE_EDEFAULT;
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
protected BooleanFieldEditorImpl() {
super();
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return PreferencesPackage.Literals.BOOLEAN_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(Boolean newDefaultValueTyped) {
super.setDefaultValueTyped(newDefaultValueTyped);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public BooleanFieldStyle getStyle() {
return style;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public void setStyle(BooleanFieldStyle newStyle) {
BooleanFieldStyle oldStyle = style;
style = newStyle == null ? STYLE_EDEFAULT : newStyle;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET,
PreferencesPackage.BOOLEAN_FIELD_EDITOR__STYLE, oldStyle,
style));
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case PreferencesPackage.BOOLEAN_FIELD_EDITOR__STYLE:
return getStyle();
}
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.BOOLEAN_FIELD_EDITOR__STYLE:
setStyle((BooleanFieldStyle) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case PreferencesPackage.BOOLEAN_FIELD_EDITOR__STYLE:
setStyle(STYLE_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case PreferencesPackage.BOOLEAN_FIELD_EDITOR__STYLE:
return style != STYLE_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(" (style: ");
result.append(style);
result.append(')');
return result.toString();
}
} // BooleanFieldEditorImpl