001: /**
002: * <copyright>
003: * </copyright>
004: *
005: * $Id: FTPImpl.java 251 2006-08-18 01:00:08Z mpreston $
006: */package com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.impl;
007:
008: import org.eclipse.emf.common.notify.Notification;
009: import org.eclipse.emf.common.notify.NotificationChain;
010: import org.eclipse.emf.ecore.EClass;
011: import org.eclipse.emf.ecore.InternalEObject;
012: import org.eclipse.emf.ecore.impl.ENotificationImpl;
013:
014: import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.Consumer;
015: import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.FTP;
016: import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.FTPBase;
017: import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.FTPConsumer;
018: import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.FTPProvider;
019: import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.FTPScriptModeType;
020: import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.FileCompletion;
021: import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.FtpReply;
022: import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.Provider;
023: import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.componentflowFactory;
024: import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.componentflowPackage;
025:
026: /**
027: * <!-- begin-user-doc -->
028: * An implementation of the model object '<em><b>FTP</b></em>'.
029: * <!-- end-user-doc -->
030: * <p>
031: * The following features are implemented:
032: * <ul>
033: * <li>{@link com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.impl.FTPImpl#getScriptMode <em>Script Mode</em>}</li>
034: * <li>{@link com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.impl.FTPImpl#getFtpBase <em>Ftp Base</em>}</li>
035: * </ul>
036: * </p>
037: *
038: * @generated
039: */
040: public class FTPImpl extends BindingComponentImpl implements FTP {
041: /**
042: * <!-- begin-user-doc -->
043: * <!-- end-user-doc -->
044: * @generated
045: */
046: public static final String copyright = "Copyright, Bostech Corp.";
047:
048: /**
049: * The default value of the '{@link #getScriptMode() <em>Script Mode</em>}' attribute.
050: * <!-- begin-user-doc -->
051: * <!-- end-user-doc -->
052: * @see #getScriptMode()
053: * @generated
054: * @ordered
055: */
056: protected static final FTPScriptModeType SCRIPT_MODE_EDEFAULT = FTPScriptModeType.BASE_LITERAL;
057:
058: /**
059: * The cached value of the '{@link #getScriptMode() <em>Script Mode</em>}' attribute.
060: * <!-- begin-user-doc -->
061: * <!-- end-user-doc -->
062: * @see #getScriptMode()
063: * @generated
064: * @ordered
065: */
066: protected FTPScriptModeType scriptMode = SCRIPT_MODE_EDEFAULT;
067:
068: /**
069: * The cached value of the '{@link #getFtpBase() <em>Ftp Base</em>}' containment reference.
070: * <!-- begin-user-doc -->
071: * <!-- end-user-doc -->
072: * @see #getFtpBase()
073: * @generated
074: * @ordered
075: */
076: protected FTPBase ftpBase = null;
077:
078: /**
079: * <!-- begin-user-doc -->
080: * <!-- end-user-doc -->
081: * @generated NOT
082: */
083: protected FTPImpl() {
084: super ();
085:
086: FTPBase ftpBase = componentflowFactory.eINSTANCE
087: .createFTPBase();
088:
089: FTPConsumer ftpRead = componentflowFactory.eINSTANCE
090: .createFTPConsumer();
091: FileCompletion ftpCompletion = componentflowFactory.eINSTANCE
092: .createFileCompletion();
093: FileCompletion fileProviderCompletion = componentflowFactory.eINSTANCE
094: .createFileCompletion();
095:
096: FtpReply ftpReply = componentflowFactory.eINSTANCE
097: .createFtpReply();
098:
099: ftpRead.setFileCompletion(ftpCompletion);
100:
101: ftpRead.setFtpReply(ftpReply);
102:
103: FTPProvider ftpWrite = componentflowFactory.eINSTANCE
104: .createFTPProvider();
105: ftpWrite.setFileCompletion(fileProviderCompletion);
106:
107: //
108: this .setFtpBase(ftpBase);
109: ftpBase.setFtpConsumer(ftpRead);
110: ftpBase.setFtpProvider(ftpWrite);
111:
112: }
113:
114: /**
115: * <!-- begin-user-doc -->
116: * <!-- end-user-doc -->
117: * @generated
118: */
119: protected EClass eStaticClass() {
120: return componentflowPackage.Literals.FTP;
121: }
122:
123: /**
124: * <!-- begin-user-doc -->
125: * <!-- end-user-doc -->
126: * @generated
127: */
128: public FTPScriptModeType getScriptMode() {
129: return scriptMode;
130: }
131:
132: /**
133: * <!-- begin-user-doc -->
134: * <!-- end-user-doc -->
135: * @generated
136: */
137: public void setScriptMode(FTPScriptModeType newScriptMode) {
138: FTPScriptModeType oldScriptMode = scriptMode;
139: scriptMode = newScriptMode == null ? SCRIPT_MODE_EDEFAULT
140: : newScriptMode;
141: if (eNotificationRequired())
142: eNotify(new ENotificationImpl(this , Notification.SET,
143: componentflowPackage.FTP__SCRIPT_MODE,
144: oldScriptMode, scriptMode));
145: }
146:
147: /**
148: * <!-- begin-user-doc -->
149: * <!-- end-user-doc -->
150: * @generated
151: */
152: public FTPBase getFtpBase() {
153: return ftpBase;
154: }
155:
156: /**
157: * <!-- begin-user-doc -->
158: * <!-- end-user-doc -->
159: * @generated
160: */
161: public NotificationChain basicSetFtpBase(FTPBase newFtpBase,
162: NotificationChain msgs) {
163: FTPBase oldFtpBase = ftpBase;
164: ftpBase = newFtpBase;
165: if (eNotificationRequired()) {
166: ENotificationImpl notification = new ENotificationImpl(
167: this , Notification.SET,
168: componentflowPackage.FTP__FTP_BASE, oldFtpBase,
169: newFtpBase);
170: if (msgs == null)
171: msgs = notification;
172: else
173: msgs.add(notification);
174: }
175: return msgs;
176: }
177:
178: /**
179: * <!-- begin-user-doc -->
180: * <!-- end-user-doc -->
181: * @generated
182: */
183: public void setFtpBase(FTPBase newFtpBase) {
184: if (newFtpBase != ftpBase) {
185: NotificationChain msgs = null;
186: if (ftpBase != null)
187: msgs = ((InternalEObject) ftpBase).eInverseRemove(this ,
188: EOPPOSITE_FEATURE_BASE
189: - componentflowPackage.FTP__FTP_BASE,
190: null, msgs);
191: if (newFtpBase != null)
192: msgs = ((InternalEObject) newFtpBase).eInverseAdd(this ,
193: EOPPOSITE_FEATURE_BASE
194: - componentflowPackage.FTP__FTP_BASE,
195: null, msgs);
196: msgs = basicSetFtpBase(newFtpBase, msgs);
197: if (msgs != null)
198: msgs.dispatch();
199: } else if (eNotificationRequired())
200: eNotify(new ENotificationImpl(this , Notification.SET,
201: componentflowPackage.FTP__FTP_BASE, newFtpBase,
202: newFtpBase));
203: }
204:
205: /**
206: * <!-- begin-user-doc -->
207: * <!-- end-user-doc -->
208: * @generated
209: */
210: public NotificationChain eInverseRemove(InternalEObject otherEnd,
211: int featureID, NotificationChain msgs) {
212: switch (featureID) {
213: case componentflowPackage.FTP__FTP_BASE:
214: return basicSetFtpBase(null, msgs);
215: }
216: return super .eInverseRemove(otherEnd, featureID, msgs);
217: }
218:
219: /**
220: * <!-- begin-user-doc -->
221: * <!-- end-user-doc -->
222: * @generated
223: */
224: public Object eGet(int featureID, boolean resolve, boolean coreType) {
225: switch (featureID) {
226: case componentflowPackage.FTP__SCRIPT_MODE:
227: return getScriptMode();
228: case componentflowPackage.FTP__FTP_BASE:
229: return getFtpBase();
230: }
231: return super .eGet(featureID, resolve, coreType);
232: }
233:
234: /**
235: * <!-- begin-user-doc -->
236: * <!-- end-user-doc -->
237: * @generated
238: */
239: public void eSet(int featureID, Object newValue) {
240: switch (featureID) {
241: case componentflowPackage.FTP__SCRIPT_MODE:
242: setScriptMode((FTPScriptModeType) newValue);
243: return;
244: case componentflowPackage.FTP__FTP_BASE:
245: setFtpBase((FTPBase) newValue);
246: return;
247: }
248: super .eSet(featureID, newValue);
249: }
250:
251: /**
252: * <!-- begin-user-doc -->
253: * <!-- end-user-doc -->
254: * @generated
255: */
256: public void eUnset(int featureID) {
257: switch (featureID) {
258: case componentflowPackage.FTP__SCRIPT_MODE:
259: setScriptMode(SCRIPT_MODE_EDEFAULT);
260: return;
261: case componentflowPackage.FTP__FTP_BASE:
262: setFtpBase((FTPBase) null);
263: return;
264: }
265: super .eUnset(featureID);
266: }
267:
268: /**
269: * <!-- begin-user-doc -->
270: * <!-- end-user-doc -->
271: * @generated
272: */
273: public boolean eIsSet(int featureID) {
274: switch (featureID) {
275: case componentflowPackage.FTP__SCRIPT_MODE:
276: return scriptMode != SCRIPT_MODE_EDEFAULT;
277: case componentflowPackage.FTP__FTP_BASE:
278: return ftpBase != null;
279: }
280: return super .eIsSet(featureID);
281: }
282:
283: /**
284: * <!-- begin-user-doc -->
285: * <!-- end-user-doc -->
286: * @generated
287: */
288: public String toString() {
289: if (eIsProxy())
290: return super .toString();
291:
292: StringBuffer result = new StringBuffer(super .toString());
293: result.append(" (scriptMode: ");
294: result.append(scriptMode);
295: result.append(')');
296: return result.toString();
297: }
298:
299: /**
300: * <!-- begin-user-doc -->
301: * <!-- end-user-doc -->
302: * @generated NOT
303: */
304: public Consumer getConsumer() {
305: return this .getFtpBase().getFtpConsumer();
306: }
307:
308: @Override
309: /**
310: * <!-- begin-user-doc -->
311: * <!-- end-user-doc -->
312: * @generated NOT
313: */
314: public Provider getProvider() {
315: return this .getFtpBase().getFtpProvider();
316: }
317:
318: } //FTPImpl
|