Restore ldif file
authorVladimir Yaroslavskiy <yaroslavskiy@netbeans.org>
Wed, 09 Jun 2010 18:55:07 +0400
changeset 399784f8f8f1a4e6
parent 3996 819c08aa5305
child 3998 e780f103797c
Restore ldif file
bpel.core/src/org/netbeans/modules/bpel/core/resources/layer.xml
wsdlextensions.ldap/manifest.mf
wsdlextensions.ldap/nbproject/project.xml
wsdlextensions.ldap/src/org/netbeans/modules/wsdlextensions/ldap/resources/Bundle.properties
wsdlextensions.ldap/src/org/netbeans/modules/wsdlextensions/ldap/resources/Bundle_ja.properties
wsdlextensions.ldap/src/org/netbeans/modules/wsdlextensions/ldap/resources/Bundle_zh_CN.properties
wsdlextensions.ldap/src/org/netbeans/modules/wsdlextensions/ldap/resources/LTemplate.html
wsdlextensions.ldap/src/org/netbeans/modules/wsdlextensions/ldap/resources/NewFileIterator.java
wsdlextensions.ldap/src/org/netbeans/modules/wsdlextensions/ldap/resources/NewFilePanel.java
wsdlextensions.ldap/src/org/netbeans/modules/wsdlextensions/ldap/resources/NewOptionsPanel.java
wsdlextensions.ldap/src/org/netbeans/modules/wsdlextensions/ldap/resources/layer.xml
wsdlextensions.ldap/test/unit/src/META-INF/services/org.openide.loaders.DataLoader
     1.1 --- a/bpel.core/src/org/netbeans/modules/bpel/core/resources/layer.xml	Wed Jun 09 14:28:10 2010 +0400
     1.2 +++ b/bpel.core/src/org/netbeans/modules/bpel/core/resources/layer.xml	Wed Jun 09 18:55:07 2010 +0400
     1.3 @@ -48,6 +48,7 @@
     1.4          <folder name="SOA_BPEL">
     1.5              <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.bpel.core.wizard.Bundle"/>
     1.6              <attr name="position" intvalue="102"/>
     1.7 +
     1.8              <file name="Process.bpel" url="BpelProcess.template">
     1.9                  <attr name="SystemFileSystem.icon" urlvalue="nbresloc:/org/netbeans/modules/bpel/core/resources/bp_file.gif"/>
    1.10                  <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.bpel.core.wizard.Bundle"/>
     2.1 --- a/wsdlextensions.ldap/manifest.mf	Wed Jun 09 14:28:10 2010 +0400
     2.2 +++ b/wsdlextensions.ldap/manifest.mf	Wed Jun 09 18:55:07 2010 +0400
     2.3 @@ -2,7 +2,7 @@
     2.4  AutoUpdate-Show-In-Client: false
     2.5  OpenIDE-Module-Specification-Version: 6.9
     2.6  OpenIDE-Module: org.netbeans.modules.wsdlextensions.ldap
     2.7 -OpenIDE-Module-Layer: org/netbeans/modules/wsdlextensions/ldap/resources/layer.xml
     2.8 +OpenIDE-Module-Layer: org/netbeans/modules/wsdlextensions/ldap\resources/layer.xml
     2.9  OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/wsdlextensions/ldap/resources/Bundle.properties
    2.10  
    2.11  Name: org/netbeans/modules/wsdlextensions/ldap/ldif/LDataLoader.class
     3.1 --- a/wsdlextensions.ldap/nbproject/project.xml	Wed Jun 09 14:28:10 2010 +0400
     3.2 +++ b/wsdlextensions.ldap/nbproject/project.xml	Wed Jun 09 18:55:07 2010 +0400
     3.3 @@ -174,6 +174,15 @@
     3.4                          <specification-version>6.9</specification-version>
     3.5                      </run-dependency>
     3.6                  </dependency>
     3.7 +                <dependency>
     3.8 +                    <code-name-base>org.netbeans.modules.java.project</code-name-base>
     3.9 +                    <build-prerequisite/>
    3.10 +                    <compile-dependency/>
    3.11 +                    <run-dependency>
    3.12 +                        <release-version>1</release-version>
    3.13 +                        <specification-version>1.8.11</specification-version>
    3.14 +                    </run-dependency>
    3.15 +                </dependency>
    3.16              </module-dependencies>
    3.17              <public-packages/>
    3.18          </data>
     4.1 --- a/wsdlextensions.ldap/src/org/netbeans/modules/wsdlextensions/ldap/resources/Bundle.properties	Wed Jun 09 14:28:10 2010 +0400
     4.2 +++ b/wsdlextensions.ldap/src/org/netbeans/modules/wsdlextensions/ldap/resources/Bundle.properties	Wed Jun 09 18:55:07 2010 +0400
     4.3 @@ -20,12 +20,16 @@
     4.4  OpenIDE-Module-Short-Description=LDAP extension for wsdl editor.
     4.5  OpenIDE-Module-Long-Description=This module provides ldap schema and plugs into wsdl editor.
     4.6  OpenIDE-Module-Display-Category=SOA
     4.7 +
     4.8  Services/MIMEResolver/LdifResolver.xml=Ldif Files
     4.9  Services/MIMEResolver/LResolver.xml=L Files
    4.10 -Templates/ESB=ESB
    4.11 -Templates/ESB/LTemplate.ldif=Empty LDIF file
    4.12 -Templates/ESB/serverBrowser=WSDL from LDAP Server...
    4.13 -WSDLEditor/Binding/LDAPBinding= LDAP Binding
    4.14 +
    4.15 +Templates/SOA_BPEL/LTemplate.ldif=Empty LDIF file
    4.16 +Templates/SOA_BPEL/serverBrowser=WSDL from LDAP Server...
    4.17 +LBL_SimpleTargetChooserPanel_FileName_Label=File Name:
    4.18 +TITLE_x_of_y={0} of {1}
    4.19 +
    4.20 +WSDLEditor/Binding/LDAPBinding=LDAP Binding
    4.21  WSDLEditor/BindingOperation/LDAPBindingOperation= LDAP Operation
    4.22  WSDLEditor/BindingOperationInput/LDAPBindingOperationInput= LDAP Operation Input
    4.23  WSDLEditor/BindingOperationOutput/LDAPBindingOperationOutput= LDAP Operation Output
     5.1 --- a/wsdlextensions.ldap/src/org/netbeans/modules/wsdlextensions/ldap/resources/Bundle_ja.properties	Wed Jun 09 14:28:10 2010 +0400
     5.2 +++ b/wsdlextensions.ldap/src/org/netbeans/modules/wsdlextensions/ldap/resources/Bundle_ja.properties	Wed Jun 09 18:55:07 2010 +0400
     5.3 @@ -24,10 +24,8 @@
     5.4  OpenIDE-Module-Display-Category=SOA
     5.5  Services/MIMEResolver/LdifResolver.xml=LDIF \u30d5\u30a1\u30a4\u30eb
     5.6  Services/MIMEResolver/LResolver.xml=L \u30d5\u30a1\u30a4\u30eb
     5.7 -Templates/SOA_BPEL=SOA
     5.8 -Templates/ESB=ESB
     5.9 -Templates/ESB/LTemplate.ldif=\u7a7a\u306e LDIF \u30d5\u30a1\u30a4\u30eb
    5.10 -Templates/ESB/serverBrowser=LDAP \u30b5\u30fc\u30d0\u30fc\u306e WSDL...
    5.11 +Templates/SOA_BPEL/LTemplate.ldif=\u7a7a\u306e LDIF \u30d5\u30a1\u30a4\u30eb
    5.12 +Templates/SOA_BPEL/serverBrowser=LDAP \u30b5\u30fc\u30d0\u30fc\u306e WSDL...
    5.13  WSDLEditor/Binding/LDAPBinding= LDAP \u7d50\u5408
    5.14  WSDLEditor/BindingOperation/LDAPBindingOperation= LDAP \u64cd\u4f5c
    5.15  WSDLEditor/BindingOperationInput/LDAPBindingOperationInput= LDAP \u5165\u529b\u64cd\u4f5c
     6.1 --- a/wsdlextensions.ldap/src/org/netbeans/modules/wsdlextensions/ldap/resources/Bundle_zh_CN.properties	Wed Jun 09 14:28:10 2010 +0400
     6.2 +++ b/wsdlextensions.ldap/src/org/netbeans/modules/wsdlextensions/ldap/resources/Bundle_zh_CN.properties	Wed Jun 09 18:55:07 2010 +0400
     6.3 @@ -24,10 +24,8 @@
     6.4  OpenIDE-Module-Display-Category=SOA
     6.5  Services/MIMEResolver/LdifResolver.xml=LDIF \u6587\u4ef6
     6.6  Services/MIMEResolver/LResolver.xml=L \u6587\u4ef6
     6.7 -Templates/SOA_BPEL=SOA
     6.8 -Templates/ESB=ESB
     6.9 -Templates/ESB/LTemplate.ldif=\u7a7a LDIF \u6587\u4ef6
    6.10 -Templates/ESB/serverBrowser=\u6765\u81ea LDAP \u670d\u52a1\u5668\u7684 WSDL...
    6.11 +Templates/SOA_BPEL/LTemplate.ldif=\u7a7a LDIF \u6587\u4ef6
    6.12 +Templates/SOA_BPEL/serverBrowser=\u6765\u81ea LDAP \u670d\u52a1\u5668\u7684 WSDL...
    6.13  WSDLEditor/Binding/LDAPBinding= LDAP \u7ed1\u5b9a
    6.14  WSDLEditor/BindingOperation/LDAPBindingOperation= LDAP \u64cd\u4f5c
    6.15  WSDLEditor/BindingOperationInput/LDAPBindingOperationInput= LDAP \u64cd\u4f5c\u8f93\u5165
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/wsdlextensions.ldap/src/org/netbeans/modules/wsdlextensions/ldap/resources/LTemplate.html	Wed Jun 09 18:55:07 2010 +0400
     7.3 @@ -0,0 +1,8 @@
     7.4 +<html>
     7.5 +    <head>
     7.6 +    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
     7.7 +    </head>
     7.8 +    <BODY>
     7.9 +        This wizard creates empty LDIF file.
    7.10 +    </BODY>
    7.11 +</HTML>
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/wsdlextensions.ldap/src/org/netbeans/modules/wsdlextensions/ldap/resources/NewFileIterator.java	Wed Jun 09 18:55:07 2010 +0400
     8.3 @@ -0,0 +1,293 @@
     8.4 +/*
     8.5 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
     8.6 + *
     8.7 + * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
     8.8 + *
     8.9 + * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
    8.10 + * Other names may be trademarks of their respective owners.
    8.11 + *
    8.12 + * The contents of this file are subject to the terms of either the GNU
    8.13 + * General Public License Version 2 only ("GPL") or the Common
    8.14 + * Development and Distribution License("CDDL") (collectively, the
    8.15 + * "License"). You may not use this file except in compliance with the
    8.16 + * License. You can obtain a copy of the License at
    8.17 + * http://www.netbeans.org/cddl-gplv2.html
    8.18 + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
    8.19 + * specific language governing permissions and limitations under the
    8.20 + * License.  When distributing the software, include this License Header
    8.21 + * Notice in each file and include the License file at
    8.22 + * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
    8.23 + * particular file as subject to the "Classpath" exception as provided
    8.24 + * by Oracle in the GPL Version 2 section of the License file that
    8.25 + * accompanied this code. If applicable, add the following below the
    8.26 + * License Header, with the fields enclosed by brackets [] replaced by
    8.27 + * your own identifying information:
    8.28 + * "Portions Copyrighted [year] [name of copyright owner]"
    8.29 + *
    8.30 + * Contributor(s):
    8.31 + *
    8.32 + * The Original Software is NetBeans. The Initial Developer of the Original
    8.33 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
    8.34 + * Microsystems, Inc. All Rights Reserved.
    8.35 + *
    8.36 + * If you wish your version of this file to be governed by only the CDDL
    8.37 + * or only the GPL Version 2, indicate your decision by adding
    8.38 + * "[Contributor] elects to include this software in this distribution
    8.39 + * under the [CDDL or GPL Version 2] license." If you do not indicate a
    8.40 + * single choice of license, a recipient has the option to distribute
    8.41 + * your version of this file under either the CDDL, the GPL Version 2 or
    8.42 + * to extend the choice of license to its licensees as provided above.
    8.43 + * However, if you add GPL Version 2 code and therefore, elected the GPL
    8.44 + * Version 2 license, then the option applies only if the new code is
    8.45 + * made subject to such option by the copyright holder.
    8.46 + */
    8.47 +package org.netbeans.modules.wsdlextensions.resources;
    8.48 +
    8.49 +import java.awt.Component;
    8.50 +import java.awt.Container;
    8.51 +import java.util.Collection;
    8.52 +import java.util.Iterator;
    8.53 +import java.util.Vector;
    8.54 +
    8.55 +import javax.swing.JComponent;
    8.56 +import javax.swing.JLabel;
    8.57 +import javax.swing.text.JTextComponent;
    8.58 +
    8.59 +import org.openide.WizardDescriptor;
    8.60 +
    8.61 +import java.awt.Dimension;
    8.62 +import java.io.BufferedReader;
    8.63 +import java.io.BufferedWriter;
    8.64 +import java.io.IOException;
    8.65 +import java.io.InputStreamReader;
    8.66 +import java.io.OutputStreamWriter;
    8.67 +import java.io.Writer;
    8.68 +import java.util.Collections;
    8.69 +import java.util.NoSuchElementException;
    8.70 +import java.util.Set;
    8.71 +import javax.swing.JComponent;
    8.72 +import javax.swing.JTextField;
    8.73 +import javax.swing.event.ChangeListener;
    8.74 +import org.netbeans.api.java.project.JavaProjectConstants;
    8.75 +
    8.76 +import org.openide.filesystems.FileObject;
    8.77 +import org.openide.filesystems.FileUtil;
    8.78 +import org.openide.WizardDescriptor;
    8.79 +import org.openide.loaders.DataFolder;
    8.80 +import org.openide.loaders.DataObject;
    8.81 +import org.openide.loaders.TemplateWizard;
    8.82 +import org.openide.util.NbBundle;
    8.83 +
    8.84 +import org.netbeans.spi.project.ui.templates.support.Templates;
    8.85 +import org.netbeans.api.project.Project;
    8.86 +import org.netbeans.api.project.Sources;
    8.87 +import org.netbeans.api.project.SourceGroup;
    8.88 +import org.openide.ErrorManager;
    8.89 +
    8.90 +/**
    8.91 + * A template wizard iterator (sequence of panels).
    8.92 + * Used to fill in the second and subsequent panels in the New wizard.
    8.93 + * Associate this to a template inside a layer using the
    8.94 + * Sequence of Panels extra property.
    8.95 + * Create one or more panels from template as needed too.
    8.96 + */
    8.97 +public class NewFileIterator implements TemplateWizard.Iterator {
    8.98 +    
    8.99 +    private static final long serialVersionUID = 1L;
   8.100 +    public static final Dimension PREF_SIZE = new Dimension(560,350);
   8.101 +    
   8.102 +    protected WizardDescriptor.Panel[] createPanels(Project project, TemplateWizard wizard) {
   8.103 +        Sources sources = (Sources) project.getLookup().lookup(Sources.class);
   8.104 +        sourceGroups = sources.getSourceGroups(Sources.TYPE_GENERIC);
   8.105 +        
   8.106 +        if(sourceGroups.length == 0 ) {  
   8.107 +            sourceGroups = sources.getSourceGroups(JavaProjectConstants.SOURCES_TYPE_JAVA);
   8.108 +        }
   8.109 +        folderPanel=new NewFilePanel(project,sourceGroups);
   8.110 +        
   8.111 +        if(sourceGroups.length > 0 && sourceGroups[0] != null) {
   8.112 +            DataFolder folder = DataFolder.findFolder(sourceGroups[0].getRootFolder());
   8.113 +            DataFolder projectFolder = DataFolder.findFolder(project.getProjectDirectory());
   8.114 +            try {
   8.115 +                if (wizard.getTargetFolder().equals(projectFolder)) {
   8.116 +                    wizard.setTargetFolder(folder);
   8.117 +                }
   8.118 +            } catch (IOException ioe) {
   8.119 +                ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, ioe);
   8.120 +            }
   8.121 +        }
   8.122 +        WizardDescriptor.Panel firstPanel = Templates.createSimpleTargetChooser(project,sourceGroups,folderPanel);
   8.123 +        JComponent c = (JComponent)firstPanel.getComponent();
   8.124 +        String fileNameLabel = NbBundle.getMessage(NewFileIterator.class, "LBL_SimpleTargetChooserPanel_FileName_Label"); // NOI18N
   8.125 +        ((NewFilePanel)folderPanel).setNameTF((JTextField) findTextFieldForLabel(c,fileNameLabel));
   8.126 +        
   8.127 +        return new WizardDescriptor.Panel[] {
   8.128 +            firstPanel
   8.129 +        };
   8.130 +    }
   8.131 +    
   8.132 +    public Set instantiate(TemplateWizard aWiz) throws IOException {
   8.133 +      NewFilePanel panel = (NewFilePanel)folderPanel;
   8.134 +      org.openide.filesystems.FileObject dir = Templates.getTargetFolder(wiz);
   8.135 +      DataObject data = createProcess(Templates.getTargetName(wiz), Templates.getTemplate(wiz), dir);
   8.136 +      return Collections.singleton(data);
   8.137 +    }
   8.138 +
   8.139 +    public void initialize(TemplateWizard aWiz) {
   8.140 +        this.wiz = aWiz;
   8.141 +        index = 0;
   8.142 +        Project project = Templates.getProject(wiz);
   8.143 +        panels = createPanels(project, wiz);
   8.144 +        
   8.145 +        // Creating steps.
   8.146 +        Object prop = wiz.getProperty(WizardDescriptor.PROP_CONTENT_DATA); // NOI18N
   8.147 +        String[] beforeSteps = null;
   8.148 +        if (prop != null && prop instanceof String[]) {
   8.149 +            beforeSteps = (String[])prop;
   8.150 +        }
   8.151 +        String[] steps = createSteps(beforeSteps, panels);
   8.152 +        
   8.153 +        for (int i = 0; i < panels.length; i++) {
   8.154 +            Component c = panels[i].getComponent();
   8.155 +            if (steps[i] == null) {
   8.156 +                // Default step name to component name of panel.
   8.157 +                // Mainly useful for getting the name of the target
   8.158 +                // chooser to appear in the list of steps.
   8.159 +                steps[i] = c.getName();
   8.160 +            }
   8.161 +            if (c instanceof JComponent) { // assume Swing components
   8.162 +                JComponent jc = (JComponent) c;
   8.163 +                jc.putClientProperty(WizardDescriptor.PROP_CONTENT_SELECTED_INDEX, Integer.valueOf(i));
   8.164 +                jc.putClientProperty(WizardDescriptor.PROP_CONTENT_DATA, steps);
   8.165 +            }
   8.166 +        }
   8.167 +    }
   8.168 +    public void uninitialize(TemplateWizard aWiz) {
   8.169 +        this.wiz = null;
   8.170 +        panels = null;
   8.171 +    }
   8.172 +    
   8.173 +    public String name() {
   8.174 +        return NbBundle.getMessage(NewFileIterator.class, "TITLE_x_of_y", index + 1, panels.length); // NOI18N
   8.175 +    }
   8.176 +    
   8.177 +    public boolean hasNext() {
   8.178 +        return index < panels.length - 1;
   8.179 +    }
   8.180 +    public boolean hasPrevious() {
   8.181 +        return index > 0;
   8.182 +    }
   8.183 +    public void nextPanel() {
   8.184 +        if (! hasNext()) {
   8.185 +            throw new NoSuchElementException();
   8.186 +        }
   8.187 +        index++;
   8.188 +    }
   8.189 +    public void previousPanel() {
   8.190 +        if (! hasPrevious()) {
   8.191 +            throw new NoSuchElementException();
   8.192 +        }
   8.193 +        index--;
   8.194 +    }
   8.195 +    public WizardDescriptor.Panel current() {
   8.196 +        return panels[index];
   8.197 +    }
   8.198 +
   8.199 +    public final void addChangeListener(ChangeListener l) {}
   8.200 +    public final void removeChangeListener(ChangeListener l) {}
   8.201 +    
   8.202 +    private static DataObject createProcess(String processName, FileObject template, FileObject srcFolder) throws IOException {
   8.203 +//System.out.println();
   8.204 +        DataFolder src = DataFolder.findFolder(srcFolder);
   8.205 +//System.out.println("       src: " + src);
   8.206 +        DataObject dTemplate = DataObject.find(template);
   8.207 +        DataObject data = dTemplate.createFromTemplate(src, processName);
   8.208 +//System.out.println("  Name: " + processName);
   8.209 +        return data;
   8.210 +    }
   8.211 +    
   8.212 +    private static FileObject findTemplate() {
   8.213 +        return FileUtil.getConfigFile("Templates/SOA_BPEL/LTemplate.ldif"); // NOI18N
   8.214 +    }
   8.215 +
   8.216 +
   8.217 +    static String[] createSteps(String[] before,
   8.218 +            WizardDescriptor.Panel[] panels) {
   8.219 +        //assert panels != null;
   8.220 +        // hack to use the steps set before this panel processed
   8.221 +        int diff = 0;
   8.222 +        if (before == null) {
   8.223 +            before = new String[0];
   8.224 +        } else if (before.length > 0) {
   8.225 +            diff = ("...".equals(before[before.length - 1])) ? 1 : 0; // NOI18N
   8.226 +        }
   8.227 +        String[] res = new String[ (before.length - diff) + panels.length];
   8.228 +        for (int i = 0; i < res.length; i++) {
   8.229 +            if (i < (before.length - diff)) {
   8.230 +                res[i] = before[i];
   8.231 +            } else {
   8.232 +                res[i] = panels[i - before.length + diff].getComponent().getName();
   8.233 +            }
   8.234 +        }
   8.235 +        return res;
   8.236 +    }
   8.237 +    
   8.238 +    /*
   8.239 +     * Changes the text of a JLabel in component from oldLabel to newLabel
   8.240 +     */
   8.241 +    static JTextComponent findTextFieldForLabel(JComponent component,
   8.242 +            String text) {
   8.243 +        JLabel label = findLabel(component, text);
   8.244 +        if(label != null) {
   8.245 +            Component comp = label.getLabelFor();
   8.246 +            if (comp!=null && (comp instanceof JTextComponent)) {
   8.247 +                return (JTextComponent)comp;
   8.248 +            }
   8.249 +        }
   8.250 +        return null;
   8.251 +    }
   8.252 +    
   8.253 +    
   8.254 +    /*
   8.255 +     * taken from j2ee module
   8.256 +     * Recursively gets all components in the components array and puts it in allComponents
   8.257 +     */
   8.258 +    static void getAllComponents( Component[] components, Collection allComponents) {
   8.259 +        for( int i = 0; i < components.length; i++ ) {
   8.260 +            if( components[i] != null ) {
   8.261 +                allComponents.add( components[i] );
   8.262 +                if( ( ( Container )components[i] ).getComponentCount() != 0 ) {
   8.263 +                    getAllComponents( 
   8.264 +                            ( ( Container )components[i] ).getComponents(), 
   8.265 +                            allComponents );
   8.266 +                }
   8.267 +            }
   8.268 +        }
   8.269 +    }
   8.270 +    
   8.271 +    /*
   8.272 +     *  taken from j2ee module
   8.273 +     *  Recursively finds a JLabel that has labelText in comp
   8.274 +     */
   8.275 +    static JLabel findLabel(JComponent comp, String labelText) {
   8.276 +        Vector allComponents = new Vector();
   8.277 +        getAllComponents(comp.getComponents(), allComponents);
   8.278 +        Iterator iterator = allComponents.iterator();
   8.279 +        while(iterator.hasNext()) {
   8.280 +            Component c = (Component)iterator.next();
   8.281 +            if(c instanceof JLabel) {
   8.282 +                JLabel label = (JLabel)c;
   8.283 +                if(label.getText().equals(labelText)) {
   8.284 +                    return label;
   8.285 +                }
   8.286 +            }
   8.287 +        }
   8.288 +        return null;
   8.289 +    }
   8.290 +    
   8.291 +    private transient int index;
   8.292 +    private transient TemplateWizard wiz;
   8.293 +    private WizardDescriptor.Panel folderPanel;
   8.294 +    private transient SourceGroup[] sourceGroups;
   8.295 +    private transient WizardDescriptor.Panel[] panels;
   8.296 +}
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/wsdlextensions.ldap/src/org/netbeans/modules/wsdlextensions/ldap/resources/NewFilePanel.java	Wed Jun 09 18:55:07 2010 +0400
     9.3 @@ -0,0 +1,118 @@
     9.4 +/*
     9.5 + * The contents of this file are subject to the terms of the Common Development
     9.6 + * and Distribution License (the License). You may not use this file except in
     9.7 + * compliance with the License.
     9.8 + * 
     9.9 + * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
    9.10 + * or http://www.netbeans.org/cddl.txt.
    9.11 + * 
    9.12 + * When distributing Covered Code, include this CDDL Header Notice in each file
    9.13 + * and include the License file at http://www.netbeans.org/cddl.txt.
    9.14 + * If applicable, add the following below the CDDL Header, with the fields
    9.15 + * enclosed by brackets [] replaced by your own identifying information:
    9.16 + * "Portions Copyrighted [year] [name of copyright owner]"
    9.17 + * 
    9.18 + * The Original Software is NetBeans. The Initial Developer of the Original
    9.19 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
    9.20 + * Microsystems, Inc. All Rights Reserved.
    9.21 + */
    9.22 +package org.netbeans.modules.wsdlextensions.resources;
    9.23 +
    9.24 +import java.awt.Component;
    9.25 +import java.util.ArrayList;
    9.26 +import java.util.Iterator;
    9.27 +import java.util.List;
    9.28 +import javax.swing.JTextField;
    9.29 +import javax.swing.event.ChangeEvent;
    9.30 +import javax.swing.event.ChangeListener;
    9.31 +import org.netbeans.api.project.Project;
    9.32 +import org.netbeans.api.project.SourceGroup;
    9.33 +import org.openide.WizardDescriptor;
    9.34 +import org.openide.loaders.TemplateWizard;
    9.35 +import org.openide.util.HelpCtx;
    9.36 +
    9.37 +final class NewFilePanel implements WizardDescriptor.Panel<WizardDescriptor> {
    9.38 +
    9.39 +    NewFilePanel(Project aProject, SourceGroup[] aFolders) {
    9.40 +        this.folders = aFolders;
    9.41 +        this.project = aProject;
    9.42 +    }
    9.43 +    
    9.44 +    TemplateWizard getTemplateWizard() {
    9.45 +        return templateWizard;
    9.46 +    }
    9.47 +    
    9.48 +    void setNameTF(JTextField nameTF) {
    9.49 +        gui.attachFileNameListener(nameTF);
    9.50 +    }
    9.51 +
    9.52 +    public Component getComponent() {
    9.53 +        if (gui == null) {
    9.54 +            gui=new NewOptionsPanel(this);
    9.55 +        }
    9.56 +        return gui;
    9.57 +    }
    9.58 +
    9.59 +    public HelpCtx getHelp() {
    9.60 +        return new HelpCtx(NewFilePanel.class);
    9.61 +    }
    9.62 +
    9.63 +    public boolean isValid() {
    9.64 +        boolean valid = true;
    9.65 +        
    9.66 +        if(gui.getNamespaceTextField().contains(" ")) {
    9.67 +            valid = false;
    9.68 +        }
    9.69 +        return valid;
    9.70 +    }
    9.71 +
    9.72 +    public void addChangeListener(ChangeListener l) {
    9.73 +        listeners.add(l);
    9.74 +    }
    9.75 +
    9.76 +    public void removeChangeListener(ChangeListener l) {
    9.77 +        listeners.remove(l);
    9.78 +    }
    9.79 +
    9.80 +    protected void fireChange() {
    9.81 +        ChangeEvent e = new ChangeEvent(this);
    9.82 +        Iterator it = listeners.iterator();
    9.83 +        while (it.hasNext()) {
    9.84 +            ((ChangeListener)it.next()).stateChanged(e);
    9.85 +        }
    9.86 +    }
    9.87 +
    9.88 +    public void readSettings( WizardDescriptor settings ) {
    9.89 +        templateWizard = (TemplateWizard)settings;
    9.90 +    }
    9.91 +
    9.92 +    public void storeSettings(WizardDescriptor settings) {
    9.93 +        if ( WizardDescriptor.PREVIOUS_OPTION.equals( settings.getValue() ) ) {
    9.94 +            return;
    9.95 +        }
    9.96 +        if ( WizardDescriptor.CANCEL_OPTION.equals( settings.getValue() ) ) {
    9.97 +            return;
    9.98 +        }
    9.99 +        
   9.100 +        settings.putProperty ("NewFileWizard_Title", null); // NOI18N
   9.101 +    }
   9.102 +    
   9.103 +    String getNS() {
   9.104 +        return gui.getNamespaceTextField();
   9.105 +    }
   9.106 +    
   9.107 +    String getWsName() {
   9.108 +        return gui.getWsName();
   9.109 +    }
   9.110 +    
   9.111 +    Project getProject() {
   9.112 +        return project;
   9.113 +    }
   9.114 +
   9.115 +    private final List listeners = new ArrayList();
   9.116 +    private NewOptionsPanel gui;
   9.117 +
   9.118 +    private Project project;
   9.119 +    private SourceGroup[] folders;
   9.120 +    private TemplateWizard templateWizard;
   9.121 +}
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/wsdlextensions.ldap/src/org/netbeans/modules/wsdlextensions/ldap/resources/NewOptionsPanel.java	Wed Jun 09 18:55:07 2010 +0400
    10.3 @@ -0,0 +1,171 @@
    10.4 +/*
    10.5 + * The contents of this file are subject to the terms of the Common Development
    10.6 + * and Distribution License (the License). You may not use this file except in
    10.7 + * compliance with the License.
    10.8 + *
    10.9 + * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
   10.10 + * or http://www.netbeans.org/cddl.txt.
   10.11 + *
   10.12 + * When distributing Covered Code, include this CDDL Header Notice in each file
   10.13 + * and include the License file at http://www.netbeans.org/cddl.txt.
   10.14 + * If applicable, add the following below the CDDL Header, with the fields
   10.15 + * enclosed by brackets [] replaced by your own identifying information:
   10.16 + * "Portions Copyrighted [year] [name of copyright owner]"
   10.17 + *
   10.18 + * The Original Software is NetBeans. The Initial Developer of the Original
   10.19 + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
   10.20 + * Microsystems, Inc. All Rights Reserved.
   10.21 + */
   10.22 +package org.netbeans.modules.wsdlextensions.resources;
   10.23 +
   10.24 +import java.text.MessageFormat;
   10.25 +import javax.swing.JTextField;
   10.26 +
   10.27 +import org.openide.WizardDescriptor;
   10.28 +import org.openide.awt.Mnemonics;
   10.29 +import org.openide.util.NbBundle;
   10.30 +import org.netbeans.api.project.Project;
   10.31 +import org.netbeans.api.project.ProjectInformation;
   10.32 +import org.netbeans.api.project.ProjectUtils;
   10.33 +
   10.34 +public class NewOptionsPanel extends javax.swing.JPanel {
   10.35 +    
   10.36 +    private static final long serialVersionUID = 1L;
   10.37 +    
   10.38 +    public NewOptionsPanel(NewFilePanel newFilePanel) {
   10.39 +        initComponents();
   10.40 +        
   10.41 +        this.newFilePanel = newFilePanel;
   10.42 +        NameSpaceListener namespaceListener = new NameSpaceListener();
   10.43 +        namespaceTextField.getDocument().addDocumentListener(namespaceListener);
   10.44 +    }
   10.45 +    
   10.46 +    /** This method is called from within the constructor to
   10.47 +     * initialize the form.
   10.48 +     * WARNING: Do NOT modify this code. The content of this method is
   10.49 +     * always regenerated by the Form Editor.
   10.50 +     */
   10.51 +    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
   10.52 +    private void initComponents() {
   10.53 +/*
   10.54 +        buttonGroup1 = new javax.swing.ButtonGroup();
   10.55 +        jLabel1 = new javax.swing.JLabel();
   10.56 +        Mnemonics.setLocalizedText(jLabel1, NbBundle.getMessage(NewOptionsPanel.class, "LBL_Namespace"));
   10.57 +        namespaceTextField = new javax.swing.JTextField();
   10.58 +
   10.59 +        jLabel1.setLabelFor(namespaceTextField);
   10.60 +
   10.61 +        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
   10.62 +        this.setLayout(layout);
   10.63 +        layout.setHorizontalGroup(
   10.64 +            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
   10.65 +            .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
   10.66 +                .add(jLabel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 144, Short.MAX_VALUE)
   10.67 +                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
   10.68 +                .add(namespaceTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 460, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
   10.69 +        );
   10.70 +        layout.setVerticalGroup(
   10.71 +            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
   10.72 +            .add(layout.createSequentialGroup()
   10.73 +                .add(4, 4, 4)
   10.74 +                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
   10.75 +                    .add(namespaceTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
   10.76 +                    .add(jLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 22, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
   10.77 +                .add(198, 198, 198))
   10.78 +        );
   10.79 +
   10.80 +        java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("org/netbeans/modules/core/wizard/Bundle"); // NOI18N
   10.81 +        jLabel1.getAccessibleContext().setAccessibleName(bundle.getString("ACS_NamespaceLabel")); // NOI18N
   10.82 +        namespaceTextField.getAccessibleContext().setAccessibleName(bundle.getString("ACS_NamespaceTextField")); // NOI18N
   10.83 +        namespaceTextField.getAccessibleContext().setAccessibleDescription(bundle.getString("ACS_NamespaceTextFieldDescription")); // NOI18N
   10.84 +*/
   10.85 +    }// </editor-fold>//GEN-END:initComponents
   10.86 +    
   10.87 +    boolean valid(WizardDescriptor wizardDescriptor) {
   10.88 +        return true;
   10.89 +    }
   10.90 +    
   10.91 +    void store(WizardDescriptor d) {
   10.92 +        // Set value for namespace
   10.93 +//        d.putProperty(WizardProperties.NAMESPACE, namespaceTextField.getText());
   10.94 +    }
   10.95 +    
   10.96 +    void read(WizardDescriptor d) {
   10.97 +    }
   10.98 +    
   10.99 +    protected void setNamespaceTextField(String namespace) {
  10.100 +        namespaceTextField.setText(namespace);
  10.101 +    }
  10.102 +    
  10.103 +    protected String getNamespaceTextField() {
  10.104 +        return namespaceTextField.getText();
  10.105 +    }
  10.106 +    
  10.107 +    String getWsName() {
  10.108 +        if (fileNameTF!=null) {
  10.109 +            return fileNameTF.getText();
  10.110 +        }
  10.111 +        return null;
  10.112 +//        else {
  10.113 +//            return DEFAULT_SERVICE_NAME;
  10.114 +//        }
  10.115 +    }
  10.116 +    
  10.117 +    void attachFileNameListener(JTextField aFileNameTF) {
  10.118 +        
  10.119 +        this.fileNameTF = aFileNameTF;
  10.120 +
  10.121 +        if (fileNameTF!=null) {
  10.122 +            DocListener listener = new DocListener();
  10.123 +            javax.swing.text.Document doc = fileNameTF.getDocument();
  10.124 +            doc.addDocumentListener(listener);
  10.125 +        }
  10.126 +    }
  10.127 +    
  10.128 +    // Variables declaration - do not modify//GEN-BEGIN:variables
  10.129 +    private javax.swing.ButtonGroup buttonGroup1;
  10.130 +    private javax.swing.JLabel jLabel1;
  10.131 +    private javax.swing.JTextField namespaceTextField;
  10.132 +    // End of variables declaration//GEN-END:variables
  10.133 +    
  10.134 +    private NewFilePanel newFilePanel;
  10.135 +    private JTextField fileNameTF;
  10.136 +    private String prevNamespace;
  10.137 +    private boolean nameSpaceModifiedFlag;
  10.138 +    
  10.139 +    private void doUpdate() {
  10.140 +        if(namespaceTextField.getText()!=null && prevNamespace != null) {
  10.141 +            if(!namespaceTextField.getText().equals(prevNamespace)) {
  10.142 +                nameSpaceModifiedFlag = true;
  10.143 +            }
  10.144 +        }
  10.145 +    }
  10.146 +    
  10.147 +    private class DocListener implements javax.swing.event.DocumentListener {
  10.148 +        public void changedUpdate(javax.swing.event.DocumentEvent e) {
  10.149 +            doUpdate();
  10.150 +        }
  10.151 +        
  10.152 +        public void insertUpdate(javax.swing.event.DocumentEvent e) {
  10.153 +            doUpdate();
  10.154 +        }
  10.155 +        
  10.156 +        public void removeUpdate(javax.swing.event.DocumentEvent e) {
  10.157 +            doUpdate();
  10.158 +        }
  10.159 +    };
  10.160 +    
  10.161 +    private class NameSpaceListener implements javax.swing.event.DocumentListener {
  10.162 +        public void changedUpdate(javax.swing.event.DocumentEvent e) {
  10.163 +            newFilePanel.fireChange();
  10.164 +        }
  10.165 +        
  10.166 +        public void insertUpdate(javax.swing.event.DocumentEvent e) {
  10.167 +            newFilePanel.fireChange();
  10.168 +        }
  10.169 +        
  10.170 +        public void removeUpdate(javax.swing.event.DocumentEvent e) {
  10.171 +            newFilePanel.fireChange();
  10.172 +        }
  10.173 +    };
  10.174 +}
    11.1 --- a/wsdlextensions.ldap/src/org/netbeans/modules/wsdlextensions/ldap/resources/layer.xml	Wed Jun 09 14:28:10 2010 +0400
    11.2 +++ b/wsdlextensions.ldap/src/org/netbeans/modules/wsdlextensions/ldap/resources/layer.xml	Wed Jun 09 18:55:07 2010 +0400
    11.3 @@ -19,12 +19,29 @@
    11.4  -->
    11.5  <!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.1//EN" "http://www.netbeans.org/dtds/filesystem-1_1.dtd">
    11.6  <filesystem>
    11.7 +
    11.8 +    <folder name="Templates">
    11.9 +        <folder name="SOA_BPEL">
   11.10 +            <file name="LTemplate.ldif" url="LTemplate.ldif">
   11.11 +                <attr name="position" intvalue="100"/>
   11.12 +
   11.13 +                <attr name="SystemFileSystem.icon" urlvalue="nbresloc:/org/netbeans/modules/wsdlextensions/resources/ldiffile16x16.png"/>
   11.14 +                <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.wsdlextensions.resources.Bundle"/>
   11.15 +                <attr name="templateWizardIterator" newvalue="org.netbeans.modules.wsdlextensions.resources.NewFileIterator"/>
   11.16 +                <attr name="template" boolvalue="true"/>
   11.17 +                <attr name="templateWizardURL" urlvalue="nbresloc:/org/netbeans/modules/wsdlextensions/resources/LTemplate.html"/>
   11.18 +                <attr name="templateCategory" stringvalue="SOA_BPEL"/>
   11.19 +            </file>
   11.20 +        </folder>
   11.21 +    </folder>    
   11.22 +
   11.23      <folder name="Actions">
   11.24          <folder name="Other">
   11.25              <file name="org-netbeans-modules-wsdlextensions-ldap-ldif-GenerateWSDLAction.instance"/>
   11.26              <file name="org-netbeans-modules-wsdlextensions-ldap-ldif-ImportFileAction.instance"/>
   11.27          </folder>
   11.28      </folder>
   11.29 +
   11.30      <folder name="Loaders">
   11.31          <folder name="text">
   11.32              <folder name="x-ldif">
   11.33 @@ -81,6 +98,7 @@
   11.34              </folder>
   11.35          </folder>
   11.36      </folder>
   11.37 +    
   11.38      <folder name="Services">
   11.39          <folder name="MIMEResolver">
   11.40              <file name="LResolver.xml" url="LResolver.xml">
   11.41 @@ -88,19 +106,7 @@
   11.42              </file>
   11.43          </folder>
   11.44      </folder>
   11.45 -    <folder name="Templates">
   11.46 -        <folder name="ESB">
   11.47 -            <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.wsdlextensions.ldap.resources.Bundle"/>
   11.48 -            <attr name="position" intvalue="110"/>
   11.49 -
   11.50 -            <file name="LTemplate.ldif" url="LTemplate.ldif">
   11.51 -                <attr name="position" intvalue="110"/>
   11.52 -                <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.wsdlextensions.ldap.resources.Bundle"/>
   11.53 -                <attr name="template" boolvalue="true"/>
   11.54 -                <attr name="templateCategory" stringvalue="ESB"/>
   11.55 -            </file>
   11.56 -        </folder>
   11.57 -    </folder>
   11.58 +    
   11.59      <folder name="WSDLEditor">
   11.60          <file name="ldap-ext.xsd" url="ldap-ext.xsd">
   11.61              <attr name="namespace" stringvalue="http://schemas.sun.com/jbi/wsdl-extensions/ldap/"/>
   11.62 @@ -252,5 +258,4 @@
   11.63              </folder>
   11.64          </folder>
   11.65      </folder>
   11.66 -    
   11.67  </filesystem>
    12.1 --- a/wsdlextensions.ldap/test/unit/src/META-INF/services/org.openide.loaders.DataLoader	Wed Jun 09 14:28:10 2010 +0400
    12.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.3 @@ -1,1 +0,0 @@
    12.4 -org.netbeans.modules.wsdlextensions.ldap.ldif.LDataLoader