blob: 2dce38bf6c9afc9ee2e4a087953c5d16e45a28e1 [file] [log] [blame]
/**
* Copyright (c) 2008, 2015 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* IBM Corporation - initial API and implementation
*/
package org.eclipse.e4.ui.model.application.ui.basic.impl;
import java.util.Collection;
import java.util.List;
import org.eclipse.e4.ui.model.application.ui.basic.MTrimBar;
import org.eclipse.e4.ui.model.application.ui.basic.MTrimmedWindow;
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.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Trimmed Window</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.eclipse.e4.ui.model.application.ui.basic.impl.TrimmedWindowImpl#getTrimBars <em>Trim Bars</em>}</li>
* </ul>
*
* @since 1.0
* @generated
*/
public class TrimmedWindowImpl extends WindowImpl implements MTrimmedWindow {
/**
* The cached value of the '{@link #getTrimBars() <em>Trim Bars</em>}' containment reference list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getTrimBars()
* @generated
* @ordered
*/
protected EList<MTrimBar> trimBars;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected TrimmedWindowImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return BasicPackageImpl.Literals.TRIMMED_WINDOW;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public List<MTrimBar> getTrimBars() {
if (trimBars == null) {
trimBars = new EObjectContainmentEList<MTrimBar>(MTrimBar.class, this,
BasicPackageImpl.TRIMMED_WINDOW__TRIM_BARS);
}
return trimBars;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case BasicPackageImpl.TRIMMED_WINDOW__TRIM_BARS:
return ((InternalEList<?>) getTrimBars()).basicRemove(otherEnd, msgs);
default:
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 BasicPackageImpl.TRIMMED_WINDOW__TRIM_BARS:
return getTrimBars();
default:
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 BasicPackageImpl.TRIMMED_WINDOW__TRIM_BARS:
getTrimBars().clear();
getTrimBars().addAll((Collection<? extends MTrimBar>) newValue);
return;
default:
super.eSet(featureID, newValue);
return;
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case BasicPackageImpl.TRIMMED_WINDOW__TRIM_BARS:
getTrimBars().clear();
return;
default:
super.eUnset(featureID);
return;
}
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case BasicPackageImpl.TRIMMED_WINDOW__TRIM_BARS:
return trimBars != null && !trimBars.isEmpty();
default:
return super.eIsSet(featureID);
}
}
} //TrimmedWindowImpl