001: /*
002: * ChainBuilder ESB
003: * Visual Enterprise Integration
004: *
005: * Copyright (C) 2006 Bostech Corporation
006: *
007: * This program is free software; you can redistribute it and/or modify it
008: * under the terms of the GNU General Public License as published by the
009: * Free Software Foundation; either version 2 of the License, or (at your option)
010: * any later version.
011: *
012: * This program is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
014: * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
015: * for more details.
016: *
017: * You should have received a copy of the GNU General Public License along with
018: * this program; if not, write to the Free Software Foundation, Inc.,
019: * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
020: *
021: *
022: * $Id: CBRCompoundPropertySource.java 5803 2007-03-06 01:57:10Z lzheng $
023: */
024: package com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.diagram.providers;
025:
026: import java.util.ArrayList;
027: import java.util.List;
028:
029: import org.eclipse.core.runtime.Assert;
030: import org.eclipse.emf.common.notify.AdapterFactory;
031: import org.eclipse.emf.edit.provider.IItemPropertySource;
032: import org.eclipse.ui.views.properties.PropertyDescriptor;
033:
034: import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.ComponentFlowEditorElement;
035: import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.ProviderCCSL;
036: import com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.ServiceEngine;
037:
038: /**
039: *
040: */
041: public class ComponentFlowEditorElementPropertySource extends
042: ComponentFlowEditorBasicCompoundPropertySource {
043:
044: //Category unique keys
045: public static final String C_WSDL_CCSL = "c.ccsl.provider";
046:
047: //Category display keys
048: public static final String C_DISPLAY_WSDL_CCSL = "CCSL.Provider";
049:
050: private ProviderCCSL providerCCSL;
051: private IItemPropertySource providerCCSLPropertySource;
052:
053: /**
054: * @param object
055: * @param itemPropertySource
056: */
057: public ComponentFlowEditorElementPropertySource(Object object,
058: AdapterFactory adapterFactory) {
059: super (object, adapterFactory);
060: Assert.isTrue(object instanceof ComponentFlowEditorElement);
061: this .providerCCSL = ((ComponentFlowEditorElement) object)
062: .getProviderCCSL();
063: this .providerCCSLPropertySource = getIItemPropertySourceAdapter(providerCCSL);
064:
065: //add them and children
066: add(getIItemPropertySourceAdapter(object), object);
067: }
068:
069: protected List getSubLevelPropertyDescriptorList() {
070: List result = new ArrayList();
071: updateSubSourcesMap();
072: result.add(new PropertyDescriptor(C_WSDL_CCSL,
073: C_DISPLAY_WSDL_CCSL));
074: return result;
075: }
076:
077: protected void updateSubSourcesMap() {
078:
079: // subSourcesMap.put(C_WSDL_DOCUMENT, new ParserWSDLDocumentCompoundPropertySource(parserWSDL, adapterFactory));
080:
081: subSourcesMap.put(C_WSDL_CCSL,
082: new ProviderCCSLCompoundPropertySource(providerCCSL,
083: adapterFactory));
084: }
085:
086: /* (non-Javadoc)
087: * @see com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.diagram.providers.ComponentFlowEditorBasicCompoundPropertySource#getPropertyValue(java.lang.Object)
088: */
089: public Object getPropertyValue(Object id) {
090: if (id.equals(C_WSDL_CCSL)) {
091: Object obj = subSourcesMap.get(C_WSDL_CCSL);
092: // Assert.isTrue(obj instanceof SequencerWSDLDocumentCompoundPropertySource);
093: return obj;
094: }
095: return super .getPropertyValue(id);
096: }
097:
098: /* (non-Javadoc)
099: * @see com.bostechcorp.cbesb.ui.componentflow.componentFlowEditor.diagram.providers.ComponentFlowEditorBasicCompoundPropertySource#isPropertySet(java.lang.Object)
100: */
101: public boolean isPropertySet(Object id) {
102: if (id.equals(C_WSDL_CCSL))
103: return true;
104: return super.isPropertySet(id);
105: }
106:
107: }
|