01: /*
02: * ChainBuilder ESB
03: * Visual Enterprise Integration
04: *
05: * Copyright (C) 2006 Bostech Corporation
06: *
07: * This program is free software; you can redistribute it and/or modify it
08: * under the terms of the GNU General Public License as published by the
09: * Free Software Foundation; either version 2 of the License, or (at your option)
10: * any later version.
11: *
12: * This program is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14: * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15: * for more details.
16: *
17: * You should have received a copy of the GNU General Public License along with
18: * this program; if not, write to the Free Software Foundation, Inc.,
19: * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20: *
21: *
22: * $Id$
23: */
24: package com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.diagram.providers;
25:
26: import org.eclipse.emf.common.notify.AdapterFactory;
27: import org.eclipse.emf.edit.provider.IItemPropertySource;
28: import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
29: import org.eclipse.emf.edit.ui.provider.PropertySource;
30: import org.eclipse.ui.views.properties.IPropertySource;
31:
32: import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.Email;
33: import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.FTP;
34: import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.File;
35: import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.HTTP;
36: import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.JMS;
37: import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.Script;
38: import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.ServiceEngine;
39: import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.TCPIP;
40: import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.diagram.providers.email.EmailPropertySource;
41: import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.diagram.providers.file.FileCompoundPropertySource;
42: import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.diagram.providers.ftp.FTPCompoundPropertySource;
43: import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.diagram.providers.http.HTTPPropertySource;
44: import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.diagram.providers.jms.JMSCompoundPropertySource;
45: import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.diagram.providers.script.ScriptCompoundPropertySource;
46: import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.diagram.providers.tcpip.TCPIPCompoundPropertySource;
47:
48: public class ComponentFlowEditorAdapterFactoryContentProvider extends
49: AdapterFactoryContentProvider {
50:
51: /**
52: * @param adapterFactory
53: */
54: public ComponentFlowEditorAdapterFactoryContentProvider(
55: AdapterFactory adapterFactory) {
56: super (adapterFactory);
57: }
58:
59: protected IPropertySource createPropertySource(Object object,
60: IItemPropertySource itemPropertySource) {
61: if (object instanceof HTTP) {
62: return new HTTPPropertySource((HTTP) object, adapterFactory);
63: } else if (object instanceof File) {
64: return new FileCompoundPropertySource((File) object,
65: adapterFactory);
66: } else if (object instanceof JMS) {
67: return new JMSCompoundPropertySource((JMS) object,
68: adapterFactory);
69: } else if (object instanceof FTP) {
70: return new FTPCompoundPropertySource((FTP) object,
71: adapterFactory);
72: } else if (object instanceof Script) {
73: return new ScriptCompoundPropertySource(object,
74: adapterFactory);
75: } else if (object instanceof TCPIP) {
76: return new TCPIPCompoundPropertySource(object,
77: adapterFactory);
78: } else if (object instanceof Email) {
79: return new EmailPropertySource(object, adapterFactory);
80: }
81:
82: else if (object instanceof ServiceEngine) {
83: return new ComponentFlowEditorElementPropertySource(object,
84: adapterFactory);
85: }
86:
87: else {
88: return new PropertySource(object, itemPropertySource);
89: }
90:
91: }
92:
93: }
|