blob: f0dab7ad8c270ccd8e8db4da32e6b5d97eb5f8eb [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 v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* 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.StringFieldEditor;
import org.eclipse.osbp.vaaclipse.ui.preferences.model.metadata.PreferencesPackage;
/**
* <!-- begin-user-doc --> An implementation of the model object '
* <em><b>String Field Editor</b></em>'. <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>
* {@link org.eclipse.osbp.vaaclipse.ui.preferences.model.impl.StringFieldEditorImpl#getMaxLength
* <em>Max Length</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class StringFieldEditorImpl extends FieldEditorImpl<String> implements
StringFieldEditor {
/**
* The default value of the '{@link #getMaxLength() <em>Max Length</em>}'
* attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @see #getMaxLength()
* @generated
* @ordered
*/
protected static final Integer MAX_LENGTH_EDEFAULT = null;
/**
* The cached value of the '{@link #getMaxLength() <em>Max Length</em>}'
* attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @see #getMaxLength()
* @generated
* @ordered
*/
protected Integer maxLength = MAX_LENGTH_EDEFAULT;
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
protected StringFieldEditorImpl() {
super();
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
protected EClass eStaticClass() {
return PreferencesPackage.Literals.STRING_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(String newDefaultValueTyped) {
super.setDefaultValueTyped(newDefaultValueTyped);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public Integer getMaxLength() {
return maxLength;
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
public void setMaxLength(Integer newMaxLength) {
Integer oldMaxLength = maxLength;
maxLength = newMaxLength;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET,
PreferencesPackage.STRING_FIELD_EDITOR__MAX_LENGTH,
oldMaxLength, maxLength));
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case PreferencesPackage.STRING_FIELD_EDITOR__MAX_LENGTH:
return getMaxLength();
}
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.STRING_FIELD_EDITOR__MAX_LENGTH:
setMaxLength((Integer) newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case PreferencesPackage.STRING_FIELD_EDITOR__MAX_LENGTH:
setMaxLength(MAX_LENGTH_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case PreferencesPackage.STRING_FIELD_EDITOR__MAX_LENGTH:
return MAX_LENGTH_EDEFAULT == null ? maxLength != null
: !MAX_LENGTH_EDEFAULT.equals(maxLength);
}
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(" (maxLength: ");
result.append(maxLength);
result.append(')');
return result.toString();
}
} // StringFieldEditorImpl