| /** |
| * Copyright (c) 2008 IBM Corporation 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: |
| * IBM Corporation - initial API and implementation |
| */ |
| package org.eclipse.e4.ui.model.application.impl; |
| |
| import org.eclipse.e4.ui.model.application.MApplicationPackage; |
| import org.eclipse.e4.ui.model.application.MCommand; |
| import org.eclipse.e4.ui.model.application.MHandler; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.EObject; |
| import org.eclipse.emf.ecore.InternalEObject; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Handler</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.e4.ui.model.application.impl.HandlerImpl#getCommand <em>Command</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class HandlerImpl extends ContributionImpl implements MHandler { |
| /** |
| * The cached value of the '{@link #getCommand() <em>Command</em>}' reference. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getCommand() |
| * @generated |
| * @ordered |
| */ |
| protected MCommand command; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected HandlerImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return MApplicationPackage.Literals.HANDLER; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public MCommand getCommand() { |
| if (command != null && ((EObject)command).eIsProxy()) { |
| InternalEObject oldCommand = (InternalEObject)command; |
| command = (MCommand)eResolveProxy(oldCommand); |
| if (command != oldCommand) { |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.RESOLVE, MApplicationPackage.HANDLER__COMMAND, oldCommand, command)); |
| } |
| } |
| return command; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public MCommand basicGetCommand() { |
| return command; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setCommand(MCommand newCommand) { |
| MCommand oldCommand = command; |
| command = newCommand; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, MApplicationPackage.HANDLER__COMMAND, oldCommand, command)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case MApplicationPackage.HANDLER__COMMAND: |
| if (resolve) return getCommand(); |
| return basicGetCommand(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case MApplicationPackage.HANDLER__COMMAND: |
| setCommand((MCommand)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case MApplicationPackage.HANDLER__COMMAND: |
| setCommand((MCommand)null); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case MApplicationPackage.HANDLER__COMMAND: |
| return command != null; |
| } |
| return super.eIsSet(featureID); |
| } |
| |
| } //HandlerImpl |