Remove incomplete BC from the selection list merged_model_after_merge_trunk_1
authortli@netbeans.org
Fri, 13 Apr 2007 15:56:00 +0000
changeset 3418112dbc46383
parent 340 bdcf0c1b4742
child 342 608a0abc0bfe
Remove incomplete BC from the selection list
compapp.casaeditor/src/org/netbeans/modules/compapp/casaeditor/nodes/actions/AddWSDLPortsAction.java
     1.1 --- a/compapp.casaeditor/src/org/netbeans/modules/compapp/casaeditor/nodes/actions/AddWSDLPortsAction.java	Fri Apr 13 14:45:06 2007 +0000
     1.2 +++ b/compapp.casaeditor/src/org/netbeans/modules/compapp/casaeditor/nodes/actions/AddWSDLPortsAction.java	Fri Apr 13 15:56:00 2007 +0000
     1.3 @@ -25,16 +25,16 @@
     1.4  import java.awt.event.ActionEvent;
     1.5  import java.awt.event.ActionListener;
     1.6  import java.lang.ref.WeakReference;
     1.7 -import java.util.Arrays;
     1.8 -import java.util.HashMap;
     1.9 -import java.util.List;
    1.10 -import java.util.Map;
    1.11 +import java.util.*;
    1.12  import javax.swing.AbstractAction;
    1.13  import javax.swing.Action;
    1.14  import org.netbeans.modules.compapp.casaeditor.CasaDataObject;
    1.15  import org.netbeans.modules.compapp.casaeditor.model.casa.CasaWrapperModel;
    1.16  import org.netbeans.modules.compapp.projects.jbi.api.JbiBindingInfo;
    1.17  import org.netbeans.modules.compapp.projects.jbi.api.JbiDefaultComponentInfo;
    1.18 +import org.netbeans.modules.xml.wsdl.ui.view.wizard.ExtensibilityElementTemplateFactory;
    1.19 +import org.netbeans.modules.xml.wsdl.ui.view.wizard.TemplateGroup;
    1.20 +import org.netbeans.modules.xml.wsdl.ui.view.wizard.localized.LocalizedTemplateGroup;
    1.21  import org.openide.DialogDescriptor;
    1.22  import org.openide.DialogDisplayer;
    1.23  import org.openide.util.NbBundle;
    1.24 @@ -70,7 +70,21 @@
    1.25          }
    1.26      }
    1.27  
    1.28 -    
    1.29 +    private HashMap getWsdlTemplates() {
    1.30 +        ExtensibilityElementTemplateFactory factory = new ExtensibilityElementTemplateFactory();
    1.31 +        Collection<TemplateGroup> groups = factory.getExtensibilityElementTemplateGroups();
    1.32 +        Vector<LocalizedTemplateGroup> protocols = new Vector<LocalizedTemplateGroup>();
    1.33 +        LocalizedTemplateGroup ltg = null;
    1.34 +        HashMap temps = new HashMap();
    1.35 +        for (TemplateGroup group : groups) {
    1.36 +            ltg = factory.getLocalizedTemplateGroup(group);
    1.37 +            protocols.add(ltg);
    1.38 +            temps.put(ltg.getName(), ltg);
    1.39 +        }
    1.40 +
    1.41 +        return temps;
    1.42 +    }
    1.43 +
    1.44      public void performAction(final Point location) {
    1.45          
    1.46          CasaDataObject dataObject = mReference.get();
    1.47 @@ -84,9 +98,13 @@
    1.48  
    1.49          JbiDefaultComponentInfo bcinfo = JbiDefaultComponentInfo.getJbiDefaultComponentInfo();
    1.50          if (bcinfo != null) {
    1.51 +            HashMap bcTemplates = getWsdlTemplates();
    1.52              List<JbiBindingInfo> bclist = bcinfo.getBindingInfoList();
    1.53              for (JbiBindingInfo bi : bclist) {
    1.54 -                portMap.put(bi.getBindingName(), bi);
    1.55 +                String biName = bi.getBindingName().toUpperCase();
    1.56 +                if (bcTemplates.get(biName) != null) {
    1.57 +                    portMap.put(bi.getBindingName(), bi);
    1.58 +                }
    1.59              }
    1.60          }
    1.61          String[] ports = portMap.keySet().toArray(new String[0]);