001/** 002 */ 003package org.nasdanika.html.model.bootstrap.impl; 004 005import java.util.Collection; 006 007import org.eclipse.emf.common.notify.NotificationChain; 008 009import org.eclipse.emf.common.util.EList; 010 011import org.eclipse.emf.ecore.EClass; 012import org.eclipse.emf.ecore.InternalEObject; 013 014import org.eclipse.emf.ecore.util.InternalEList; 015 016import org.nasdanika.html.model.bootstrap.BootstrapPackage; 017import org.nasdanika.html.model.bootstrap.Row; 018 019/** 020 * <!-- begin-user-doc --> 021 * An implementation of the model object '<em><b>Container</b></em>'. 022 * <!-- end-user-doc --> 023 * <p> 024 * The following features are implemented: 025 * </p> 026 * <ul> 027 * <li>{@link org.nasdanika.html.model.bootstrap.impl.ContainerImpl#getRows <em>Rows</em>}</li> 028 * <li>{@link org.nasdanika.html.model.bootstrap.impl.ContainerImpl#isFluid <em>Fluid</em>}</li> 029 * </ul> 030 * 031 * @generated 032 */ 033public class ContainerImpl extends BootstrapElementImpl implements org.nasdanika.html.model.bootstrap.Container { 034 /** 035 * The default value of the '{@link #isFluid() <em>Fluid</em>}' attribute. 036 * <!-- begin-user-doc --> 037 * <!-- end-user-doc --> 038 * @see #isFluid() 039 * @generated 040 * @ordered 041 */ 042 protected static final boolean FLUID_EDEFAULT = false; 043 044 /** 045 * <!-- begin-user-doc --> 046 * <!-- end-user-doc --> 047 * @generated 048 */ 049 protected ContainerImpl() { 050 super(); 051 } 052 053 /** 054 * <!-- begin-user-doc --> 055 * <!-- end-user-doc --> 056 * @generated 057 */ 058 @Override 059 protected EClass eStaticClass() { 060 return BootstrapPackage.Literals.CONTAINER; 061 } 062 063 /** 064 * <!-- begin-user-doc --> 065 * <!-- end-user-doc --> 066 * @generated 067 */ 068 @SuppressWarnings("unchecked") 069 @Override 070 public EList<Row> getRows() { 071 return (EList<Row>)eDynamicGet(BootstrapPackage.CONTAINER__ROWS, BootstrapPackage.Literals.CONTAINER__ROWS, true, true); 072 } 073 074 /** 075 * <!-- begin-user-doc --> 076 * <!-- end-user-doc --> 077 * @generated 078 */ 079 @Override 080 public boolean isFluid() { 081 return (Boolean)eDynamicGet(BootstrapPackage.CONTAINER__FLUID, BootstrapPackage.Literals.CONTAINER__FLUID, true, true); 082 } 083 084 /** 085 * <!-- begin-user-doc --> 086 * <!-- end-user-doc --> 087 * @generated 088 */ 089 @Override 090 public void setFluid(boolean newFluid) { 091 eDynamicSet(BootstrapPackage.CONTAINER__FLUID, BootstrapPackage.Literals.CONTAINER__FLUID, newFluid); 092 } 093 094 /** 095 * <!-- begin-user-doc --> 096 * <!-- end-user-doc --> 097 * @generated 098 */ 099 @Override 100 public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { 101 switch (featureID) { 102 case BootstrapPackage.CONTAINER__ROWS: 103 return ((InternalEList<?>)getRows()).basicRemove(otherEnd, msgs); 104 } 105 return super.eInverseRemove(otherEnd, featureID, msgs); 106 } 107 108 /** 109 * <!-- begin-user-doc --> 110 * <!-- end-user-doc --> 111 * @generated 112 */ 113 @Override 114 public Object eGet(int featureID, boolean resolve, boolean coreType) { 115 switch (featureID) { 116 case BootstrapPackage.CONTAINER__ROWS: 117 return getRows(); 118 case BootstrapPackage.CONTAINER__FLUID: 119 return isFluid(); 120 } 121 return super.eGet(featureID, resolve, coreType); 122 } 123 124 /** 125 * <!-- begin-user-doc --> 126 * <!-- end-user-doc --> 127 * @generated 128 */ 129 @SuppressWarnings("unchecked") 130 @Override 131 public void eSet(int featureID, Object newValue) { 132 switch (featureID) { 133 case BootstrapPackage.CONTAINER__ROWS: 134 getRows().clear(); 135 getRows().addAll((Collection<? extends Row>)newValue); 136 return; 137 case BootstrapPackage.CONTAINER__FLUID: 138 setFluid((Boolean)newValue); 139 return; 140 } 141 super.eSet(featureID, newValue); 142 } 143 144 /** 145 * <!-- begin-user-doc --> 146 * <!-- end-user-doc --> 147 * @generated 148 */ 149 @Override 150 public void eUnset(int featureID) { 151 switch (featureID) { 152 case BootstrapPackage.CONTAINER__ROWS: 153 getRows().clear(); 154 return; 155 case BootstrapPackage.CONTAINER__FLUID: 156 setFluid(FLUID_EDEFAULT); 157 return; 158 } 159 super.eUnset(featureID); 160 } 161 162 /** 163 * <!-- begin-user-doc --> 164 * <!-- end-user-doc --> 165 * @generated 166 */ 167 @Override 168 public boolean eIsSet(int featureID) { 169 switch (featureID) { 170 case BootstrapPackage.CONTAINER__ROWS: 171 return !getRows().isEmpty(); 172 case BootstrapPackage.CONTAINER__FLUID: 173 return isFluid() != FLUID_EDEFAULT; 174 } 175 return super.eIsSet(featureID); 176 } 177 178} //ContainerImpl