| /******************************************************************************* |
| * Copyright (c) 2009, 2014 Xored Software Inc 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: |
| * Xored Software Inc - initial API and implementation and/or initial documentation |
| *******************************************************************************/ |
| package org.eclipse.rcptt.tesla.core.ui.impl; |
| |
| import org.eclipse.rcptt.tesla.core.ui.Editor; |
| import org.eclipse.rcptt.tesla.core.ui.UiPackage; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| |
| import org.eclipse.emf.ecore.EClass; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Editor</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.rcptt.tesla.core.ui.impl.EditorImpl#getTitle <em>Title</em>}</li> |
| * <li>{@link org.eclipse.rcptt.tesla.core.ui.impl.EditorImpl#getInput <em>Input</em>}</li> |
| * <li>{@link org.eclipse.rcptt.tesla.core.ui.impl.EditorImpl#isDirty <em>Dirty</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class EditorImpl extends ControlImpl implements Editor { |
| /** |
| * The default value of the '{@link #getTitle() <em>Title</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getTitle() |
| * @generated |
| * @ordered |
| */ |
| protected static final String TITLE_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getTitle() <em>Title</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getTitle() |
| * @generated |
| * @ordered |
| */ |
| protected String title = TITLE_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #getInput() <em>Input</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getInput() |
| * @generated |
| * @ordered |
| */ |
| protected static final String INPUT_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getInput() <em>Input</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getInput() |
| * @generated |
| * @ordered |
| */ |
| protected String input = INPUT_EDEFAULT; |
| |
| /** |
| * The default value of the '{@link #isDirty() <em>Dirty</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isDirty() |
| * @generated |
| * @ordered |
| */ |
| protected static final boolean DIRTY_EDEFAULT = false; |
| |
| /** |
| * The cached value of the '{@link #isDirty() <em>Dirty</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #isDirty() |
| * @generated |
| * @ordered |
| */ |
| protected boolean dirty = DIRTY_EDEFAULT; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected EditorImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return UiPackage.Literals.EDITOR; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getTitle() { |
| return title; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setTitle(String newTitle) { |
| String oldTitle = title; |
| title = newTitle; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, UiPackage.EDITOR__TITLE, oldTitle, title)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getInput() { |
| return input; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setInput(String newInput) { |
| String oldInput = input; |
| input = newInput; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, UiPackage.EDITOR__INPUT, oldInput, input)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean isDirty() { |
| return dirty; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setDirty(boolean newDirty) { |
| boolean oldDirty = dirty; |
| dirty = newDirty; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, UiPackage.EDITOR__DIRTY, oldDirty, dirty)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case UiPackage.EDITOR__TITLE: |
| return getTitle(); |
| case UiPackage.EDITOR__INPUT: |
| return getInput(); |
| case UiPackage.EDITOR__DIRTY: |
| return isDirty(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case UiPackage.EDITOR__TITLE: |
| setTitle((String)newValue); |
| return; |
| case UiPackage.EDITOR__INPUT: |
| setInput((String)newValue); |
| return; |
| case UiPackage.EDITOR__DIRTY: |
| setDirty((Boolean)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case UiPackage.EDITOR__TITLE: |
| setTitle(TITLE_EDEFAULT); |
| return; |
| case UiPackage.EDITOR__INPUT: |
| setInput(INPUT_EDEFAULT); |
| return; |
| case UiPackage.EDITOR__DIRTY: |
| setDirty(DIRTY_EDEFAULT); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case UiPackage.EDITOR__TITLE: |
| return TITLE_EDEFAULT == null ? title != null : !TITLE_EDEFAULT.equals(title); |
| case UiPackage.EDITOR__INPUT: |
| return INPUT_EDEFAULT == null ? input != null : !INPUT_EDEFAULT.equals(input); |
| case UiPackage.EDITOR__DIRTY: |
| return dirty != DIRTY_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(" (title: "); |
| result.append(title); |
| result.append(", input: "); |
| result.append(input); |
| result.append(", dirty: "); |
| result.append(dirty); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //EditorImpl |