| /******************************************************************************* |
| * Copyright (c) 2009, 2019 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 |
| * https://www.eclipse.org/legal/epl-v20.html |
| * |
| * Contributors: |
| * Xored Software Inc - initial API and implementation and/or initial documentation |
| *******************************************************************************/ |
| package org.eclipse.rcptt.debug.impl; |
| |
| import org.eclipse.rcptt.debug.Breakpoint; |
| import org.eclipse.rcptt.debug.BreakpointResource; |
| import org.eclipse.rcptt.debug.DebugPackage; |
| |
| import java.util.Collection; |
| |
| import org.eclipse.emf.common.notify.Notification; |
| import org.eclipse.emf.common.notify.NotificationChain; |
| |
| import org.eclipse.emf.common.util.EList; |
| |
| import org.eclipse.emf.ecore.EClass; |
| import org.eclipse.emf.ecore.InternalEObject; |
| |
| import org.eclipse.emf.ecore.impl.ENotificationImpl; |
| import org.eclipse.emf.ecore.impl.EObjectImpl; |
| |
| import org.eclipse.emf.ecore.util.EObjectContainmentEList; |
| import org.eclipse.emf.ecore.util.InternalEList; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * An implementation of the model object '<em><b>Breakpoint Resource</b></em>'. |
| * <!-- end-user-doc --> |
| * <p> |
| * The following features are implemented: |
| * <ul> |
| * <li>{@link org.eclipse.rcptt.debug.impl.BreakpointResourceImpl#getPath <em>Path</em>}</li> |
| * <li>{@link org.eclipse.rcptt.debug.impl.BreakpointResourceImpl#getBreakpoints <em>Breakpoints</em>}</li> |
| * </ul> |
| * </p> |
| * |
| * @generated |
| */ |
| public class BreakpointResourceImpl extends EObjectImpl implements BreakpointResource { |
| /** |
| * The default value of the '{@link #getPath() <em>Path</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getPath() |
| * @generated |
| * @ordered |
| */ |
| protected static final String PATH_EDEFAULT = null; |
| |
| /** |
| * The cached value of the '{@link #getPath() <em>Path</em>}' attribute. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getPath() |
| * @generated |
| * @ordered |
| */ |
| protected String path = PATH_EDEFAULT; |
| |
| /** |
| * The cached value of the '{@link #getBreakpoints() <em>Breakpoints</em>}' containment reference list. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see #getBreakpoints() |
| * @generated |
| * @ordered |
| */ |
| protected EList<Breakpoint> breakpoints; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected BreakpointResourceImpl() { |
| super(); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EClass eStaticClass() { |
| return DebugPackage.Literals.BREAKPOINT_RESOURCE; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public String getPath() { |
| return path; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public void setPath(String newPath) { |
| String oldPath = path; |
| path = newPath; |
| if (eNotificationRequired()) |
| eNotify(new ENotificationImpl(this, Notification.SET, DebugPackage.BREAKPOINT_RESOURCE__PATH, oldPath, path)); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public EList<Breakpoint> getBreakpoints() { |
| if (breakpoints == null) { |
| breakpoints = new EObjectContainmentEList<Breakpoint>(Breakpoint.class, this, DebugPackage.BREAKPOINT_RESOURCE__BREAKPOINTS); |
| } |
| return breakpoints; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
| switch (featureID) { |
| case DebugPackage.BREAKPOINT_RESOURCE__BREAKPOINTS: |
| return ((InternalEList<?>)getBreakpoints()).basicRemove(otherEnd, msgs); |
| } |
| return super.eInverseRemove(otherEnd, featureID, msgs); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public Object eGet(int featureID, boolean resolve, boolean coreType) { |
| switch (featureID) { |
| case DebugPackage.BREAKPOINT_RESOURCE__PATH: |
| return getPath(); |
| case DebugPackage.BREAKPOINT_RESOURCE__BREAKPOINTS: |
| return getBreakpoints(); |
| } |
| return super.eGet(featureID, resolve, coreType); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @SuppressWarnings("unchecked") |
| @Override |
| public void eSet(int featureID, Object newValue) { |
| switch (featureID) { |
| case DebugPackage.BREAKPOINT_RESOURCE__PATH: |
| setPath((String)newValue); |
| return; |
| case DebugPackage.BREAKPOINT_RESOURCE__BREAKPOINTS: |
| getBreakpoints().clear(); |
| getBreakpoints().addAll((Collection<? extends Breakpoint>)newValue); |
| return; |
| } |
| super.eSet(featureID, newValue); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public void eUnset(int featureID) { |
| switch (featureID) { |
| case DebugPackage.BREAKPOINT_RESOURCE__PATH: |
| setPath(PATH_EDEFAULT); |
| return; |
| case DebugPackage.BREAKPOINT_RESOURCE__BREAKPOINTS: |
| getBreakpoints().clear(); |
| return; |
| } |
| super.eUnset(featureID); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public boolean eIsSet(int featureID) { |
| switch (featureID) { |
| case DebugPackage.BREAKPOINT_RESOURCE__PATH: |
| return PATH_EDEFAULT == null ? path != null : !PATH_EDEFAULT.equals(path); |
| case DebugPackage.BREAKPOINT_RESOURCE__BREAKPOINTS: |
| return breakpoints != null && !breakpoints.isEmpty(); |
| } |
| 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(" (path: "); |
| result.append(path); |
| result.append(')'); |
| return result.toString(); |
| } |
| |
| } //BreakpointResourceImpl |