|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 package com.nokia.s60tools.imaker.internal.model.iContent.impl; |
|
18 |
|
19 import com.nokia.s60tools.imaker.internal.model.iContent.IContentPackage; |
|
20 import com.nokia.s60tools.imaker.internal.model.iContent.IbyEntry; |
|
21 import com.nokia.s60tools.imaker.internal.model.iContent.ImageContent; |
|
22 |
|
23 import java.util.Collection; |
|
24 import org.eclipse.emf.common.notify.Notification; |
|
25 |
|
26 import org.eclipse.emf.common.notify.NotificationChain; |
|
27 import org.eclipse.emf.common.util.EList; |
|
28 import org.eclipse.emf.ecore.EClass; |
|
29 import org.eclipse.emf.ecore.InternalEObject; |
|
30 |
|
31 import org.eclipse.emf.ecore.impl.ENotificationImpl; |
|
32 import org.eclipse.emf.ecore.impl.EObjectImpl; |
|
33 import org.eclipse.emf.ecore.util.EObjectContainmentEList; |
|
34 import org.eclipse.emf.ecore.util.InternalEList; |
|
35 |
|
36 /** |
|
37 * <!-- begin-user-doc --> |
|
38 * An implementation of the model object '<em><b>Image Content</b></em>'. |
|
39 * <!-- end-user-doc --> |
|
40 * <p> |
|
41 * The following features are implemented: |
|
42 * <ul> |
|
43 * <li>{@link com.nokia.s60tools.imaker.internal.model.iContent.impl.ImageContentImpl#getEntries <em>Entries</em>}</li> |
|
44 * </ul> |
|
45 * </p> |
|
46 * |
|
47 * @generated |
|
48 */ |
|
49 public class ImageContentImpl extends EObjectImpl implements ImageContent { |
|
50 /** |
|
51 * The cached value of the '{@link #getEntries() <em>Entries</em>}' containment reference list. |
|
52 * <!-- begin-user-doc --> |
|
53 * <!-- end-user-doc --> |
|
54 * @see #getEntries() |
|
55 * @generated |
|
56 * @ordered |
|
57 */ |
|
58 protected EList<IbyEntry> entries; |
|
59 |
|
60 /** |
|
61 * <!-- begin-user-doc --> |
|
62 * <!-- end-user-doc --> |
|
63 * @generated |
|
64 */ |
|
65 protected ImageContentImpl() { |
|
66 super(); |
|
67 } |
|
68 |
|
69 /** |
|
70 * <!-- begin-user-doc --> |
|
71 * <!-- end-user-doc --> |
|
72 * @generated |
|
73 */ |
|
74 @Override |
|
75 protected EClass eStaticClass() { |
|
76 return IContentPackage.Literals.IMAGE_CONTENT; |
|
77 } |
|
78 |
|
79 /** |
|
80 * <!-- begin-user-doc --> |
|
81 * <!-- end-user-doc --> |
|
82 * @generated |
|
83 */ |
|
84 public EList<IbyEntry> getEntries() { |
|
85 if (entries == null) { |
|
86 entries = new EObjectContainmentEList<IbyEntry>(IbyEntry.class, this, IContentPackage.IMAGE_CONTENT__ENTRIES); |
|
87 } |
|
88 return entries; |
|
89 } |
|
90 |
|
91 /** |
|
92 * <!-- begin-user-doc --> |
|
93 * <!-- end-user-doc --> |
|
94 * @generated |
|
95 */ |
|
96 @Override |
|
97 public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { |
|
98 switch (featureID) { |
|
99 case IContentPackage.IMAGE_CONTENT__ENTRIES: |
|
100 return ((InternalEList<?>)getEntries()).basicRemove(otherEnd, msgs); |
|
101 } |
|
102 return super.eInverseRemove(otherEnd, featureID, msgs); |
|
103 } |
|
104 |
|
105 /** |
|
106 * <!-- begin-user-doc --> |
|
107 * <!-- end-user-doc --> |
|
108 * @generated |
|
109 */ |
|
110 @Override |
|
111 public Object eGet(int featureID, boolean resolve, boolean coreType) { |
|
112 switch (featureID) { |
|
113 case IContentPackage.IMAGE_CONTENT__ENTRIES: |
|
114 return getEntries(); |
|
115 } |
|
116 return super.eGet(featureID, resolve, coreType); |
|
117 } |
|
118 |
|
119 /** |
|
120 * <!-- begin-user-doc --> |
|
121 * <!-- end-user-doc --> |
|
122 * @generated |
|
123 */ |
|
124 @SuppressWarnings("unchecked") |
|
125 @Override |
|
126 public void eSet(int featureID, Object newValue) { |
|
127 switch (featureID) { |
|
128 case IContentPackage.IMAGE_CONTENT__ENTRIES: |
|
129 getEntries().clear(); |
|
130 getEntries().addAll((Collection<? extends IbyEntry>)newValue); |
|
131 return; |
|
132 } |
|
133 super.eSet(featureID, newValue); |
|
134 } |
|
135 |
|
136 /** |
|
137 * <!-- begin-user-doc --> |
|
138 * <!-- end-user-doc --> |
|
139 * @generated |
|
140 */ |
|
141 @Override |
|
142 public void eUnset(int featureID) { |
|
143 switch (featureID) { |
|
144 case IContentPackage.IMAGE_CONTENT__ENTRIES: |
|
145 getEntries().clear(); |
|
146 return; |
|
147 } |
|
148 super.eUnset(featureID); |
|
149 } |
|
150 |
|
151 /** |
|
152 * <!-- begin-user-doc --> |
|
153 * <!-- end-user-doc --> |
|
154 * @generated |
|
155 */ |
|
156 @Override |
|
157 public boolean eIsSet(int featureID) { |
|
158 switch (featureID) { |
|
159 case IContentPackage.IMAGE_CONTENT__ENTRIES: |
|
160 return entries != null && !entries.isEmpty(); |
|
161 } |
|
162 return super.eIsSet(featureID); |
|
163 } |
|
164 |
|
165 } //ImageContentImpl |