| /** |
| * 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.e4.ui.model.application.MContribution; |
| |
| import org.eclipse.e4.ui.model.application.impl.ApplicationPackageImpl; |
| |
| 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.FileFieldEditor; |
| |
| import org.eclipse.osbp.vaaclipse.ui.preferences.model.metadata.PreferencesPackage; |
| |
| /** |
| * <!-- begin-user-doc --> An implementation of the model object ' |
| * <em><b>File Field Editor</b></em>'. <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li> |
| * {@link org.eclipse.osbp.vaaclipse.ui.preferences.model.impl.FileFieldEditorImpl#getContributionURI |
| * <em>Contribution URI</em>}</li> |
| * <li> |
| * {@link org.eclipse.osbp.vaaclipse.ui.preferences.model.impl.FileFieldEditorImpl#getObject |
| * <em>Object</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class FileFieldEditorImpl extends FieldEditorImpl<String> implements |
| FileFieldEditor { |
| /** |
| * The default value of the '{@link #getContributionURI() |
| * <em>Contribution URI</em>}' attribute. <!-- begin-user-doc --> <!-- |
| * end-user-doc --> |
| * |
| * @see #getContributionURI() |
| * @generated |
| * @ordered |
| */ |
| protected static final String CONTRIBUTION_URI_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getContributionURI() |
| * <em>Contribution URI</em>}' attribute. <!-- begin-user-doc --> <!-- |
| * end-user-doc --> |
| * |
| * @see #getContributionURI() |
| * @generated |
| * @ordered |
| */ |
| protected String contributionURI = CONTRIBUTION_URI_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getObject() <em>Object</em>}' |
| * attribute. <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @see #getObject() |
| * @generated |
| * @ordered |
| */ |
| protected static final Object OBJECT_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getObject() <em>Object</em>}' attribute. |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @see #getObject() |
| * @generated |
| * @ordered |
| */ |
| protected Object object = OBJECT_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| protected FileFieldEditorImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return PreferencesPackage.Literals.FILE_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 String getContributionURI() { |
| return contributionURI; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public void setContributionURI(String newContributionURI) { |
| String oldContributionURI = contributionURI; |
| contributionURI = newContributionURI; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, |
| PreferencesPackage.FILE_FIELD_EDITOR__CONTRIBUTION_URI, |
| oldContributionURI, contributionURI)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public Object getObject() { |
| return object; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| public void setObject(Object newObject) { |
| Object oldObject = object; |
| object = newObject; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, |
| PreferencesPackage.FILE_FIELD_EDITOR__OBJECT, oldObject, |
| object)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case PreferencesPackage.FILE_FIELD_EDITOR__CONTRIBUTION_URI: |
| return getContributionURI(); |
| case PreferencesPackage.FILE_FIELD_EDITOR__OBJECT: |
| return getObject(); |
| } |
| 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.FILE_FIELD_EDITOR__CONTRIBUTION_URI: |
| setContributionURI((String) newValue); |
| return; |
| case PreferencesPackage.FILE_FIELD_EDITOR__OBJECT: |
| setObject(newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case PreferencesPackage.FILE_FIELD_EDITOR__CONTRIBUTION_URI: |
| setContributionURI(CONTRIBUTION_URI_EDEFAULT); |
| return; |
| case PreferencesPackage.FILE_FIELD_EDITOR__OBJECT: |
| setObject(OBJECT_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case PreferencesPackage.FILE_FIELD_EDITOR__CONTRIBUTION_URI: |
| return CONTRIBUTION_URI_EDEFAULT == null ? contributionURI != null |
| : !CONTRIBUTION_URI_EDEFAULT.equals(contributionURI); |
| case PreferencesPackage.FILE_FIELD_EDITOR__OBJECT: |
| return OBJECT_EDEFAULT == null ? object != null : !OBJECT_EDEFAULT |
| .equals(object); |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) { |
| if (baseClass == MContribution.class) { |
| switch (derivedFeatureID) { |
| case PreferencesPackage.FILE_FIELD_EDITOR__CONTRIBUTION_URI: |
| return ApplicationPackageImpl.CONTRIBUTION__CONTRIBUTION_URI; |
| case PreferencesPackage.FILE_FIELD_EDITOR__OBJECT: |
| return ApplicationPackageImpl.CONTRIBUTION__OBJECT; |
| default: |
| return -1; |
| } |
| } |
| return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) { |
| if (baseClass == MContribution.class) { |
| switch (baseFeatureID) { |
| case ApplicationPackageImpl.CONTRIBUTION__CONTRIBUTION_URI: |
| return PreferencesPackage.FILE_FIELD_EDITOR__CONTRIBUTION_URI; |
| case ApplicationPackageImpl.CONTRIBUTION__OBJECT: |
| return PreferencesPackage.FILE_FIELD_EDITOR__OBJECT; |
| default: |
| return -1; |
| } |
| } |
| return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> <!-- end-user-doc --> |
| * |
| * @generated |
| */ |
| @Override |
| public String toString() { |
| if (eIsProxy()) |
| return super.toString(); |
| |
| StringBuffer result = new StringBuffer(super.toString()); |
| result.append(" (contributionURI: "); |
| result.append(contributionURI); |
| result.append(", object: "); |
| result.append(object); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } // FileFieldEditorImpl |