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.bootstrap.Color; 017import org.nasdanika.html.model.bootstrap.BootstrapPackage; 018import org.nasdanika.html.model.bootstrap.TableCell; 019import org.nasdanika.html.model.bootstrap.TableRow; 020 021/** 022 * <!-- begin-user-doc --> 023 * An implementation of the model object '<em><b>Table Row</b></em>'. 024 * <!-- end-user-doc --> 025 * <p> 026 * The following features are implemented: 027 * </p> 028 * <ul> 029 * <li>{@link org.nasdanika.html.model.bootstrap.impl.TableRowImpl#getCells <em>Cells</em>}</li> 030 * <li>{@link org.nasdanika.html.model.bootstrap.impl.TableRowImpl#getColor <em>Color</em>}</li> 031 * <li>{@link org.nasdanika.html.model.bootstrap.impl.TableRowImpl#getBackground <em>Background</em>}</li> 032 * </ul> 033 * 034 * @generated 035 */ 036public class TableRowImpl extends BootstrapElementImpl implements TableRow { 037 /** 038 * The default value of the '{@link #getColor() <em>Color</em>}' attribute. 039 * <!-- begin-user-doc --> 040 * <!-- end-user-doc --> 041 * @see #getColor() 042 * @generated 043 * @ordered 044 */ 045 protected static final Color COLOR_EDEFAULT = null; 046 047 /** 048 * The default value of the '{@link #getBackground() <em>Background</em>}' attribute. 049 * <!-- begin-user-doc --> 050 * <!-- end-user-doc --> 051 * @see #getBackground() 052 * @generated 053 * @ordered 054 */ 055 protected static final Color BACKGROUND_EDEFAULT = null; 056 057 /** 058 * <!-- begin-user-doc --> 059 * <!-- end-user-doc --> 060 * @generated 061 */ 062 protected TableRowImpl() { 063 super(); 064 } 065 066 /** 067 * <!-- begin-user-doc --> 068 * <!-- end-user-doc --> 069 * @generated 070 */ 071 @Override 072 protected EClass eStaticClass() { 073 return BootstrapPackage.Literals.TABLE_ROW; 074 } 075 076 /** 077 * <!-- begin-user-doc --> 078 * <!-- end-user-doc --> 079 * @generated 080 */ 081 @SuppressWarnings("unchecked") 082 @Override 083 public EList<TableCell> getCells() { 084 return (EList<TableCell>)eDynamicGet(BootstrapPackage.TABLE_ROW__CELLS, BootstrapPackage.Literals.TABLE_ROW__CELLS, true, true); 085 } 086 087 /** 088 * <!-- begin-user-doc --> 089 * <!-- end-user-doc --> 090 * @generated 091 */ 092 @Override 093 public Color getColor() { 094 return (Color)eDynamicGet(BootstrapPackage.TABLE_ROW__COLOR, BootstrapPackage.Literals.TABLE_ROW__COLOR, true, true); 095 } 096 097 /** 098 * <!-- begin-user-doc --> 099 * <!-- end-user-doc --> 100 * @generated 101 */ 102 @Override 103 public void setColor(Color newColor) { 104 eDynamicSet(BootstrapPackage.TABLE_ROW__COLOR, BootstrapPackage.Literals.TABLE_ROW__COLOR, newColor); 105 } 106 107 /** 108 * <!-- begin-user-doc --> 109 * <!-- end-user-doc --> 110 * @generated 111 */ 112 @Override 113 public Color getBackground() { 114 return (Color)eDynamicGet(BootstrapPackage.TABLE_ROW__BACKGROUND, BootstrapPackage.Literals.TABLE_ROW__BACKGROUND, true, true); 115 } 116 117 /** 118 * <!-- begin-user-doc --> 119 * <!-- end-user-doc --> 120 * @generated 121 */ 122 @Override 123 public void setBackground(Color newBackground) { 124 eDynamicSet(BootstrapPackage.TABLE_ROW__BACKGROUND, BootstrapPackage.Literals.TABLE_ROW__BACKGROUND, newBackground); 125 } 126 127 /** 128 * <!-- begin-user-doc --> 129 * <!-- end-user-doc --> 130 * @generated 131 */ 132 @Override 133 public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { 134 switch (featureID) { 135 case BootstrapPackage.TABLE_ROW__CELLS: 136 return ((InternalEList<?>)getCells()).basicRemove(otherEnd, msgs); 137 } 138 return super.eInverseRemove(otherEnd, featureID, msgs); 139 } 140 141 /** 142 * <!-- begin-user-doc --> 143 * <!-- end-user-doc --> 144 * @generated 145 */ 146 @Override 147 public Object eGet(int featureID, boolean resolve, boolean coreType) { 148 switch (featureID) { 149 case BootstrapPackage.TABLE_ROW__CELLS: 150 return getCells(); 151 case BootstrapPackage.TABLE_ROW__COLOR: 152 return getColor(); 153 case BootstrapPackage.TABLE_ROW__BACKGROUND: 154 return getBackground(); 155 } 156 return super.eGet(featureID, resolve, coreType); 157 } 158 159 /** 160 * <!-- begin-user-doc --> 161 * <!-- end-user-doc --> 162 * @generated 163 */ 164 @SuppressWarnings("unchecked") 165 @Override 166 public void eSet(int featureID, Object newValue) { 167 switch (featureID) { 168 case BootstrapPackage.TABLE_ROW__CELLS: 169 getCells().clear(); 170 getCells().addAll((Collection<? extends TableCell>)newValue); 171 return; 172 case BootstrapPackage.TABLE_ROW__COLOR: 173 setColor((Color)newValue); 174 return; 175 case BootstrapPackage.TABLE_ROW__BACKGROUND: 176 setBackground((Color)newValue); 177 return; 178 } 179 super.eSet(featureID, newValue); 180 } 181 182 /** 183 * <!-- begin-user-doc --> 184 * <!-- end-user-doc --> 185 * @generated 186 */ 187 @Override 188 public void eUnset(int featureID) { 189 switch (featureID) { 190 case BootstrapPackage.TABLE_ROW__CELLS: 191 getCells().clear(); 192 return; 193 case BootstrapPackage.TABLE_ROW__COLOR: 194 setColor(COLOR_EDEFAULT); 195 return; 196 case BootstrapPackage.TABLE_ROW__BACKGROUND: 197 setBackground(BACKGROUND_EDEFAULT); 198 return; 199 } 200 super.eUnset(featureID); 201 } 202 203 /** 204 * <!-- begin-user-doc --> 205 * <!-- end-user-doc --> 206 * @generated 207 */ 208 @Override 209 public boolean eIsSet(int featureID) { 210 switch (featureID) { 211 case BootstrapPackage.TABLE_ROW__CELLS: 212 return !getCells().isEmpty(); 213 case BootstrapPackage.TABLE_ROW__COLOR: 214 return COLOR_EDEFAULT == null ? getColor() != null : !COLOR_EDEFAULT.equals(getColor()); 215 case BootstrapPackage.TABLE_ROW__BACKGROUND: 216 return BACKGROUND_EDEFAULT == null ? getBackground() != null : !BACKGROUND_EDEFAULT.equals(getBackground()); 217 } 218 return super.eIsSet(featureID); 219 } 220 221} //TableRowImpl