This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 144060
Collapse All | Expand All

(-)a/vmd.componentssupport/build.xml (-2 / +10 lines)
Lines 10-18 Link Here
10
        <property name="examples" location="${build.classes.dir}/org/netbeans/modules/vmd/componentssupport/templates"/>
10
        <property name="examples" location="${build.classes.dir}/org/netbeans/modules/vmd/componentssupport/templates"/>
11
        <property name="excludes" value="private build-impl.xml" />
11
        <property name="excludes" value="private build-impl.xml" />
12
        <mkdir dir="${examples}"/>
12
        <mkdir dir="${examples}"/>
13
        <zip basedir="template" 
13
        <zip basedir="template_standalone" 
14
            excludes="${excludes}" 
14
            excludes="${excludes}" 
15
            destfile="${examples}/CustomComponentProject.zip"
15
            destfile="${examples}/CustomComponentProject_standalone.zip"
16
            />
17
        <zip basedir="template_netbeansorg" 
18
            excludes="${excludes}" 
19
            destfile="${examples}/CustomComponentProject_netbeansorg.zip"
20
            />
21
        <zip basedir="template_suitecomponent" 
22
            excludes="${excludes}" 
23
            destfile="${examples}/CustomComponentProject_suitecomponent.zip"
16
            />
24
            />
17
    </target>
25
    </target>
18
</project>
26
</project>
(-)a/vmd.componentssupport/nbproject/project.xml (+8 lines)
Lines 21-26 Link Here
21
                    <run-dependency>
21
                    <run-dependency>
22
                        <release-version>1</release-version>
22
                        <release-version>1</release-version>
23
                        <specification-version>1.8</specification-version>
23
                        <specification-version>1.8</specification-version>
24
                    </run-dependency>
25
                </dependency>
26
                <dependency>
27
                    <code-name-base>org.netbeans.modules.apisupport.project</code-name-base>
28
                    <build-prerequisite/>
29
                    <compile-dependency/>
30
                    <run-dependency>
31
                        <specification-version>1.22</specification-version>
24
                    </run-dependency>
32
                    </run-dependency>
25
                </dependency>
33
                </dependency>
26
                <dependency>
34
                <dependency>
(-)a/vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/Bundle.properties (-1 / +1 lines)
Lines 42-48 Link Here
42
42
43
OpenIDE-Module-Short-Description=Visual Mobile Designer - components creation
43
OpenIDE-Module-Short-Description=Visual Mobile Designer - components creation
44
#System file system
44
#System file system
45
Templates/Project/J2ME/CustomComponentProject.zip=Mobile Designer Components
45
Templates/Project/J2ME/CustomComponentProject=Mobile Designer Components
46
46
47
Templates/J2MEComponents=Mobile Designer
47
Templates/J2MEComponents=Mobile Designer
48
Templates/J2MEComponents/CustomComponent=Mobile Designer Component
48
Templates/J2MEComponents/CustomComponent=Mobile Designer Component
(-)a/vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/layer.xml (-1 / +4 lines)
Lines 9-15 Link Here
9
    <folder name="Templates">
9
    <folder name="Templates">
10
        <folder name="Project">
10
        <folder name="Project">
11
            <folder name="J2ME">
11
            <folder name="J2ME">
12
                <file name="CustomComponentProject.zip" url="nbresloc:/org/netbeans/modules/vmd/componentssupport/templates/CustomComponentProject.zip">
12
                <file name="CustomComponentProject">
13
                    <attr name="position" intvalue="900"/>
13
                    <attr name="position" intvalue="900"/>
14
                    <attr name="SystemFileSystem.icon" urlvalue="nbresloc:/org/netbeans/modules/vmd/componentssupport/ui/resources/module.png"/>
14
                    <attr name="SystemFileSystem.icon" urlvalue="nbresloc:/org/netbeans/modules/vmd/componentssupport/ui/resources/module.png"/>
15
                    <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.vmd.componentssupport.Bundle"/>
15
                    <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.vmd.componentssupport.Bundle"/>
Lines 39-44 Link Here
39
            <file name="libdescriptemplate.xml" url="templates/libdescriptemplate.xml"/>
39
            <file name="libdescriptemplate.xml" url="templates/libdescriptemplate.xml"/>
40
            <file name="CustomComponentCD.java" url="templates/CustomComponentCD.template"/>
40
            <file name="CustomComponentCD.java" url="templates/CustomComponentCD.template"/>
41
            <file name="CustomComponentProducer.java" url="templates/CustomComponentProducer.template"/>
41
            <file name="CustomComponentProducer.java" url="templates/CustomComponentProducer.template"/>
42
            <file name="CustomComponentProject_standalone.zip" url="templates/CustomComponentProject_standalone.zip"/>
43
            <file name="CustomComponentProject_netbeansorg.zip" url="templates/CustomComponentProject_netbeansorg.zip"/>
44
            <file name="CustomComponentProject_suitecomponent.zip" url="templates/CustomComponentProject_suitecomponent.zip"/>
42
            <file name="layer.xml" url="templates/layer.xml"/>
45
            <file name="layer.xml" url="templates/layer.xml"/>
43
        </folder>
46
        </folder>
44
    </folder>
47
    </folder>
(-)a/vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/ui/helpers/BaseHelper.java (-2 / +39 lines)
Lines 39-44 Link Here
39
39
40
package org.netbeans.modules.vmd.componentssupport.ui.helpers;
40
package org.netbeans.modules.vmd.componentssupport.ui.helpers;
41
41
42
import java.io.ByteArrayInputStream;
42
import java.io.File;
43
import java.io.File;
43
import java.io.FileInputStream;
44
import java.io.FileInputStream;
44
import java.io.IOException;
45
import java.io.IOException;
Lines 60-66 Link Here
60
import javax.script.ScriptException;
61
import javax.script.ScriptException;
61
import javax.swing.text.PlainDocument;
62
import javax.swing.text.PlainDocument;
62
import org.netbeans.api.queries.FileEncodingQuery;
63
import org.netbeans.api.queries.FileEncodingQuery;
64
import org.netbeans.modules.apisupport.project.ui.wizard.spi.ModuleTypePanel;
63
import org.netbeans.spi.project.support.ant.EditableProperties;
65
import org.netbeans.spi.project.support.ant.EditableProperties;
66
import org.openide.WizardDescriptor;
64
import org.openide.filesystems.FileLock;
67
import org.openide.filesystems.FileLock;
65
import org.openide.filesystems.FileObject;
68
import org.openide.filesystems.FileObject;
66
import org.openide.filesystems.FileUtil;
69
import org.openide.filesystems.FileUtil;
Lines 107-113 Link Here
107
110
108
    public static String getDefaultCodeNameBase(String projectName){
111
    public static String getDefaultCodeNameBase(String projectName){
109
            //return normalizeCNB(EXAMPLE_BASE_NAME + projectName);
112
            //return normalizeCNB(EXAMPLE_BASE_NAME + projectName);
110
            return EXAMPLE_BASE_NAME + normalizeCNB(projectName);
113
            //return EXAMPLE_BASE_NAME + normalizeCNB(projectName);
114
        return "";//NOI18N
111
    }
115
    }
112
    
116
    
113
    /**
117
    /**
Lines 197-204 Link Here
197
            }
201
            }
198
    }
202
    }
199
203
200
    public static void copyByteAfterByte(File source, FileObject target) throws IOException {
204
    public static void copyByteAfterByte(File source, FileObject target) 
205
            throws IOException 
206
    {
201
            InputStream is = new FileInputStream(source);
207
            InputStream is = new FileInputStream(source);
208
            try {
209
                copyByteAfterByte(is, target);
210
            } finally {
211
                is.close();
212
            }
213
    }
214
215
    public static void copyByteAfterByte(String source, FileObject target) 
216
            throws IOException 
217
    {
218
        ByteArrayInputStream is = new ByteArrayInputStream(
219
                source.getBytes(UTF_8));
202
            try {
220
            try {
203
                copyByteAfterByte(is, target);
221
                copyByteAfterByte(is, target);
204
            } finally {
222
            } finally {
Lines 300-304 Link Here
300
        }
318
        }
301
    }
319
    }
302
    
320
    
321
    public static boolean isSuiteComponent(WizardDescriptor wizard){
322
        return ModuleTypePanel.isSuiteComponent(wizard);
323
    }
324
    
325
    public static boolean isStandalone(WizardDescriptor wizard){
326
        return ModuleTypePanel.isStandalone(wizard);
327
    }
328
    
329
    public static boolean isNetBeansOrg(WizardDescriptor wizard){
330
        return ModuleTypePanel.isNetBeansOrg(wizard);
331
    }
332
    
333
    public static String getSuiteRoot(WizardDescriptor wizard){
334
        return ModuleTypePanel.getSuiteRoot(wizard);
335
    }
336
    
337
    public static String getActivePlatform(WizardDescriptor wizard){
338
        return ModuleTypePanel.getActivePlatformId(wizard);
339
    }
303
340
304
}
341
}
(-)e4be93651686 (+313 lines)
Added Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 * 
4
 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
5
 * 
6
 * The contents of this file are subject to the terms of either the GNU
7
 * General Public License Version 2 only ("GPL") or the Common
8
 * Development and Distribution License("CDDL") (collectively, the
9
 * "License"). You may not use this file except in compliance with the
10
 * License. You can obtain a copy of the License at
11
 * http://www.netbeans.org/cddl-gplv2.html
12
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
13
 * specific language governing permissions and limitations under the
14
 * License.  When distributing the software, include this License Header
15
 * Notice in each file and include the License file at
16
 * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
17
 * particular file as subject to the "Classpath" exception as provided
18
 * by Sun in the GPL Version 2 section of the License file that
19
 * accompanied this code. If applicable, add the following below the
20
 * License Header, with the fields enclosed by brackets [] replaced by
21
 * your own identifying information:
22
 * "Portions Copyrighted [year] [name of copyright owner]"
23
 * 
24
 * If you wish your version of this file to be governed by only the CDDL
25
 * or only the GPL Version 2, indicate your decision by adding
26
 * "[Contributor] elects to include this software in this distribution
27
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
28
 * single choice of license, a recipient has the option to distribute
29
 * your version of this file under either the CDDL, the GPL Version 2 or
30
 * to extend the choice of license to its licensees as provided above.
31
 * However, if you add GPL Version 2 code and therefore, elected the GPL
32
 * Version 2 license, then the option applies only if the new code is
33
 * made subject to such option by the copyright holder.
34
 * 
35
 * Contributor(s):
36
 * 
37
 * Portions Copyrighted 2008 Sun Microsystems, Inc.
38
 */
39
40
package org.netbeans.modules.vmd.componentssupport.ui.helpers;
41
42
import java.io.ByteArrayInputStream;
43
import java.io.ByteArrayOutputStream;
44
import java.io.File;
45
import java.io.IOException;
46
import java.io.InputStream;
47
import java.io.OutputStream;
48
import java.util.zip.ZipEntry;
49
import java.util.zip.ZipInputStream;
50
import org.netbeans.modules.vmd.componentssupport.ui.wizard.CustomComponentWizardIterator;
51
import org.netbeans.spi.project.support.ant.EditableProperties;
52
import org.netbeans.spi.project.support.ant.PropertyUtils;
53
import org.openide.WizardDescriptor;
54
import org.openide.filesystems.FileObject;
55
import org.openide.filesystems.FileUtil;
56
import org.openide.util.Exceptions;
57
import org.openide.xml.XMLUtil;
58
import org.w3c.dom.Document;
59
import org.w3c.dom.Element;
60
import org.w3c.dom.NodeList;
61
import org.xml.sax.InputSource;
62
63
/**
64
 *
65
 * @author akorostelev
66
 */
67
public class ProjectTemplateZipHelper extends BaseHelper {
68
69
    private static final String PROJECT_XML = "nbproject/project.xml";           // NOI18N
70
    private static final String BUILD_IMPL_XML 
71
                                            = "nbproject/build-impl.xml";        // NOI18N
72
    private static final String BUILD_XML   = "build.xml";                       // NOI18N
73
    private static final String PLATFORM_PROPERTIES 
74
                                            = "nbproject/platform.properties";   // NOI18N
75
    private static final String SUITE_PROPERTIES 
76
                                            = "nbproject/suite.properties";      // NOI18N
77
    private static final String SUITE_PRIVATE_PROPERTIES 
78
                            = "nbproject/private/suite-private.properties";      // NOI18N
79
80
    // unzipped project filtering
81
    private static final String CODE_NAME_BASE 
82
                                            = "code-name-base";                  // NOI18N
83
    private static final String DATA        = "data";                            // NOI18N
84
85
    // parameters for project
86
    private static final String CODE_NAME_PARAM 
87
                                            = "_CODE_NAME_";                     // NOI18N
88
    private static final String BUNDLE_PATH_PARAM 
89
                                            = "_BUNDLE_PATH_";                   // NOI18N
90
    private static final String PROJECT_NAME_PARAM 
91
                                            = "_PROJECT_NAME_";                  // NOI18N
92
    private static final String PLATFORM_ID_PARAM 
93
                                            = "_PLATFORM_ID_";                   // NOI18N
94
    private static final String SUITE_PATH_PARAM 
95
                                            = "suite.dir";                       // NOI18N
96
97
    // names of templates
98
    private static final String BUNDLE_NAME = SRC + BUNDLE_PROPERTIES;           // NOI18N
99
    private static final String LAYER_NAME  = SRC + LAYER_XML;                   // NOI18N
100
    private static final String MANIFEST    = "manifest.mf";                     // NOI18N
101
    private static final String LAYER       = "OpenIDE-Module-Layer: ";          // NOI18N
102
103
    public static void unZipFile( InputStream source, FileObject projectRoot ,
104
            WizardDescriptor wizard )
105
            throws IOException
106
    {
107
        try {
108
            ZipInputStream zipIS = new ZipInputStream(source);
109
            ZipEntry entry;
110
            while ((entry = zipIS.getNextEntry()) != null) {
111
                if (entry.isDirectory()) {
112
                    FileUtil.createFolder(projectRoot, entry.getName());
113
                }
114
                else {
115
                    FileObject fo = null;
116
                    if (PROJECT_XML.equals(entry.getName())) {
117
                        // Special handling for setting name of Ant-based
118
                        // projects; customize as needed:
119
                        fo = FileUtil.createData(projectRoot, entry
120
                                .getName());
121
                        filterProjectXML(fo, zipIS, (String)wizard.getProperty( 
122
                                CustomComponentWizardIterator.CODE_BASE_NAME ));
123
                    }
124
                    else if ( MANIFEST.equals(entry.getName())){
125
                        fo = FileUtil.createData(projectRoot, entry
126
                                .getName());
127
                        filterManifest( fo , zipIS, wizard );
128
                    }
129
                    else if ( PLATFORM_PROPERTIES.equals(entry.getName())){
130
                        fo = FileUtil.createData(projectRoot, entry
131
                                .getName());
132
                        filterPlatformProperties( fo , zipIS, wizard );
133
                    }
134
                    else if ( LAYER_NAME.equals(entry.getName())){
135
                        copyLayer( projectRoot , zipIS , wizard );
136
                    }
137
                    else if ( BUNDLE_NAME.equals(entry.getName()) ) {
138
                        filterBundle( projectRoot , zipIS, wizard );
139
                    }
140
                    else if ( BUILD_XML.equals(entry.getName()) 
141
                            || BUILD_IMPL_XML.equals(entry.getName())) 
142
                    {
143
                        fo = FileUtil.createData(projectRoot, entry
144
                                .getName());
145
                        filterBuild( fo , zipIS, (String)wizard.getProperty( 
146
                                CustomComponentWizardIterator.CODE_BASE_NAME ) );
147
                    }
148
                    else {
149
                        fo = FileUtil.createData(projectRoot, entry
150
                                .getName());
151
                        copyByteAfterByte(zipIS, fo);
152
                    }
153
                }
154
            }
155
        }
156
        finally {
157
            source.close();
158
        }
159
        createSuiteProperties(projectRoot, wizard);
160
    }
161
    
162
    /**
163
     * Detects whether <code>projectDir</code> is relative to
164
     * <code>suiteDir</code> and creates <em>nbproject/suite.properties</em> or
165
     * <em>nbproject/private/suite-private.properties</em> with
166
     * <em>suite.dir</em> appropriately set.
167
     */
168
    // copied from org.netbeans.modules.apisupport.project.NbModuleProjectGenerator
169
    private static void createSuiteProperties(FileObject projectDir, 
170
            WizardDescriptor wizard) 
171
            throws IOException 
172
    {
173
        if (!isSuiteComponent(wizard)){
174
            return;
175
        }
176
        
177
        File projectDirF = FileUtil.toFile(projectDir);
178
        String suiteDirPath = getSuiteRoot(wizard);
179
        File suiteDir = FileUtil.normalizeFile(new File(suiteDirPath));
180
        
181
        String suiteLocation;
182
        String suitePropertiesLocation;
183
        
184
        String rel = PropertyUtils.relativizeFile(projectDirF, suiteDir);
185
        if (rel != null) {
186
            suiteLocation = "${basedir}/" + rel; // NOI18N
187
            suitePropertiesLocation = SUITE_PROPERTIES;
188
        } else {
189
            suiteLocation = suiteDir.getAbsolutePath();
190
            suitePropertiesLocation = SUITE_PRIVATE_PROPERTIES;
191
        }
192
        EditableProperties props = new EditableProperties(true);
193
        props.setProperty(SUITE_PATH_PARAM, suiteLocation); 
194
        FileObject suiteProperties = FileUtil.createData(projectDir, suitePropertiesLocation);
195
        storeProperties(suiteProperties, props);
196
    }
197
198
    private static void filterBuild( FileObject fo, ZipInputStream zipIS,
199
            String codeBaseName ) throws IOException
200
    {
201
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
202
        FileUtil.copy( zipIS , baos);
203
        String content = baos.toString(UTF_8);
204
        
205
        content = content.replace( CODE_NAME_PARAM , codeBaseName );
206
        copyByteAfterByte(content, fo);
207
    }
208
209
    private static void filterBundle( FileObject projectRoot, ZipInputStream is,
210
            WizardDescriptor wizardDescriptor ) throws IOException
211
    {
212
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
213
        FileUtil.copy(is, baos);
214
        String content = baos.toString(UTF_8);
215
        
216
        content = content.replace( PROJECT_NAME_PARAM , 
217
                (String)wizardDescriptor.getProperty( 
218
                        CustomComponentWizardIterator.DISPLAY_NAME ) );
219
220
        FileObject fileObject = FileUtil.createData(projectRoot, 
221
                SRC + (String)wizardDescriptor.getProperty( 
222
                        CustomComponentWizardIterator.BUNDLE_PATH) );
223
        copyByteAfterByte(content, fileObject);
224
    }
225
226
    private static void copyLayer( FileObject projectRoot, ZipInputStream is,
227
            WizardDescriptor wizard ) throws IOException
228
    {
229
        String layer = (String)wizard.getProperty( 
230
                CustomComponentWizardIterator.LAYER_PATH);
231
        if ( layer == null || layer.length() ==0 ){
232
            return;
233
        }
234
        FileObject fileObject = FileUtil.createData(projectRoot, SRC + layer );
235
        copyByteAfterByte(is, fileObject );
236
    }
237
238
    private static void filterManifest( FileObject fo, ZipInputStream is,
239
            WizardDescriptor wizard ) throws IOException
240
    {
241
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
242
        FileUtil.copy(is, baos);
243
        String content = baos.toString(UTF_8);
244
        
245
        content = content.replace( CODE_NAME_PARAM , (String)wizard.getProperty( 
246
                CustomComponentWizardIterator.CODE_BASE_NAME ));
247
        content = content.replace( BUNDLE_PATH_PARAM, (String)wizard.getProperty( 
248
                CustomComponentWizardIterator.BUNDLE_PATH));
249
        StringBuilder builder = new StringBuilder( content );
250
        String layer = (String)wizard.getProperty( 
251
                CustomComponentWizardIterator.LAYER_PATH);
252
        if ( layer != null){
253
            builder.append( LAYER );
254
            builder.append( layer );
255
            builder.append( "\n" );
256
        }
257
258
        copyByteAfterByte(builder.toString(), fo);
259
    }
260
261
    private static void filterPlatformProperties( FileObject fo, ZipInputStream is,
262
            WizardDescriptor wizard ) throws IOException
263
    {
264
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
265
        FileUtil.copy(is, baos);
266
        String content = baos.toString(UTF_8);
267
        
268
        content = content.replace( PLATFORM_ID_PARAM , getActivePlatform(wizard));
269
270
        copyByteAfterByte(content, fo);
271
    }
272
273
    private static void filterProjectXML( FileObject fo, ZipInputStream str,
274
            String name ) throws IOException
275
    {
276
        try {
277
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
278
            FileUtil.copy(str, baos);
279
            Document doc = XMLUtil.parse(new InputSource(
280
                    new ByteArrayInputStream(baos.toByteArray())), false,
281
                    false, null, null);
282
            NodeList nl = doc.getDocumentElement().getElementsByTagName(
283
                    CODE_NAME_BASE);
284
            if (nl != null) {
285
                for (int i = 0; i < nl.getLength(); i++) {
286
                    Element el = (Element) nl.item(i);
287
                    if (el.getParentNode() != null
288
                            && DATA.equals(el.getParentNode().getNodeName()))
289
                    {
290
                        NodeList nl2 = el.getChildNodes();
291
                        if (nl2.getLength() > 0) {
292
                            nl2.item(0).setNodeValue(name);
293
                        }
294
                        break;
295
                    }
296
                }
297
            }
298
            OutputStream out = fo.getOutputStream();
299
            try {
300
                XMLUtil.write(doc, out, UTF_8);
301
            }
302
            finally {
303
                out.close();
304
            }
305
        }
306
        catch (Exception ex) {
307
            Exceptions.printStackTrace(ex);
308
            copyByteAfterByte(str, fo);
309
        }
310
311
    }
312
    
313
}
(-)a/vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/ui/wizard/BasicModuleConfVisualPanel.form (-10 / +45 lines)
Lines 17-23 Link Here
17
    <Container class="javax.swing.JPanel" name="confPanel">
17
    <Container class="javax.swing.JPanel" name="confPanel">
18
      <Constraints>
18
      <Constraints>
19
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
19
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
20
          <GridBagConstraints gridX="0" gridY="0" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="17" weightX="1.0" weightY="1.0"/>
20
          <GridBagConstraints gridX="0" gridY="0" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="4" insetsLeft="0" insetsBottom="4" insetsRight="0" anchor="17" weightX="1.0" weightY="1.0"/>
21
        </Constraint>
21
        </Constraint>
22
      </Constraints>
22
      </Constraints>
23
23
Lines 34-40 Link Here
34
          </Properties>
34
          </Properties>
35
          <Constraints>
35
          <Constraints>
36
            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
36
            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
37
              <GridBagConstraints gridX="-1" gridY="-1" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="0" insetsBottom="6" insetsRight="12" anchor="17" weightX="0.0" weightY="0.0"/>
37
              <GridBagConstraints gridX="-1" gridY="-1" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="2" insetsLeft="5" insetsBottom="6" insetsRight="12" anchor="17" weightX="0.0" weightY="0.0"/>
38
            </Constraint>
38
            </Constraint>
39
          </Constraints>
39
          </Constraints>
40
        </Component>
40
        </Component>
Lines 49-55 Link Here
49
          </Properties>
49
          </Properties>
50
          <Constraints>
50
          <Constraints>
51
            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
51
            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
52
              <GridBagConstraints gridX="0" gridY="1" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="12" anchor="17" weightX="0.0" weightY="0.0"/>
52
              <GridBagConstraints gridX="0" gridY="2" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="5" insetsBottom="0" insetsRight="12" anchor="17" weightX="0.0" weightY="0.0"/>
53
            </Constraint>
53
            </Constraint>
54
          </Constraints>
54
          </Constraints>
55
        </Component>
55
        </Component>
Lines 64-70 Link Here
64
          </Properties>
64
          </Properties>
65
          <Constraints>
65
          <Constraints>
66
            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
66
            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
67
              <GridBagConstraints gridX="0" gridY="2" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="18" insetsLeft="0" insetsBottom="0" insetsRight="12" anchor="17" weightX="0.0" weightY="0.0"/>
67
              <GridBagConstraints gridX="0" gridY="3" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="18" insetsLeft="5" insetsBottom="0" insetsRight="12" anchor="17" weightX="0.0" weightY="0.0"/>
68
            </Constraint>
68
            </Constraint>
69
          </Constraints>
69
          </Constraints>
70
        </Component>
70
        </Component>
Lines 79-120 Link Here
79
          </Properties>
79
          </Properties>
80
          <Constraints>
80
          <Constraints>
81
            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
81
            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
82
              <GridBagConstraints gridX="0" gridY="3" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="6" insetsLeft="0" insetsBottom="0" insetsRight="12" anchor="17" weightX="0.0" weightY="0.0"/>
82
              <GridBagConstraints gridX="0" gridY="5" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="3" insetsLeft="20" insetsBottom="0" insetsRight="12" anchor="17" weightX="0.0" weightY="0.0"/>
83
            </Constraint>
83
            </Constraint>
84
          </Constraints>
84
          </Constraints>
85
        </Component>
85
        </Component>
86
        <Component class="javax.swing.JTextField" name="codeNameBaseValue">
86
        <Component class="javax.swing.JTextField" name="codeNameBaseValue">
87
          <Constraints>
87
          <Constraints>
88
            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
88
            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
89
              <GridBagConstraints gridX="-1" gridY="-1" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="0" insetsBottom="6" insetsRight="0" anchor="17" weightX="1.0" weightY="0.0"/>
89
              <GridBagConstraints gridX="-1" gridY="-1" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="1" insetsLeft="0" insetsBottom="5" insetsRight="0" anchor="17" weightX="1.0" weightY="0.0"/>
90
            </Constraint>
90
            </Constraint>
91
          </Constraints>
91
          </Constraints>
92
        </Component>
92
        </Component>
93
        <Component class="javax.swing.JTextField" name="displayNameValue">
93
        <Component class="javax.swing.JTextField" name="displayNameValue">
94
          <Constraints>
94
          <Constraints>
95
            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
95
            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
96
              <GridBagConstraints gridX="1" gridY="1" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
96
              <GridBagConstraints gridX="1" gridY="2" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
97
            </Constraint>
97
            </Constraint>
98
          </Constraints>
98
          </Constraints>
99
        </Component>
99
        </Component>
100
        <Component class="javax.swing.JTextField" name="bundleValue">
100
        <Component class="javax.swing.JTextField" name="bundleValue">
101
          <Constraints>
101
          <Constraints>
102
            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
102
            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
103
              <GridBagConstraints gridX="1" gridY="2" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="18" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
103
              <GridBagConstraints gridX="1" gridY="3" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="18" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
104
            </Constraint>
104
            </Constraint>
105
          </Constraints>
105
          </Constraints>
106
        </Component>
106
        </Component>
107
        <Component class="javax.swing.JTextField" name="layerValue">
107
        <Component class="javax.swing.JTextField" name="layerValue">
108
          <Constraints>
108
          <Constraints>
109
            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
109
            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
110
              <GridBagConstraints gridX="1" gridY="3" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="6" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
110
              <GridBagConstraints gridX="1" gridY="5" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="6" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
111
            </Constraint>
111
            </Constraint>
112
          </Constraints>
112
          </Constraints>
113
        </Component>
113
        </Component>
114
        <Component class="javax.swing.JLabel" name="filler">
114
        <Component class="javax.swing.JLabel" name="filler">
115
          <Constraints>
115
          <Constraints>
116
            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
116
            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
117
              <GridBagConstraints gridX="0" gridY="4" gridWidth="2" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="1.0"/>
117
              <GridBagConstraints gridX="0" gridY="6" gridWidth="2" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="1.0"/>
118
            </Constraint>
119
          </Constraints>
120
        </Component>
121
        <Component class="javax.swing.JCheckBox" name="generateLayer">
122
          <Properties>
123
            <Property name="selected" type="boolean" value="true"/>
124
            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
125
              <ResourceString bundle="org/netbeans/modules/vmd/componentssupport/ui/wizard/Bundle.properties" key="CTL_GenerateLayer" replaceFormat="getMessage(&quot;{key}&quot;)"/>
126
            </Property>
127
            <Property name="enabled" type="boolean" value="false"/>
128
            <Property name="focusable" type="boolean" value="false"/>
129
          </Properties>
130
          <AccessibilityProperties>
131
            <Property name="AccessibleContext.accessibleName" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
132
              <ResourceString bundle="org/netbeans/modules/vmd/componentssupport/ui/wizard/Bundle.properties" key="ACS_CTL_GenerateLayer" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
133
            </Property>
134
            <Property name="AccessibleContext.accessibleDescription" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
135
              <ResourceString bundle="org/netbeans/modules/vmd/componentssupport/ui/wizard/Bundle.properties" key="ACS_CTL_GenerateLayer" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
136
            </Property>
137
          </AccessibilityProperties>
138
          <Constraints>
139
            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
140
              <GridBagConstraints gridX="0" gridY="4" gridWidth="2" gridHeight="1" fill="2" ipadX="0" ipadY="-2" insetsTop="6" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
141
            </Constraint>
142
          </Constraints>
143
        </Component>
144
        <Component class="javax.swing.JLabel" name="cnbHint">
145
          <Properties>
146
            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
147
              <Connection code="getMessage(&quot;LBL_CodeNameBaseHint&quot;)" type="code"/>
148
            </Property>
149
          </Properties>
150
          <Constraints>
151
            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
152
              <GridBagConstraints gridX="1" gridY="1" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="6" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
118
            </Constraint>
153
            </Constraint>
119
          </Constraints>
154
          </Constraints>
120
        </Component>
155
        </Component>
(-)a/vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/ui/wizard/BasicModuleConfVisualPanel.java (-16 / +67 lines)
Lines 67-72 Link Here
67
    
67
    
68
    private static final String MSG_INVALID_CNB 
68
    private static final String MSG_INVALID_CNB 
69
                                              = "MSG_InvalidCNB";          // NOI18N 
69
                                              = "MSG_InvalidCNB";          // NOI18N 
70
    private static final String MSG_INVALID_NBORG_CNB 
71
                                 = "BasicConfVisualPanel_err_wrong_nborg_name"; // NOI18N 
70
    private static final String ACS_LAYER_VALUE 
72
    private static final String ACS_LAYER_VALUE 
71
                                              = "ACS_CTL_LayerValue";      // NOI18N 
73
                                              = "ACS_CTL_LayerValue";      // NOI18N 
72
    private static final String ACS_DISPLAY_NAME_VALUE 
74
    private static final String ACS_DISPLAY_NAME_VALUE 
Lines 79-86 Link Here
79
81
80
    private static final long serialVersionUID = -7699370587627049750L;
82
    private static final long serialVersionUID = -7699370587627049750L;
81
    
83
    
82
    // TODO should perform all checks together on any change. current code (copied)
83
    // allows incorrect behavior in some cases.
84
    public BasicModuleConfVisualPanel( BasicModuleConfWizardPanel panel) {
84
    public BasicModuleConfVisualPanel( BasicModuleConfWizardPanel panel) {
85
        myPanel = panel;
85
        myPanel = panel;
86
        initComponents();
86
        initComponents();
Lines 149-157 Link Here
149
            setError(getMessage(MSG_INVALID_CNB));
149
            setError(getMessage(MSG_INVALID_CNB));
150
            return false;
150
            return false;
151
        }
151
        }
152
        if (BaseHelper.isNetBeansOrg(mySettings)) {
153
            // Ensure that official naming conventions are respected.
154
            String cnbShort = abbreviateCNB(dotName);
155
            String name = (String)mySettings.getProperty( 
156
                    CustomComponentWizardIterator.PROJECT_NAME);
157
            if (!name.equals(cnbShort)) {
158
                setError(getMessage(MSG_INVALID_NBORG_CNB, cnbShort));
159
                return false;
160
            }
161
        }
152
        return true;
162
        return true;
153
    }
163
    }
154
    
164
    
165
    // copied from org.netbeans.modules.apisupport.project.universe.ModuleList
166
    private static String abbreviateCNB(String cnb) {
167
        return cnb.replaceFirst("^org\\.netbeans\\.modules\\.", ""). // NOI18N
168
                   replaceFirst("^org\\.netbeans\\.(libs|lib|api|spi|core)\\.", "$1."). // NOI18N
169
                   replaceFirst("^org\\.netbeans\\.", "o.n."). // NOI18N
170
                   replaceFirst("^org\\.openide\\.", "openide."). // NOI18N
171
                   replaceFirst("^org\\.", "o."). // NOI18N
172
                   replaceFirst("^com\\.sun\\.", "c.s."). // NOI18N
173
                   replaceFirst("^com\\.", "c."); // NOI18N
174
    }
175
155
    private void updateValuesOnCNBUpdate(){
176
    private void updateValuesOnCNBUpdate(){
156
        String dotName = getCodeNameBaseValue();
177
        String dotName = getCodeNameBaseValue();
157
        // update layer and bundle from the cnb
178
        // update layer and bundle from the cnb
Lines 307-314 Link Here
307
        }
328
        }
308
    }
329
    }
309
    
330
    
310
    private static String getMessage(String key) {
331
    private static String getMessage(String key, Object... params) {
311
        return NbBundle.getMessage(BasicModuleConfVisualPanel.class, key);
332
        return NbBundle.getMessage(BasicModuleConfVisualPanel.class, key, params);
312
    }
333
    }
313
    
334
    
314
    /** This method is called from within the constructor to
335
    /** This method is called from within the constructor to
Lines 330-335 Link Here
330
        bundleValue = new javax.swing.JTextField();
351
        bundleValue = new javax.swing.JTextField();
331
        layerValue = new javax.swing.JTextField();
352
        layerValue = new javax.swing.JTextField();
332
        filler = new javax.swing.JLabel();
353
        filler = new javax.swing.JLabel();
354
        generateLayer = new javax.swing.JCheckBox();
355
        cnbHint = new javax.swing.JLabel();
333
356
334
        setLayout(new java.awt.GridBagLayout());
357
        setLayout(new java.awt.GridBagLayout());
335
358
Lines 339-405 Link Here
339
        org.openide.awt.Mnemonics.setLocalizedText(codeNameBase, org.openide.util.NbBundle.getMessage(BasicModuleConfVisualPanel.class, "LBL_CodeNameBase")); // NOI18N
362
        org.openide.awt.Mnemonics.setLocalizedText(codeNameBase, org.openide.util.NbBundle.getMessage(BasicModuleConfVisualPanel.class, "LBL_CodeNameBase")); // NOI18N
340
        gridBagConstraints = new java.awt.GridBagConstraints();
363
        gridBagConstraints = new java.awt.GridBagConstraints();
341
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
364
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
342
        gridBagConstraints.insets = new java.awt.Insets(1, 0, 6, 12);
365
        gridBagConstraints.insets = new java.awt.Insets(2, 5, 6, 12);
343
        confPanel.add(codeNameBase, gridBagConstraints);
366
        confPanel.add(codeNameBase, gridBagConstraints);
344
367
345
        displayName.setLabelFor(displayNameValue);
368
        displayName.setLabelFor(displayNameValue);
346
        org.openide.awt.Mnemonics.setLocalizedText(displayName, org.openide.util.NbBundle.getMessage(BasicModuleConfVisualPanel.class, "LBL_ModuleDisplayName")); // NOI18N
369
        org.openide.awt.Mnemonics.setLocalizedText(displayName, org.openide.util.NbBundle.getMessage(BasicModuleConfVisualPanel.class, "LBL_ModuleDisplayName")); // NOI18N
347
        gridBagConstraints = new java.awt.GridBagConstraints();
370
        gridBagConstraints = new java.awt.GridBagConstraints();
348
        gridBagConstraints.gridx = 0;
371
        gridBagConstraints.gridx = 0;
349
        gridBagConstraints.gridy = 1;
372
        gridBagConstraints.gridy = 2;
350
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
373
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
351
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 12);
374
        gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 12);
352
        confPanel.add(displayName, gridBagConstraints);
375
        confPanel.add(displayName, gridBagConstraints);
353
376
354
        bundle.setLabelFor(bundleValue);
377
        bundle.setLabelFor(bundleValue);
355
        org.openide.awt.Mnemonics.setLocalizedText(bundle, org.openide.util.NbBundle.getMessage(BasicModuleConfVisualPanel.class, "LBL_LocalizingBundle")); // NOI18N
378
        org.openide.awt.Mnemonics.setLocalizedText(bundle, org.openide.util.NbBundle.getMessage(BasicModuleConfVisualPanel.class, "LBL_LocalizingBundle")); // NOI18N
356
        gridBagConstraints = new java.awt.GridBagConstraints();
379
        gridBagConstraints = new java.awt.GridBagConstraints();
357
        gridBagConstraints.gridx = 0;
380
        gridBagConstraints.gridx = 0;
358
        gridBagConstraints.gridy = 2;
381
        gridBagConstraints.gridy = 3;
359
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
382
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
360
        gridBagConstraints.insets = new java.awt.Insets(18, 0, 0, 12);
383
        gridBagConstraints.insets = new java.awt.Insets(18, 5, 0, 12);
361
        confPanel.add(bundle, gridBagConstraints);
384
        confPanel.add(bundle, gridBagConstraints);
362
385
363
        layer.setLabelFor(layerValue);
386
        layer.setLabelFor(layerValue);
364
        org.openide.awt.Mnemonics.setLocalizedText(layer, org.openide.util.NbBundle.getMessage(BasicModuleConfVisualPanel.class, "LBL_XMLLayer")); // NOI18N
387
        org.openide.awt.Mnemonics.setLocalizedText(layer, org.openide.util.NbBundle.getMessage(BasicModuleConfVisualPanel.class, "LBL_XMLLayer")); // NOI18N
365
        gridBagConstraints = new java.awt.GridBagConstraints();
388
        gridBagConstraints = new java.awt.GridBagConstraints();
366
        gridBagConstraints.gridx = 0;
389
        gridBagConstraints.gridx = 0;
367
        gridBagConstraints.gridy = 3;
390
        gridBagConstraints.gridy = 5;
368
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
391
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
369
        gridBagConstraints.insets = new java.awt.Insets(6, 0, 0, 12);
392
        gridBagConstraints.insets = new java.awt.Insets(3, 20, 0, 12);
370
        confPanel.add(layer, gridBagConstraints);
393
        confPanel.add(layer, gridBagConstraints);
371
        gridBagConstraints = new java.awt.GridBagConstraints();
394
        gridBagConstraints = new java.awt.GridBagConstraints();
372
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
395
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
373
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
396
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
374
        gridBagConstraints.weightx = 1.0;
397
        gridBagConstraints.weightx = 1.0;
375
        gridBagConstraints.insets = new java.awt.Insets(1, 0, 6, 0);
398
        gridBagConstraints.insets = new java.awt.Insets(1, 0, 5, 0);
376
        confPanel.add(codeNameBaseValue, gridBagConstraints);
399
        confPanel.add(codeNameBaseValue, gridBagConstraints);
377
        gridBagConstraints = new java.awt.GridBagConstraints();
400
        gridBagConstraints = new java.awt.GridBagConstraints();
378
        gridBagConstraints.gridx = 1;
401
        gridBagConstraints.gridx = 1;
379
        gridBagConstraints.gridy = 1;
402
        gridBagConstraints.gridy = 2;
380
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
403
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
381
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
404
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
382
        confPanel.add(displayNameValue, gridBagConstraints);
405
        confPanel.add(displayNameValue, gridBagConstraints);
383
        gridBagConstraints = new java.awt.GridBagConstraints();
406
        gridBagConstraints = new java.awt.GridBagConstraints();
384
        gridBagConstraints.gridx = 1;
407
        gridBagConstraints.gridx = 1;
385
        gridBagConstraints.gridy = 2;
408
        gridBagConstraints.gridy = 3;
386
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
409
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
387
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
410
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
388
        gridBagConstraints.insets = new java.awt.Insets(18, 0, 0, 0);
411
        gridBagConstraints.insets = new java.awt.Insets(18, 0, 0, 0);
389
        confPanel.add(bundleValue, gridBagConstraints);
412
        confPanel.add(bundleValue, gridBagConstraints);
390
        gridBagConstraints = new java.awt.GridBagConstraints();
413
        gridBagConstraints = new java.awt.GridBagConstraints();
391
        gridBagConstraints.gridx = 1;
414
        gridBagConstraints.gridx = 1;
392
        gridBagConstraints.gridy = 3;
415
        gridBagConstraints.gridy = 5;
393
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
416
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
394
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
417
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
395
        gridBagConstraints.insets = new java.awt.Insets(6, 0, 0, 0);
418
        gridBagConstraints.insets = new java.awt.Insets(6, 0, 0, 0);
396
        confPanel.add(layerValue, gridBagConstraints);
419
        confPanel.add(layerValue, gridBagConstraints);
397
        gridBagConstraints = new java.awt.GridBagConstraints();
420
        gridBagConstraints = new java.awt.GridBagConstraints();
398
        gridBagConstraints.gridx = 0;
421
        gridBagConstraints.gridx = 0;
399
        gridBagConstraints.gridy = 4;
422
        gridBagConstraints.gridy = 6;
400
        gridBagConstraints.gridwidth = 2;
423
        gridBagConstraints.gridwidth = 2;
401
        gridBagConstraints.weighty = 1.0;
424
        gridBagConstraints.weighty = 1.0;
402
        confPanel.add(filler, gridBagConstraints);
425
        confPanel.add(filler, gridBagConstraints);
426
427
        generateLayer.setSelected(true);
428
        org.openide.awt.Mnemonics.setLocalizedText(generateLayer, getMessage("CTL_GenerateLayer")); // NOI18N
429
        generateLayer.setEnabled(false);
430
        generateLayer.setFocusable(false);
431
        gridBagConstraints = new java.awt.GridBagConstraints();
432
        gridBagConstraints.gridx = 0;
433
        gridBagConstraints.gridy = 4;
434
        gridBagConstraints.gridwidth = 2;
435
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
436
        gridBagConstraints.ipady = -2;
437
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
438
        gridBagConstraints.insets = new java.awt.Insets(6, 0, 0, 0);
439
        confPanel.add(generateLayer, gridBagConstraints);
440
        generateLayer.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(BasicModuleConfVisualPanel.class, "ACS_CTL_GenerateLayer")); // NOI18N
441
        generateLayer.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(BasicModuleConfVisualPanel.class, "ACS_CTL_GenerateLayer")); // NOI18N
442
443
        org.openide.awt.Mnemonics.setLocalizedText(cnbHint, getMessage("LBL_CodeNameBaseHint"));
444
        gridBagConstraints = new java.awt.GridBagConstraints();
445
        gridBagConstraints.gridx = 1;
446
        gridBagConstraints.gridy = 1;
447
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
448
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
449
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 6, 0);
450
        confPanel.add(cnbHint, gridBagConstraints);
403
451
404
        gridBagConstraints = new java.awt.GridBagConstraints();
452
        gridBagConstraints = new java.awt.GridBagConstraints();
405
        gridBagConstraints.gridx = 0;
453
        gridBagConstraints.gridx = 0;
Lines 408-425 Link Here
408
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
456
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
409
        gridBagConstraints.weightx = 1.0;
457
        gridBagConstraints.weightx = 1.0;
410
        gridBagConstraints.weighty = 1.0;
458
        gridBagConstraints.weighty = 1.0;
459
        gridBagConstraints.insets = new java.awt.Insets(4, 0, 4, 0);
411
        add(confPanel, gridBagConstraints);
460
        add(confPanel, gridBagConstraints);
412
    }// </editor-fold>//GEN-END:initComponents
461
    }// </editor-fold>//GEN-END:initComponents
413
    
462
    
414
    // Variables declaration - do not modify//GEN-BEGIN:variables
463
    // Variables declaration - do not modify//GEN-BEGIN:variables
415
    private javax.swing.JLabel bundle;
464
    private javax.swing.JLabel bundle;
416
    private javax.swing.JTextField bundleValue;
465
    private javax.swing.JTextField bundleValue;
466
    private javax.swing.JLabel cnbHint;
417
    private javax.swing.JLabel codeNameBase;
467
    private javax.swing.JLabel codeNameBase;
418
    private javax.swing.JTextField codeNameBaseValue;
468
    private javax.swing.JTextField codeNameBaseValue;
419
    private javax.swing.JPanel confPanel;
469
    private javax.swing.JPanel confPanel;
420
    private javax.swing.JLabel displayName;
470
    private javax.swing.JLabel displayName;
421
    private javax.swing.JTextField displayNameValue;
471
    private javax.swing.JTextField displayNameValue;
422
    private javax.swing.JLabel filler;
472
    private javax.swing.JLabel filler;
473
    private javax.swing.JCheckBox generateLayer;
423
    private javax.swing.JLabel layer;
474
    private javax.swing.JLabel layer;
424
    private javax.swing.JTextField layerValue;
475
    private javax.swing.JTextField layerValue;
425
    // End of variables declaration//GEN-END:variables
476
    // End of variables declaration//GEN-END:variables
(-)a/vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/ui/wizard/Bundle.properties (+4 lines)
Lines 85-95 Link Here
85
LBL_ModuleDisplayName=Module &Display Name:
85
LBL_ModuleDisplayName=Module &Display Name:
86
LBL_LocalizingBundle=&Localizing Bundle:
86
LBL_LocalizingBundle=&Localizing Bundle:
87
LBL_XMLLayer=&XML Layer:
87
LBL_XMLLayer=&XML Layer:
88
CTL_GenerateLayer=&Generate XML Layer
89
LBL_CodeNameBaseHint=(e.g. "org.yourorg.modulename")
88
ACS_BasicConfVisualPanel=Basic Module Configuration
90
ACS_BasicConfVisualPanel=Basic Module Configuration
89
ACS_CTL_BundleValue=Localizing Bundle
91
ACS_CTL_BundleValue=Localizing Bundle
90
ACS_CTL_CodeNameBaseValue=Code name base
92
ACS_CTL_CodeNameBaseValue=Code name base
91
ACS_CTL_DisplayNameValue=Display Name
93
ACS_CTL_DisplayNameValue=Display Name
92
ACS_CTL_LayerValue=Layer
94
ACS_CTL_LayerValue=Layer
95
ACS_CTL_GenerateLayer=Generate XML Layer
93
96
94
# Main Wizard Step "Basic Module Configuration" - messages
97
# Main Wizard Step "Basic Module Configuration" - messages
95
MSG_InvalidCNB=Code Name Base is not valid
98
MSG_InvalidCNB=Code Name Base is not valid
Lines 99-104 Link Here
99
BasicConfVisualPanel_err_bundle_def_pkg=Cannot use default package for bundle.
102
BasicConfVisualPanel_err_bundle_def_pkg=Cannot use default package for bundle.
100
BasicConfVisualPanel_err_layer_ext=Layer must have "{0}" extension.
103
BasicConfVisualPanel_err_layer_ext=Layer must have "{0}" extension.
101
BasicConfVisualPanel_err_bundle_ext=Bundle must have "{0}" extension.
104
BasicConfVisualPanel_err_bundle_ext=Bundle must have "{0}" extension.
105
BasicConfVisualPanel_err_wrong_nborg_name=For this code name base, module must be in a directory named "{0}".
102
106
103
# Main Wizard Step "Libraries Descriptors"
107
# Main Wizard Step "Libraries Descriptors"
104
LBL_AddedLibDescriptors=Chosen Libraries &Descriptors:
108
LBL_AddedLibDescriptors=Chosen Libraries &Descriptors:
(-)a/vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/ui/wizard/ComponentPresentersVisualPanel.java (+10 lines)
Lines 41-50 Link Here
41
41
42
package org.netbeans.modules.vmd.componentssupport.ui.wizard;
42
package org.netbeans.modules.vmd.componentssupport.ui.wizard;
43
43
44
import java.net.URL;
45
import java.util.ArrayList;
46
import java.util.Iterator;
47
import java.util.List;
44
import javax.swing.JPanel;
48
import javax.swing.JPanel;
45
import javax.swing.event.DocumentEvent;
49
import javax.swing.event.DocumentEvent;
46
import javax.swing.event.DocumentListener;
50
import javax.swing.event.DocumentListener;
51
import org.netbeans.api.project.libraries.Library;
52
import org.netbeans.modules.vmd.componentssupport.ui.helpers.JavaMELibsConfigurationHelper;
53
import org.netbeans.modules.vmd.componentssupport.ui.helpers.JavaMELibsPreviewHelper;
47
import org.openide.WizardDescriptor;
54
import org.openide.WizardDescriptor;
55
import org.openide.filesystems.FileObject;
56
import org.openide.filesystems.FileUtil;
57
import org.openide.filesystems.URLMapper;
48
import org.openide.util.HelpCtx;
58
import org.openide.util.HelpCtx;
49
import org.openide.util.NbBundle;
59
import org.openide.util.NbBundle;
50
60
(-)a/vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/ui/wizard/CustomComponentVisualPanel.form (-141 / +161 lines)
Lines 11-160 Link Here
11
    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
11
    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
12
    <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
12
    <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
13
    <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
13
    <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
14
    <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,41,0,0,2,126"/>
14
  </AuxValues>
15
  </AuxValues>
15
16
16
  <Layout>
17
  <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
17
    <DimensionLayout dim="0">
18
      <Group type="103" groupAlignment="0" attributes="0">
19
          <Group type="102" alignment="1" attributes="0">
20
              <Group type="103" groupAlignment="1" attributes="0">
21
                  <Component id="mainProject" alignment="0" pref="541" max="32767" attributes="0"/>
22
                  <Group type="102" alignment="1" attributes="0">
23
                      <Group type="103" groupAlignment="0" attributes="0">
24
                          <Component id="projectLocationLabel" min="-2" max="-2" attributes="0"/>
25
                          <Component id="createdFolderLabel" min="-2" max="-2" attributes="0"/>
26
                          <Component id="projectNameLabel" min="-2" max="-2" attributes="0"/>
27
                      </Group>
28
                      <EmptySpace min="-2" pref="19" max="-2" attributes="0"/>
29
                      <Group type="103" groupAlignment="0" attributes="0">
30
                          <Component id="projectNameTextField" pref="441" max="32767" attributes="0"/>
31
                          <Component id="projectLocationTextField" alignment="1" pref="441" max="32767" attributes="0"/>
32
                          <Component id="createdFolderTextField" alignment="1" pref="441" max="32767" attributes="0"/>
33
                      </Group>
34
                  </Group>
35
              </Group>
36
              <EmptySpace type="separate" max="-2" attributes="0"/>
37
              <Component id="browseButton" min="-2" max="-2" attributes="0"/>
38
              <EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
39
          </Group>
40
      </Group>
41
    </DimensionLayout>
42
    <DimensionLayout dim="1">
43
      <Group type="103" groupAlignment="0" attributes="0">
44
          <Group type="102" attributes="0">
45
              <Group type="103" groupAlignment="3" attributes="0">
46
                  <Component id="projectNameLabel" alignment="3" min="-2" max="-2" attributes="0"/>
47
                  <Component id="projectNameTextField" alignment="3" min="-2" max="-2" attributes="0"/>
48
              </Group>
49
              <EmptySpace max="-2" attributes="0"/>
50
              <Group type="103" groupAlignment="3" attributes="0">
51
                  <Component id="projectLocationTextField" alignment="3" min="-2" max="-2" attributes="0"/>
52
                  <Component id="projectLocationLabel" alignment="3" min="-2" max="-2" attributes="0"/>
53
                  <Component id="browseButton" alignment="3" min="-2" max="-2" attributes="0"/>
54
              </Group>
55
              <EmptySpace max="-2" attributes="0"/>
56
              <Group type="103" groupAlignment="3" attributes="0">
57
                  <Component id="createdFolderTextField" alignment="3" min="-2" max="-2" attributes="0"/>
58
                  <Component id="createdFolderLabel" alignment="3" min="-2" max="-2" attributes="0"/>
59
              </Group>
60
              <EmptySpace type="separate" max="-2" attributes="0"/>
61
              <Component id="mainProject" min="-2" max="-2" attributes="0"/>
62
              <EmptySpace pref="183" max="32767" attributes="0"/>
63
          </Group>
64
      </Group>
65
    </DimensionLayout>
66
  </Layout>
67
  <SubComponents>
18
  <SubComponents>
68
    <Component class="javax.swing.JLabel" name="projectNameLabel">
69
      <Properties>
70
        <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
71
          <ComponentRef name="projectNameTextField"/>
72
        </Property>
73
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
74
          <ResourceString bundle="org/netbeans/modules/vmd/componentssupport/ui/wizard/Bundle.properties" key="LBL_ProjectName" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
75
        </Property>
76
      </Properties>
77
      <AccessibilityProperties>
78
        <Property name="AccessibleContext.accessibleName" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
79
          <ResourceString bundle="org/netbeans/modules/vmd/componentssupport/ui/wizard/Bundle.properties" key="ACSN_ProjectName" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
80
        </Property>
81
        <Property name="AccessibleContext.accessibleDescription" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
82
          <ResourceString bundle="org/netbeans/modules/vmd/componentssupport/ui/wizard/Bundle.properties" key="ACSD_ProjectName" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
83
        </Property>
84
      </AccessibilityProperties>
85
      <AuxValues>
86
        <AuxValue name="generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
87
      </AuxValues>
88
    </Component>
89
    <Component class="javax.swing.JTextField" name="projectNameTextField">
90
    </Component>
91
    <Component class="javax.swing.JLabel" name="projectLocationLabel">
92
      <Properties>
93
        <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
94
          <ComponentRef name="projectLocationTextField"/>
95
        </Property>
96
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
97
          <ResourceString bundle="org/netbeans/modules/vmd/componentssupport/ui/wizard/Bundle.properties" key="LBL_ProjectLocation" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
98
        </Property>
99
      </Properties>
100
      <AccessibilityProperties>
101
        <Property name="AccessibleContext.accessibleName" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
102
          <ResourceString bundle="org/netbeans/modules/vmd/componentssupport/ui/wizard/Bundle.properties" key="ACSN_ProjectLocation" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
103
        </Property>
104
        <Property name="AccessibleContext.accessibleDescription" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
105
          <ResourceString bundle="org/netbeans/modules/vmd/componentssupport/ui/wizard/Bundle.properties" key="ACSD_ProjectLocation" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
106
        </Property>
107
      </AccessibilityProperties>
108
      <AuxValues>
109
        <AuxValue name="generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
110
      </AuxValues>
111
    </Component>
112
    <Component class="javax.swing.JTextField" name="projectLocationTextField">
113
    </Component>
114
    <Component class="javax.swing.JButton" name="browseButton">
115
      <Properties>
116
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
117
          <ResourceString bundle="org/netbeans/modules/vmd/componentssupport/ui/wizard/Bundle.properties" key="LBL_Browse_Button" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
118
        </Property>
119
        <Property name="actionCommand" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
120
          <Connection code="BROWSE" type="code"/>
121
        </Property>
122
      </Properties>
123
      <AccessibilityProperties>
124
        <Property name="AccessibleContext.accessibleName" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
125
          <ResourceString bundle="org/netbeans/modules/vmd/componentssupport/ui/wizard/Bundle.properties" key="ACSN_Browse_Button" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
126
        </Property>
127
        <Property name="AccessibleContext.accessibleDescription" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
128
          <ResourceString bundle="org/netbeans/modules/vmd/componentssupport/ui/wizard/Bundle.properties" key="ACSN_Browse_Button" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
129
        </Property>
130
      </AccessibilityProperties>
131
      <Events>
132
        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="browseButtonActionPerformed"/>
133
      </Events>
134
    </Component>
135
    <Component class="javax.swing.JLabel" name="createdFolderLabel">
136
      <Properties>
137
        <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
138
          <ComponentRef name="createdFolderTextField"/>
139
        </Property>
140
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
141
          <ResourceString bundle="org/netbeans/modules/vmd/componentssupport/ui/wizard/Bundle.properties" key="LBL_ProjectFolder" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
142
        </Property>
143
      </Properties>
144
      <AccessibilityProperties>
145
        <Property name="AccessibleContext.accessibleName" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
146
          <ResourceString bundle="org/netbeans/modules/vmd/componentssupport/ui/wizard/Bundle.properties" key="ACSN_ProjectFolder" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
147
        </Property>
148
        <Property name="AccessibleContext.accessibleDescription" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
149
          <ResourceString bundle="org/netbeans/modules/vmd/componentssupport/ui/wizard/Bundle.properties" key="ACSD_ProjectFolder" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
150
        </Property>
151
      </AccessibilityProperties>
152
    </Component>
153
    <Component class="javax.swing.JTextField" name="createdFolderTextField">
154
      <Properties>
155
        <Property name="editable" type="boolean" value="false"/>
156
      </Properties>
157
    </Component>
158
    <Component class="javax.swing.JCheckBox" name="mainProject">
19
    <Component class="javax.swing.JCheckBox" name="mainProject">
159
      <Properties>
20
      <Properties>
160
        <Property name="selected" type="boolean" value="true"/>
21
        <Property name="selected" type="boolean" value="true"/>
Lines 170-175 Link Here
170
          <ResourceString bundle="org/netbeans/modules/vmd/componentssupport/ui/wizard/Bundle.properties" key="ACSD_SetAsMainProject" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
31
          <ResourceString bundle="org/netbeans/modules/vmd/componentssupport/ui/wizard/Bundle.properties" key="ACSD_SetAsMainProject" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
171
        </Property>
32
        </Property>
172
      </AccessibilityProperties>
33
      </AccessibilityProperties>
34
      <Constraints>
35
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
36
          <GridBagConstraints gridX="0" gridY="2" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="12" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="18" weightX="0.0" weightY="0.0"/>
37
        </Constraint>
38
      </Constraints>
173
    </Component>
39
    </Component>
40
    <Container class="javax.swing.JPanel" name="infoPanel">
41
      <Constraints>
42
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
43
          <GridBagConstraints gridX="0" gridY="0" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
44
        </Constraint>
45
      </Constraints>
46
47
      <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
48
      <SubComponents>
49
        <Component class="javax.swing.JLabel" name="projectNameLabel">
50
          <Properties>
51
            <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
52
              <ComponentRef name="projectNameTextField"/>
53
            </Property>
54
            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
55
              <ResourceString bundle="org/netbeans/modules/vmd/componentssupport/ui/wizard/Bundle.properties" key="LBL_ProjectName" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
56
            </Property>
57
          </Properties>
58
          <AccessibilityProperties>
59
            <Property name="AccessibleContext.accessibleName" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
60
              <ResourceString bundle="org/netbeans/modules/vmd/componentssupport/ui/wizard/Bundle.properties" key="ACSN_ProjectName" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
61
            </Property>
62
            <Property name="AccessibleContext.accessibleDescription" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
63
              <ResourceString bundle="org/netbeans/modules/vmd/componentssupport/ui/wizard/Bundle.properties" key="ACSD_ProjectName" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
64
            </Property>
65
          </AccessibilityProperties>
66
          <AuxValues>
67
            <AuxValue name="generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
68
          </AuxValues>
69
          <Constraints>
70
            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
71
              <GridBagConstraints gridX="0" gridY="0" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="12" anchor="17" weightX="0.0" weightY="0.0"/>
72
            </Constraint>
73
          </Constraints>
74
        </Component>
75
        <Component class="javax.swing.JTextField" name="projectNameTextField">
76
          <Constraints>
77
            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
78
              <GridBagConstraints gridX="1" gridY="0" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="17" weightX="1.0" weightY="0.0"/>
79
            </Constraint>
80
          </Constraints>
81
        </Component>
82
        <Component class="javax.swing.JTextField" name="createdFolderTextField">
83
          <Properties>
84
            <Property name="editable" type="boolean" value="false"/>
85
          </Properties>
86
          <Constraints>
87
            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
88
              <GridBagConstraints gridX="1" gridY="2" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="6" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
89
            </Constraint>
90
          </Constraints>
91
        </Component>
92
        <Component class="javax.swing.JLabel" name="projectLocationLabel">
93
          <Properties>
94
            <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
95
              <ComponentRef name="projectLocationTextField"/>
96
            </Property>
97
            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
98
              <ResourceString bundle="org/netbeans/modules/vmd/componentssupport/ui/wizard/Bundle.properties" key="LBL_ProjectLocation" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
99
            </Property>
100
          </Properties>
101
          <AccessibilityProperties>
102
            <Property name="AccessibleContext.accessibleName" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
103
              <ResourceString bundle="org/netbeans/modules/vmd/componentssupport/ui/wizard/Bundle.properties" key="ACSN_ProjectLocation" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
104
            </Property>
105
            <Property name="AccessibleContext.accessibleDescription" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
106
              <ResourceString bundle="org/netbeans/modules/vmd/componentssupport/ui/wizard/Bundle.properties" key="ACSD_ProjectLocation" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
107
            </Property>
108
          </AccessibilityProperties>
109
          <AuxValues>
110
            <AuxValue name="generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
111
          </AuxValues>
112
          <Constraints>
113
            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
114
              <GridBagConstraints gridX="0" gridY="1" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="6" insetsLeft="0" insetsBottom="6" insetsRight="12" anchor="17" weightX="0.0" weightY="0.0"/>
115
            </Constraint>
116
          </Constraints>
117
        </Component>
118
        <Component class="javax.swing.JLabel" name="createdFolderLabel">
119
          <Properties>
120
            <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
121
              <ComponentRef name="createdFolderTextField"/>
122
            </Property>
123
            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
124
              <ResourceString bundle="org/netbeans/modules/vmd/componentssupport/ui/wizard/Bundle.properties" key="LBL_ProjectFolder" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
125
            </Property>
126
          </Properties>
127
          <AccessibilityProperties>
128
            <Property name="AccessibleContext.accessibleName" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
129
              <ResourceString bundle="org/netbeans/modules/vmd/componentssupport/ui/wizard/Bundle.properties" key="ACSN_ProjectFolder" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
130
            </Property>
131
            <Property name="AccessibleContext.accessibleDescription" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
132
              <ResourceString bundle="org/netbeans/modules/vmd/componentssupport/ui/wizard/Bundle.properties" key="ACSD_ProjectFolder" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
133
            </Property>
134
          </AccessibilityProperties>
135
          <Constraints>
136
            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
137
              <GridBagConstraints gridX="0" gridY="2" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="6" insetsRight="12" anchor="17" weightX="0.0" weightY="0.0"/>
138
            </Constraint>
139
          </Constraints>
140
        </Component>
141
        <Component class="javax.swing.JTextField" name="projectLocationTextField">
142
          <Constraints>
143
            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
144
              <GridBagConstraints gridX="1" gridY="1" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="6" insetsLeft="0" insetsBottom="6" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
145
            </Constraint>
146
          </Constraints>
147
        </Component>
148
        <Component class="javax.swing.JButton" name="browseButton">
149
          <Properties>
150
            <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
151
              <ResourceString bundle="org/netbeans/modules/vmd/componentssupport/ui/wizard/Bundle.properties" key="LBL_Browse_Button" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
152
            </Property>
153
            <Property name="actionCommand" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
154
              <Connection code="BROWSE" type="code"/>
155
            </Property>
156
          </Properties>
157
          <AccessibilityProperties>
158
            <Property name="AccessibleContext.accessibleName" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
159
              <ResourceString bundle="org/netbeans/modules/vmd/componentssupport/ui/wizard/Bundle.properties" key="ACSN_Browse_Button" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
160
            </Property>
161
            <Property name="AccessibleContext.accessibleDescription" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
162
              <ResourceString bundle="org/netbeans/modules/vmd/componentssupport/ui/wizard/Bundle.properties" key="ACSN_Browse_Button" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
163
            </Property>
164
          </AccessibilityProperties>
165
          <Events>
166
            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="browseButtonActionPerformed"/>
167
          </Events>
168
          <Constraints>
169
            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
170
              <GridBagConstraints gridX="2" gridY="1" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="6" insetsLeft="12" insetsBottom="6" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
171
            </Constraint>
172
          </Constraints>
173
        </Component>
174
      </SubComponents>
175
    </Container>
176
    <Container class="javax.swing.JPanel" name="typeChooserPanelContainer">
177
      <Constraints>
178
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
179
          <GridBagConstraints gridX="0" gridY="1" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
180
        </Constraint>
181
      </Constraints>
182
183
      <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
184
    </Container>
185
    <Container class="javax.swing.JPanel" name="fillerPanel">
186
      <Constraints>
187
        <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
188
          <GridBagConstraints gridX="0" gridY="3" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="18" weightX="1.0" weightY="1.0"/>
189
        </Constraint>
190
      </Constraints>
191
192
      <Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/>
193
    </Container>
174
  </SubComponents>
194
  </SubComponents>
175
</Form>
195
</Form>
(-)a/vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/ui/wizard/CustomComponentVisualPanel.java (-108 / +307 lines)
Lines 42-53 Link Here
42
42
43
package org.netbeans.modules.vmd.componentssupport.ui.wizard;
43
package org.netbeans.modules.vmd.componentssupport.ui.wizard;
44
44
45
import java.awt.BorderLayout;
46
import java.awt.Component;
47
import java.awt.event.ActionEvent;
48
import java.awt.event.ActionListener;
49
import java.beans.PropertyChangeEvent;
50
import java.beans.PropertyChangeListener;
45
import java.io.File;
51
import java.io.File;
52
import javax.swing.JComponent;
46
import javax.swing.JFileChooser;
53
import javax.swing.JFileChooser;
47
import javax.swing.JPanel;
54
import javax.swing.JPanel;
48
import javax.swing.event.DocumentEvent;
55
import javax.swing.event.DocumentEvent;
49
import javax.swing.event.DocumentListener;
56
import javax.swing.event.DocumentListener;
50
import javax.swing.text.Document;
57
import javax.swing.text.Document;
58
import org.netbeans.modules.apisupport.project.ui.wizard.spi.ModuleTypePanel;
51
import org.netbeans.spi.project.ui.support.ProjectChooser;
59
import org.netbeans.spi.project.ui.support.ProjectChooser;
52
import org.openide.WizardDescriptor;
60
import org.openide.WizardDescriptor;
53
import org.openide.WizardValidationException;
61
import org.openide.WizardValidationException;
Lines 55-61 Link Here
55
import org.openide.util.HelpCtx;
63
import org.openide.util.HelpCtx;
56
import org.openide.util.NbBundle;
64
import org.openide.util.NbBundle;
57
65
58
class CustomComponentVisualPanel extends JPanel implements DocumentListener {
66
class CustomComponentVisualPanel extends JPanel {
59
67
60
    public static final String PROP_PROJECT_NAME = "projectName";
68
    public static final String PROP_PROJECT_NAME = "projectName";
61
    public static final String BROWSE = "BROWSE";
69
    public static final String BROWSE = "BROWSE";
Lines 77-111 Link Here
77
    public CustomComponentVisualPanel(CustomComponentWizardPanel panel) {
85
    public CustomComponentVisualPanel(CustomComponentWizardPanel panel) {
78
        initComponents();
86
        initComponents();
79
        this.myPanel = panel;
87
        this.myPanel = panel;
88
        
80
        putClientProperty("NewProjectWizard_Title", NbBundle.getMessage(CustomComponentVisualPanel.class, "TXT_MobileDesigner"));
89
        putClientProperty("NewProjectWizard_Title", NbBundle.getMessage(CustomComponentVisualPanel.class, "TXT_MobileDesigner"));
81
        // Register listener on the textFields to make the automatic updates
90
        initDocumentListeners();
82
        projectNameTextField.getDocument().addDocumentListener(this);
91
        attachDocumentListeners();
83
        projectLocationTextField.getDocument().addDocumentListener(this);
84
92
85
        initAccessibility();;
93
        initAccessibility();
86
    }
94
    }
87
95
88
    @Override
96
    @Override 
89
    public void addNotify() {
97
    public void addNotify() {
90
        super.addNotify();
98
        super.addNotify();
99
        attachDocumentListeners();
91
        //same problem as in 31086, initial focus on Cancel button
100
        //same problem as in 31086, initial focus on Cancel button
92
        projectNameTextField.requestFocus();
101
        projectNameTextField.requestFocus();
93
    }
102
    }
94
103
95
    // Implementation of DocumentListener --------------------------------------
104
    @Override 
96
    public void changedUpdate(DocumentEvent e) {
105
    public void removeNotify() {
97
        updateTexts(e);
106
        // prevent checking when the panel is not "active"
98
        checkValidity();
107
        removeDocumentListeners();
108
        super.removeNotify();
99
    }
109
    }
100
101
    public void insertUpdate(DocumentEvent e) {
102
        changedUpdate(e);
103
    }
104
105
    public void removeUpdate(DocumentEvent e) {
106
        changedUpdate(e);
107
    }
108
    // -------------
109
110
110
    void store(WizardDescriptor d) {
111
    void store(WizardDescriptor d) {
111
        String name = projectNameTextField.getText().trim();
112
        String name = projectNameTextField.getText().trim();
Lines 118-130 Link Here
118
    }
119
    }
119
120
120
    void read(WizardDescriptor settings) {
121
    void read(WizardDescriptor settings) {
121
        mySettings = settings;
122
        if (mySettings == null){
123
            mySettings = settings;
124
            mySettings.addPropertyChangeListener(new PropertyChangeListener() {
125
126
                public void propertyChange(PropertyChangeEvent evt) {
127
                    String name = evt.getPropertyName();
128
                    Object value = evt.getNewValue();
129
130
                    if (ModuleTypePanel.IS_STANDALONE_OR_SUITE_COMPONENT.equals(name)) {
131
                        moduletypeChanged(value);
132
                    } else if (ModuleTypePanel.SUITE_ROOT.equals(name)) {
133
                        moduleSuiteValueChanged(value);
134
                    } else if (ModuleTypePanel.ACTIVE_PLATFORM_ID.equals(name)){
135
                        checkValidity();
136
                    }
137
                }
138
            });
139
            initPanels(mySettings);
140
        }
141
142
        //typeChooserPanel.read(mySettings);
143
        // invoke store to have changes in mySettings
144
        //typeChooserPanel.store(mySettings);
122
145
123
        if (getIsMainProject() != null){
146
        if (getIsMainProject() != null){
124
            this.mainProject.setSelected(getIsMainProject());
147
            this.mainProject.setSelected(getIsMainProject());
125
        }
148
        }
126
        this.projectLocationTextField.setText(
149
        setLocation(getProjectLocation().getAbsolutePath());
127
                getProjectLocation().getAbsolutePath());
128
150
129
        this.projectNameTextField.setText(getProjectName());
151
        this.projectNameTextField.setText(getProjectName());
130
        this.projectNameTextField.selectAll();
152
        this.projectNameTextField.selectAll();
Lines 134-139 Link Here
134
        return new HelpCtx(CustomComponentVisualPanel.class);
156
        return new HelpCtx(CustomComponentVisualPanel.class);
135
    }
157
    }
136
    
158
    
159
    private void initDocumentListeners() {
160
        nameDL = new DocumentAdapter() {
161
            public void insertUpdate(DocumentEvent e) {
162
                updateTexts(e);
163
                checkValidity();
164
            }
165
        };
166
        locationDL = new DocumentAdapter() {
167
            public void insertUpdate(DocumentEvent e) {
168
                locationUpdated = true;
169
                updateTexts(e);
170
                checkValidity();
171
            }
172
        };
173
        isMainAL = new ActionListener() {
174
            public void actionPerformed(ActionEvent e) {
175
                mainProjectTouched = true;
176
            }
177
        };
178
    }
179
    
180
    private void attachDocumentListeners() {
181
        if (!listenersAttached) {
182
            projectNameTextField.getDocument().addDocumentListener(nameDL);
183
            projectLocationTextField.getDocument().addDocumentListener(locationDL);
184
            mainProject.addActionListener(isMainAL);
185
            listenersAttached = true;
186
        }
187
    }
188
    
189
    private void removeDocumentListeners() {
190
        if (listenersAttached) {
191
            projectNameTextField.getDocument().removeDocumentListener(nameDL);
192
            projectLocationTextField.getDocument().removeDocumentListener(locationDL);
193
            mainProject.removeActionListener(isMainAL);
194
            listenersAttached = false;
195
        }
196
    }
197
    
198
    private void initPanels(WizardDescriptor settings){
199
        if (typeChooserPanel != null){
200
            typeChooserPanelContainer.removeAll();
201
            typeChooserPanel = null;
202
        }
203
        typeChooserPanel = ModuleTypePanel.createComponent(settings);
204
        typeChooserPanelContainer.add(typeChooserPanel, BorderLayout.CENTER);
205
        typeChooserPanelContainer.validate();
206
        validate();
207
    }
208
    
209
    private void moduleSuiteValueChanged(Object val) {
210
        String suite = null;
211
        if (val != null && val instanceof String){
212
            suite = (String)val;
213
        }
214
        if (!locationUpdated) {
215
            setLocation(computeLocationValue(suite));
216
        }
217
        checkValidity();
218
    }
219
220
    private void moduletypeChanged(Object val) {
221
        Boolean isStandAlone = null;
222
        if (val != null && val instanceof Boolean){
223
            isStandAlone = ((Boolean)val).booleanValue();
224
        }
225
        // null means both radio uttons are deselected and disaled
226
        if (isStandAlone == null){
227
            return;
228
        }
229
        
230
        if (!mainProjectTouched) {
231
            mainProject.setSelected(isStandAlone);
232
        }
233
        if (!locationUpdated) {
234
            setLocation(computeInitialLocationValue());
235
        }
236
        checkValidity();
237
    }
238
239
    private void setLocation(String location) {
240
        boolean revert = !locationUpdated;
241
        projectLocationTextField.setText(location);
242
        locationUpdated = revert ^ true;
243
    }
244
    
245
    boolean checkValidity() {
246
        if (!isProjectNameValid()){
247
            return false;
248
        } else if (!isProjectLocationValid()){
249
            return false;
250
        } else if (!isCreatedFolderValid()){
251
            return false;
252
        } else if (!ModuleTypePanel.validate(getSettings())){
253
            return false;
254
        }
255
256
        markValid();
257
        return true;
258
    }
259
137
    private boolean isProjectNameValid(){
260
    private boolean isProjectNameValid(){
138
        if (getProjectNameValue().trim().length() == 0) {
261
        if (getProjectNameValue().trim().length() == 0) {
139
            setError(getMessage(MSG_NAME_CANNOT_BE_EMPTY));
262
            setError(getMessage(MSG_NAME_CANNOT_BE_EMPTY));
Lines 187-207 Link Here
187
        return true;
310
        return true;
188
    }
311
    }
189
312
190
    // TODO
191
    boolean checkValidity() {
192
        if (!isProjectNameValid()){
193
            return false;
194
        } else if (!isProjectLocationValid()){
195
            return false;
196
        } else if (!isCreatedFolderValid()){
197
            return false;
198
        }
199
200
201
        markValid();
202
        return true;
203
    }
204
205
    private String getProjectNameValue(){
313
    private String getProjectNameValue(){
206
        return projectNameTextField.getText();
314
        return projectNameTextField.getText();
207
    }
315
    }
Lines 232-238 Link Here
232
    }
340
    }
233
341
234
    private final void setMessage(String message) {
342
    private final void setMessage(String message) {
235
        mySettings.putProperty(
343
        getSettings().putProperty(
236
                CustomComponentWizardIterator.WIZARD_PANEL_ERROR_MESSAGE,
344
                CustomComponentWizardIterator.WIZARD_PANEL_ERROR_MESSAGE,
237
                message);
345
                message);
238
    }
346
    }
Lines 252-271 Link Here
252
     * @return File Directory that will contain project folder
360
     * @return File Directory that will contain project folder
253
     */
361
     */
254
    File getProjectLocation(){
362
    File getProjectLocation(){
255
        File projectLocation = (File) mySettings
363
        File projectLocation = (File) getSettings()
256
                .getProperty(CustomComponentWizardIterator.PROJECT_DIR);
364
                .getProperty(CustomComponentWizardIterator.PROJECT_DIR);
257
        // project directory
365
        // project directory
258
        if (projectLocation == null
366
        if (projectLocation == null
259
                || projectLocation.getParentFile() == null
367
                || projectLocation.getParentFile() == null
260
                || !projectLocation.getParentFile().isDirectory())
368
                || !projectLocation.getParentFile().isDirectory())
261
        {
369
        {
262
            projectLocation = ProjectChooser.getProjectsFolder();
370
            projectLocation = new File(computeInitialLocationValue());
263
        } else {
371
        } else {
264
            projectLocation = projectLocation.getParentFile();
372
            projectLocation = projectLocation.getParentFile();
265
        }
373
        }
266
        return projectLocation;
374
        return projectLocation;
267
    }
375
    }
268
376
377
    private String computeInitialLocationValue(){
378
        if (typeChooserPanel != null && isSuiteComponent()) {
379
            return computeLocationValue(getSelectedSuite());
380
        } else {
381
            String path = ProjectChooser.getProjectsFolder().getAbsolutePath();
382
            return computeLocationValue(path);
383
        }
384
    }
385
    
386
    private String computeLocationValue(String value) {
387
        if (value == null) {
388
            value = System.getProperty("user.home"); // NOI18N
389
        }
390
        File file = new File(value);
391
        if (!file.exists() && file.getParent() != null) {
392
            return computeLocationValue(file.getParent());
393
        } else {
394
            return file.exists() ? value : System.getProperty("user.home"); // NOI18N
395
        }
396
    }
397
    
398
    private Boolean isSuiteComponent(){
399
        Boolean result = null;
400
        if (getSettings() != null){
401
            result = (Boolean) getSettings().getProperty(
402
                    ModuleTypePanel.IS_STANDALONE_OR_SUITE_COMPONENT);
403
        }
404
        return result != null ? !result : false;
405
    }
406
    
407
    private String getSelectedSuite(){
408
        return (String)getSettings().getProperty(ModuleTypePanel.SUITE_ROOT);
409
    }
410
    
269
    /**
411
    /**
270
     * Returns project name value stored in WizardDescriptor, or
412
     * Returns project name value stored in WizardDescriptor, or
271
     * default value if it wasn't stored yet
413
     * default value if it wasn't stored yet
Lines 274-280 Link Here
274
     * name wich is not used as directory name in project location directory yet.
416
     * name wich is not used as directory name in project location directory yet.
275
     */
417
     */
276
    String getProjectName(){
418
    String getProjectName(){
277
        String projectName = (String) mySettings
419
        String projectName = (String) getSettings()
278
                .getProperty(CustomComponentWizardIterator.PROJECT_NAME);
420
                .getProperty(CustomComponentWizardIterator.PROJECT_NAME);
279
        // project name
421
        // project name
280
        if (projectName == null) {
422
        if (projectName == null) {
Lines 284-290 Link Here
284
    }
426
    }
285
427
286
    Boolean getIsMainProject(){
428
    Boolean getIsMainProject(){
287
        Boolean isMain = (Boolean) mySettings
429
        Boolean isMain = (Boolean) getSettings()
288
                .getProperty(CustomComponentWizardIterator.SET_AS_MAIN);
430
                .getProperty(CustomComponentWizardIterator.SET_AS_MAIN);
289
        return isMain;
431
        return isMain;
290
    }
432
    }
Lines 304-324 Link Here
304
     */
446
     */
305
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
447
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
306
    private void initComponents() {
448
    private void initComponents() {
449
        java.awt.GridBagConstraints gridBagConstraints;
307
450
451
        mainProject = new javax.swing.JCheckBox();
452
        infoPanel = new javax.swing.JPanel();
308
        projectNameLabel = new javax.swing.JLabel();
453
        projectNameLabel = new javax.swing.JLabel();
309
        projectNameTextField = new javax.swing.JTextField();
454
        projectNameTextField = new javax.swing.JTextField();
455
        createdFolderTextField = new javax.swing.JTextField();
310
        projectLocationLabel = new javax.swing.JLabel();
456
        projectLocationLabel = new javax.swing.JLabel();
457
        createdFolderLabel = new javax.swing.JLabel();
311
        projectLocationTextField = new javax.swing.JTextField();
458
        projectLocationTextField = new javax.swing.JTextField();
312
        browseButton = new javax.swing.JButton();
459
        browseButton = new javax.swing.JButton();
313
        createdFolderLabel = new javax.swing.JLabel();
460
        typeChooserPanelContainer = new javax.swing.JPanel();
314
        createdFolderTextField = new javax.swing.JTextField();
461
        fillerPanel = new javax.swing.JPanel();
315
        mainProject = new javax.swing.JCheckBox();
462
463
        setLayout(new java.awt.GridBagLayout());
464
465
        mainProject.setSelected(true);
466
        org.openide.awt.Mnemonics.setLocalizedText(mainProject, org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "LBL_SetAsMainProject")); // NOI18N
467
        gridBagConstraints = new java.awt.GridBagConstraints();
468
        gridBagConstraints.gridx = 0;
469
        gridBagConstraints.gridy = 2;
470
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
471
        gridBagConstraints.insets = new java.awt.Insets(12, 0, 0, 0);
472
        add(mainProject, gridBagConstraints);
473
        mainProject.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "ACSN_SetAsMainProject")); // NOI18N
474
        mainProject.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "ACSD_SetAsMainProject")); // NOI18N
475
476
        infoPanel.setLayout(new java.awt.GridBagLayout());
316
477
317
        projectNameLabel.setLabelFor(projectNameTextField);
478
        projectNameLabel.setLabelFor(projectNameTextField);
318
        org.openide.awt.Mnemonics.setLocalizedText(projectNameLabel, org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "LBL_ProjectName")); // NOI18N
479
        org.openide.awt.Mnemonics.setLocalizedText(projectNameLabel, org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "LBL_ProjectName")); // NOI18N
480
        gridBagConstraints = new java.awt.GridBagConstraints();
481
        gridBagConstraints.gridx = 0;
482
        gridBagConstraints.gridy = 0;
483
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
484
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 12);
485
        infoPanel.add(projectNameLabel, gridBagConstraints);
486
        projectNameLabel.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "ACSN_ProjectName")); // NOI18N
487
        projectNameLabel.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "ACSD_ProjectName")); // NOI18N
488
489
        gridBagConstraints = new java.awt.GridBagConstraints();
490
        gridBagConstraints.gridx = 1;
491
        gridBagConstraints.gridy = 0;
492
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
493
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
494
        gridBagConstraints.weightx = 1.0;
495
        infoPanel.add(projectNameTextField, gridBagConstraints);
496
497
        createdFolderTextField.setEditable(false);
498
        gridBagConstraints = new java.awt.GridBagConstraints();
499
        gridBagConstraints.gridx = 1;
500
        gridBagConstraints.gridy = 2;
501
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
502
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
503
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 6, 0);
504
        infoPanel.add(createdFolderTextField, gridBagConstraints);
319
505
320
        projectLocationLabel.setLabelFor(projectLocationTextField);
506
        projectLocationLabel.setLabelFor(projectLocationTextField);
321
        org.openide.awt.Mnemonics.setLocalizedText(projectLocationLabel, org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "LBL_ProjectLocation")); // NOI18N
507
        org.openide.awt.Mnemonics.setLocalizedText(projectLocationLabel, org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "LBL_ProjectLocation")); // NOI18N
508
        gridBagConstraints = new java.awt.GridBagConstraints();
509
        gridBagConstraints.gridx = 0;
510
        gridBagConstraints.gridy = 1;
511
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
512
        gridBagConstraints.insets = new java.awt.Insets(6, 0, 6, 12);
513
        infoPanel.add(projectLocationLabel, gridBagConstraints);
514
        projectLocationLabel.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "ACSN_ProjectLocation")); // NOI18N
515
        projectLocationLabel.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "ACSD_ProjectLocation")); // NOI18N
516
517
        createdFolderLabel.setLabelFor(createdFolderTextField);
518
        org.openide.awt.Mnemonics.setLocalizedText(createdFolderLabel, org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "LBL_ProjectFolder")); // NOI18N
519
        gridBagConstraints = new java.awt.GridBagConstraints();
520
        gridBagConstraints.gridx = 0;
521
        gridBagConstraints.gridy = 2;
522
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
523
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 6, 12);
524
        infoPanel.add(createdFolderLabel, gridBagConstraints);
525
        createdFolderLabel.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "ACSN_ProjectFolder")); // NOI18N
526
        createdFolderLabel.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "ACSD_ProjectFolder")); // NOI18N
527
528
        gridBagConstraints = new java.awt.GridBagConstraints();
529
        gridBagConstraints.gridx = 1;
530
        gridBagConstraints.gridy = 1;
531
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
532
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
533
        gridBagConstraints.insets = new java.awt.Insets(6, 0, 6, 0);
534
        infoPanel.add(projectLocationTextField, gridBagConstraints);
322
535
323
        org.openide.awt.Mnemonics.setLocalizedText(browseButton, org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "LBL_Browse_Button")); // NOI18N
536
        org.openide.awt.Mnemonics.setLocalizedText(browseButton, org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "LBL_Browse_Button")); // NOI18N
324
        browseButton.setActionCommand(BROWSE);
537
        browseButton.setActionCommand(BROWSE);
Lines 327-392 Link Here
327
                browseButtonActionPerformed(evt);
540
                browseButtonActionPerformed(evt);
328
            }
541
            }
329
        });
542
        });
330
543
        gridBagConstraints = new java.awt.GridBagConstraints();
331
        createdFolderLabel.setLabelFor(createdFolderTextField);
544
        gridBagConstraints.gridx = 2;
332
        org.openide.awt.Mnemonics.setLocalizedText(createdFolderLabel, org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "LBL_ProjectFolder")); // NOI18N
545
        gridBagConstraints.gridy = 1;
333
546
        gridBagConstraints.insets = new java.awt.Insets(6, 12, 6, 0);
334
        createdFolderTextField.setEditable(false);
547
        infoPanel.add(browseButton, gridBagConstraints);
335
336
        mainProject.setSelected(true);
337
        org.openide.awt.Mnemonics.setLocalizedText(mainProject, org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "LBL_SetAsMainProject")); // NOI18N
338
339
        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
340
        this.setLayout(layout);
341
        layout.setHorizontalGroup(
342
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
343
            .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
344
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
345
                    .add(org.jdesktop.layout.GroupLayout.LEADING, mainProject, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 541, Short.MAX_VALUE)
346
                    .add(layout.createSequentialGroup()
347
                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
348
                            .add(projectLocationLabel)
349
                            .add(createdFolderLabel)
350
                            .add(projectNameLabel))
351
                        .add(19, 19, 19)
352
                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
353
                            .add(projectNameTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 441, Short.MAX_VALUE)
354
                            .add(org.jdesktop.layout.GroupLayout.TRAILING, projectLocationTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 441, Short.MAX_VALUE)
355
                            .add(org.jdesktop.layout.GroupLayout.TRAILING, createdFolderTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 441, Short.MAX_VALUE))))
356
                .add(18, 18, 18)
357
                .add(browseButton)
358
                .add(0, 0, 0))
359
        );
360
        layout.setVerticalGroup(
361
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
362
            .add(layout.createSequentialGroup()
363
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
364
                    .add(projectNameLabel)
365
                    .add(projectNameTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
366
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
367
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
368
                    .add(projectLocationTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
369
                    .add(projectLocationLabel)
370
                    .add(browseButton))
371
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
372
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
373
                    .add(createdFolderTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
374
                    .add(createdFolderLabel))
375
                .add(18, 18, 18)
376
                .add(mainProject)
377
                .addContainerGap(183, Short.MAX_VALUE))
378
        );
379
380
        projectNameLabel.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "ACSN_ProjectName")); // NOI18N
381
        projectNameLabel.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "ACSD_ProjectName")); // NOI18N
382
        projectLocationLabel.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "ACSN_ProjectLocation")); // NOI18N
383
        projectLocationLabel.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "ACSD_ProjectLocation")); // NOI18N
384
        browseButton.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "ACSN_Browse_Button")); // NOI18N
548
        browseButton.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "ACSN_Browse_Button")); // NOI18N
385
        browseButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "ACSN_Browse_Button")); // NOI18N
549
        browseButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "ACSN_Browse_Button")); // NOI18N
386
        createdFolderLabel.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "ACSN_ProjectFolder")); // NOI18N
550
387
        createdFolderLabel.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "ACSD_ProjectFolder")); // NOI18N
551
        gridBagConstraints = new java.awt.GridBagConstraints();
388
        mainProject.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "ACSN_SetAsMainProject")); // NOI18N
552
        gridBagConstraints.gridx = 0;
389
        mainProject.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "ACSD_SetAsMainProject")); // NOI18N
553
        gridBagConstraints.gridy = 0;
554
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
555
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
556
        add(infoPanel, gridBagConstraints);
557
558
        typeChooserPanelContainer.setLayout(new java.awt.BorderLayout());
559
        gridBagConstraints = new java.awt.GridBagConstraints();
560
        gridBagConstraints.gridx = 0;
561
        gridBagConstraints.gridy = 1;
562
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
563
        add(typeChooserPanelContainer, gridBagConstraints);
564
        gridBagConstraints = new java.awt.GridBagConstraints();
565
        gridBagConstraints.gridx = 0;
566
        gridBagConstraints.gridy = 3;
567
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
568
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
569
        gridBagConstraints.weightx = 1.0;
570
        gridBagConstraints.weighty = 1.0;
571
        add(fillerPanel, gridBagConstraints);
390
    }// </editor-fold>//GEN-END:initComponents
572
    }// </editor-fold>//GEN-END:initComponents
391
573
392
    private void browseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseButtonActionPerformed
574
    private void browseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseButtonActionPerformed
Lines 405-412 Link Here
405
            }
587
            }
406
            if (JFileChooser.APPROVE_OPTION == chooser.showOpenDialog(this)) {
588
            if (JFileChooser.APPROVE_OPTION == chooser.showOpenDialog(this)) {
407
                File projectDir = chooser.getSelectedFile();//GEN-LAST:event_browseButtonActionPerformed
589
                File projectDir = chooser.getSelectedFile();//GEN-LAST:event_browseButtonActionPerformed
408
                projectLocationTextField.setText(
590
                String projectDirPath = FileUtil.normalizeFile(projectDir).getAbsolutePath();
409
                        FileUtil.normalizeFile(projectDir).getAbsolutePath());
591
                projectLocationTextField.setText(computeLocationValue(projectDirPath));
410
            }
592
            }
411
            //myPanel.fireChangeEvent();
593
            //myPanel.fireChangeEvent();
412
        }
594
        }
Lines 424-434 Link Here
424
    private javax.swing.JButton browseButton;
606
    private javax.swing.JButton browseButton;
425
    private javax.swing.JLabel createdFolderLabel;
607
    private javax.swing.JLabel createdFolderLabel;
426
    private javax.swing.JTextField createdFolderTextField;
608
    private javax.swing.JTextField createdFolderTextField;
609
    private javax.swing.JPanel fillerPanel;
610
    private javax.swing.JPanel infoPanel;
427
    private javax.swing.JCheckBox mainProject;
611
    private javax.swing.JCheckBox mainProject;
428
    private javax.swing.JLabel projectLocationLabel;
612
    private javax.swing.JLabel projectLocationLabel;
429
    private javax.swing.JTextField projectLocationTextField;
613
    private javax.swing.JTextField projectLocationTextField;
430
    private javax.swing.JLabel projectNameLabel;
614
    private javax.swing.JLabel projectNameLabel;
431
    private javax.swing.JTextField projectNameTextField;
615
    private javax.swing.JTextField projectNameTextField;
616
    private javax.swing.JPanel typeChooserPanelContainer;
432
    // End of variables declaration//GEN-END:variables
617
    // End of variables declaration//GEN-END:variables
433
618
434
    // TODO: use FileUtil.findFreeFolderName here
619
    // TODO: use FileUtil.findFreeFolderName here
Lines 464-478 Link Here
464
            String projectName = projectNameTextField.getText();
649
            String projectName = projectNameTextField.getText();
465
            String projectFolder = projectLocationTextField.getText();
650
            String projectFolder = projectLocationTextField.getText();
466
651
467
            //if (projectFolder.trim().length() == 0 || projectFolder.equals(oldName)) {
468
            createdFolderTextField.setText(projectFolder + File.separatorChar + projectName);
652
            createdFolderTextField.setText(projectFolder + File.separatorChar + projectName);
469
        //}
653
            projectFolderChanged(getCreatedFolderValue());
470
654
471
        }
655
        }
472
        //myPanel.fireChangeEvent(); // Notify that the myPanel changed
656
    }
657
    
658
    private void projectFolderChanged(String projectFolder){
659
        File folder = FileUtil.normalizeFile(new File(projectFolder));
660
        ModuleTypePanel.setProjectFolder(getSettings(), folder);
661
    }
473
662
663
    private WizardDescriptor getSettings(){
664
        return mySettings;
474
    }
665
    }
475
666
476
    private WizardDescriptor mySettings;
667
    private WizardDescriptor mySettings;
477
    private CustomComponentWizardPanel myPanel;
668
    private CustomComponentWizardPanel myPanel;
669
    private JComponent typeChooserPanel;
670
    private boolean locationUpdated;
671
    private boolean mainProjectTouched;
672
673
    private boolean listenersAttached;
674
    private DocumentListener nameDL;
675
    private DocumentListener locationDL;
676
    private ActionListener isMainAL;
478
}
677
}
(-)a/vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/ui/wizard/CustomComponentWizardIterator.java (-221 / +28 lines)
Lines 42-53 Link Here
42
package org.netbeans.modules.vmd.componentssupport.ui.wizard;
42
package org.netbeans.modules.vmd.componentssupport.ui.wizard;
43
43
44
import java.awt.Component;
44
import java.awt.Component;
45
import java.io.ByteArrayInputStream;
46
import java.io.ByteArrayOutputStream;
47
import java.io.File;
45
import java.io.File;
48
import java.io.IOException;
46
import java.io.IOException;
49
import java.io.InputStream;
50
import java.io.OutputStream;
51
import java.text.MessageFormat;
47
import java.text.MessageFormat;
52
import java.util.Collections;
48
import java.util.Collections;
53
import java.util.Enumeration;
49
import java.util.Enumeration;
Lines 56-63 Link Here
56
import java.util.Map;
52
import java.util.Map;
57
import java.util.NoSuchElementException;
53
import java.util.NoSuchElementException;
58
import java.util.Set;
54
import java.util.Set;
59
import java.util.zip.ZipEntry;
60
import java.util.zip.ZipInputStream;
61
55
62
import javax.swing.JComponent;
56
import javax.swing.JComponent;
63
import javax.swing.event.ChangeListener;
57
import javax.swing.event.ChangeListener;
Lines 65-100 Link Here
65
import org.netbeans.api.project.FileOwnerQuery;
59
import org.netbeans.api.project.FileOwnerQuery;
66
import org.netbeans.api.project.Project;
60
import org.netbeans.api.project.Project;
67
import org.netbeans.api.project.ProjectManager;
61
import org.netbeans.api.project.ProjectManager;
62
import org.netbeans.modules.apisupport.project.ui.wizard.spi.ModuleTypePanel;
68
import org.netbeans.modules.vmd.componentssupport.ui.helpers.BaseHelper;
63
import org.netbeans.modules.vmd.componentssupport.ui.helpers.BaseHelper;
69
import org.netbeans.modules.vmd.componentssupport.ui.helpers.CustomComponentHelper;
64
import org.netbeans.modules.vmd.componentssupport.ui.helpers.CustomComponentHelper;
70
import org.netbeans.modules.vmd.componentssupport.ui.helpers.JavaMELibsConfigurationHelper;
65
import org.netbeans.modules.vmd.componentssupport.ui.helpers.JavaMELibsConfigurationHelper;
66
import org.netbeans.modules.vmd.componentssupport.ui.helpers.ProjectTemplateZipHelper;
71
import org.netbeans.spi.project.ui.support.ProjectChooser;
67
import org.netbeans.spi.project.ui.support.ProjectChooser;
72
import org.netbeans.spi.project.ui.templates.support.Templates;
73
import org.openide.WizardDescriptor;
68
import org.openide.WizardDescriptor;
74
import org.openide.filesystems.FileObject;
69
import org.openide.filesystems.FileObject;
75
import org.openide.filesystems.FileUtil;
70
import org.openide.filesystems.FileUtil;
76
import org.openide.util.Exceptions;
77
import org.openide.util.NbBundle;
71
import org.openide.util.NbBundle;
78
import org.openide.xml.XMLUtil;
79
import org.w3c.dom.Document;
80
import org.w3c.dom.Element;
81
import org.w3c.dom.NodeList;
82
import org.xml.sax.InputSource;
83
72
84
public class CustomComponentWizardIterator implements
73
public class CustomComponentWizardIterator implements
85
        WizardDescriptor./* Progress */InstantiatingIterator
74
        WizardDescriptor./* Progress */InstantiatingIterator
86
{
75
{
87
88
    // unzipped project filtering
89
    private static final String UTF_8       = "UTF-8";                           // NOI18N
90
    
91
    private static final String CODE_NAME_BASE 
92
                                            = "code-name-base";                  // NOI18N
93
    private static final String DATA        = "data";                            // NOI18N
94
    private static final String PROJECT_XML = "nbproject/project.xml";           // NOI18N
95
    private static final String BUILD_IMPL_XML 
96
                                            = "nbproject/build-impl.xml";        // NOI18N
97
    private static final String BUILD_XML   = "build.xml";                       // NOI18N
98
76
99
    // wizard properties
77
    // wizard properties
100
    public static final String WIZARD_PANEL_ERROR_MESSAGE 
78
    public static final String WIZARD_PANEL_ERROR_MESSAGE 
Lines 105-110 Link Here
105
    public static final String SELECTED_INDEX 
83
    public static final String SELECTED_INDEX 
106
                                            = WizardDescriptor.PROP_CONTENT_SELECTED_INDEX;// NOI18N
84
                                            = WizardDescriptor.PROP_CONTENT_SELECTED_INDEX;// NOI18N
107
85
86
    public static final String BUNDLE_PROPERTIES
87
                                            = BaseHelper.BUNDLE_PROPERTIES;
88
    public static final String LAYER_XML    = BaseHelper.LAYER_XML;
108
    // steps
89
    // steps
109
    public static final String STEP_BASIC_PARAMS 
90
    public static final String STEP_BASIC_PARAMS 
110
                                            = "LBL_BasicProjectParamsStep";      // NOI18N
91
                                            = "LBL_BasicProjectParamsStep";      // NOI18N
Lines 123-128 Link Here
123
    public static final String CODE_BASE_NAME
104
    public static final String CODE_BASE_NAME
124
                                            = "codeBaseName";                    // NOI18N
105
                                            = "codeBaseName";                    // NOI18N
125
    public static final String DISPLAY_NAME = "displayName";                     // NOI18N
106
    public static final String DISPLAY_NAME = "displayName";                     // NOI18N
107
126
    // added library descriptors
108
    // added library descriptors
127
    public static final String LIBRARIES    = "libraries";                       // NOI18N
109
    public static final String LIBRARIES    = "libraries";                       // NOI18N
128
    public static final String LIB_DISPLAY_NAMES
110
    public static final String LIB_DISPLAY_NAMES
Lines 131-154 Link Here
131
    // added Custom components
113
    // added Custom components
132
    public static final String CUSTOM_COMPONENTS  
114
    public static final String CUSTOM_COMPONENTS  
133
                                            = "customComponents";                // NOI18N
115
                                            = "customComponents";                // NOI18N
134
116
    
135
    // parameters for project
117
    private static final String TEMPLATE_PROJECT_NETBEANSORG 
136
    private static final String CODE_NAME_PARAM 
118
                                = "CustomComponentProject_netbeansorg.zip";     //NOI18N
137
                                            = "_CODE_NAME_";                     // NOI18N
119
    private static final String TEMPLATE_PROJECT_STANDALONE 
138
    private static final String BUNDLE_PATH_PARAM 
120
                                = "CustomComponentProject_standalone.zip";      //NOI18N
139
                                            = "_BUNDLE_PATH_";                   // NOI18N
121
    private static final String TEMPLATE_PROJECT_SUITECOMPONENT 
140
    private static final String PROJECT_NAME_PARAM 
122
                                = "CustomComponentProject_suitecomponent.zip";  //NOI18N
141
                                            = "_PROJECT_NAME_";                  // NOI18N
142
    // names of templates
143
    public static final String BUNDLE_PROPERTIES 
144
                                            = "Bundle.properties";               // NOI18N
145
    public static final String LAYER_XML    = "layer.xml";             // NOI18N
146
147
    private static final String SRC         = "src/";                            // NOI18N
148
    private static final String BUNDLE_NAME = SRC + BUNDLE_PROPERTIES;           // NOI18N
149
    private static final String LAYER_NAME  = SRC + LAYER_XML;                   // NOI18N
150
    private static final String MANIFEST    = "manifest.mf";                     // NOI18N
151
    private static final String LAYER       = "OpenIDE-Module-Layer: ";          // NOI18N
152
123
153
    private CustomComponentWizardIterator() {
124
    private CustomComponentWizardIterator() {
154
    }
125
    }
Lines 188-196 Link Here
188
                .getProperty(PROJECT_DIR));
159
                .getProperty(PROJECT_DIR));
189
        dirF.mkdirs();
160
        dirF.mkdirs();
190
161
191
        FileObject template = Templates.getTemplate(myWizard);
162
        FileObject template = getProjectTemplate(myWizard);
192
        FileObject dir = FileUtil.toFileObject(dirF);
163
        FileObject dir = FileUtil.toFileObject(dirF);
193
        unZipFile(template.getInputStream(), dir , myWizard );
164
        
165
        ProjectTemplateZipHelper.
166
                unZipFile(template.getInputStream(), dir , myWizard );
194
167
195
        
168
        
196
        // Always open top dir as a project:
169
        // Always open top dir as a project:
Lines 218-223 Link Here
218
        // store custom component descriptors
191
        // store custom component descriptors
219
        configureComponents(createdProject, myWizard);
192
        configureComponents(createdProject, myWizard);
220
        return resultSet;
193
        return resultSet;
194
    }
195
    
196
    private FileObject getProjectTemplate(WizardDescriptor wizard){
197
        if (BaseHelper.isNetBeansOrg(wizard)){
198
            return BaseHelper.getTemplate(TEMPLATE_PROJECT_NETBEANSORG);
199
        } else if (BaseHelper.isSuiteComponent(wizard)){
200
            return BaseHelper.getTemplate(TEMPLATE_PROJECT_SUITECOMPONENT);
201
        } else if (BaseHelper.isStandalone(wizard)){
202
            return BaseHelper.getTemplate(TEMPLATE_PROJECT_STANDALONE);
203
        }
204
        throw new IllegalArgumentException("unsupported wizard type");
221
    }
205
    }
222
206
223
    public void initialize( WizardDescriptor wiz ) {
207
    public void initialize( WizardDescriptor wiz ) {
Lines 316-498 Link Here
316
            return Collections.EMPTY_SET;
300
            return Collections.EMPTY_SET;
317
    }
301
    }
318
    
302
    
319
    private static void unZipFile( InputStream source, FileObject projectRoot ,
320
            WizardDescriptor wizard )
321
            throws IOException
322
    {
323
        try {
324
            ZipInputStream zipIS = new ZipInputStream(source);
325
            ZipEntry entry;
326
            while ((entry = zipIS.getNextEntry()) != null) {
327
                if (entry.isDirectory()) {
328
                    FileUtil.createFolder(projectRoot, entry.getName());
329
                }
330
                else {
331
                    FileObject fo = null;
332
                    if (PROJECT_XML.equals(entry.getName())) {
333
                        // Special handling for setting name of Ant-based
334
                        // projects; customize as needed:
335
                        fo = FileUtil.createData(projectRoot, entry
336
                                .getName());
337
                        filterProjectXML(fo, zipIS, (String)wizard.getProperty( 
338
                                CODE_BASE_NAME ));
339
                    }
340
                    else if ( MANIFEST.equals(entry.getName())){
341
                        fo = FileUtil.createData(projectRoot, entry
342
                                .getName());
343
                        filterManifest( fo , zipIS, wizard );
344
                    }
345
                    else if ( LAYER_NAME.equals(entry.getName())){
346
                        copyLayer( projectRoot , zipIS , wizard );
347
                    }
348
                    else if ( BUNDLE_NAME.equals(entry.getName()) ) {
349
                        filterBundle( projectRoot , zipIS, wizard );
350
                    }
351
                    else if ( BUILD_XML.equals(entry.getName()) 
352
                            || BUILD_IMPL_XML.equals(entry.getName())) 
353
                    {
354
                        fo = FileUtil.createData(projectRoot, entry
355
                                .getName());
356
                        filterBuild( fo , zipIS, (String)wizard.getProperty( 
357
                                CODE_BASE_NAME ) );
358
                    }
359
                    else {
360
                        fo = FileUtil.createData(projectRoot, entry
361
                                .getName());
362
                        BaseHelper.copyByteAfterByte(zipIS, fo);
363
                    }
364
                }
365
            }
366
        }
367
        finally {
368
            source.close();
369
        }
370
    }
371
372
    private static void filterBuild( FileObject fo, ZipInputStream zipIS,
373
            String codeBaseName ) throws IOException
374
    {
375
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
376
        FileUtil.copy( zipIS , baos);
377
        String content = baos.toString(UTF_8);
378
        
379
        content = content.replace( CODE_NAME_PARAM , codeBaseName );
380
381
        ByteArrayInputStream inputStream = new ByteArrayInputStream(content
382
                .getBytes(UTF_8));
383
        OutputStream out = fo.getOutputStream();
384
        try {
385
            FileUtil.copy(inputStream, out);
386
        }
387
        finally {
388
            out.close();
389
        }    
390
    }
391
392
    private static void filterBundle( FileObject projectRoot, ZipInputStream is,
393
            WizardDescriptor wizardDescriptor ) throws IOException
394
    {
395
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
396
        FileUtil.copy(is, baos);
397
        String content = baos.toString(UTF_8);
398
        
399
        content = content.replace( PROJECT_NAME_PARAM , 
400
                (String)wizardDescriptor.getProperty( DISPLAY_NAME ) );
401
402
        ByteArrayInputStream inputStream = new ByteArrayInputStream(content
403
                .getBytes(UTF_8));
404
        FileObject fileObject = FileUtil.createData(projectRoot, 
405
                SRC + (String)wizardDescriptor.getProperty( BUNDLE_PATH) );
406
        OutputStream out = fileObject.getOutputStream();
407
        try {
408
            FileUtil.copy(inputStream, out);
409
        }
410
        finally {
411
            out.close();
412
        }                
413
    }
414
415
    private static void copyLayer( FileObject projectRoot, ZipInputStream is,
416
            WizardDescriptor wizard ) throws IOException
417
    {
418
        String layer = (String)wizard.getProperty( LAYER_PATH);
419
        if ( layer == null || layer.length() ==0 ){
420
            return;
421
        }
422
        FileObject fileObject = FileUtil.createData(projectRoot, SRC + layer );
423
        BaseHelper.copyByteAfterByte(is, fileObject );
424
    }
425
426
    private static void filterManifest( FileObject fo, ZipInputStream is,
427
            WizardDescriptor wizard ) throws IOException
428
    {
429
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
430
        FileUtil.copy(is, baos);
431
        String content = baos.toString(UTF_8);
432
        
433
        content = content.replace( CODE_NAME_PARAM , (String)wizard.getProperty( 
434
                CODE_BASE_NAME ));
435
        content = content.replace( BUNDLE_PATH_PARAM, (String)wizard.getProperty( 
436
                BUNDLE_PATH));
437
        StringBuilder builder = new StringBuilder( content );
438
        String layer = (String)wizard.getProperty( LAYER_PATH);
439
        if ( layer != null){
440
            builder.append( LAYER );
441
            builder.append( layer );
442
            builder.append( "\n" );
443
        }
444
445
        ByteArrayInputStream inputStream = new ByteArrayInputStream(
446
                builder.toString().getBytes(UTF_8));
447
        OutputStream out = fo.getOutputStream();
448
        try {
449
            FileUtil.copy(inputStream, out);
450
        }
451
        finally {
452
            out.close();
453
        }        
454
    }
455
456
457
    private static void filterProjectXML( FileObject fo, ZipInputStream str,
458
            String name ) throws IOException
459
    {
460
        try {
461
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
462
            FileUtil.copy(str, baos);
463
            Document doc = XMLUtil.parse(new InputSource(
464
                    new ByteArrayInputStream(baos.toByteArray())), false,
465
                    false, null, null);
466
            NodeList nl = doc.getDocumentElement().getElementsByTagName(
467
                    CODE_NAME_BASE);
468
            if (nl != null) {
469
                for (int i = 0; i < nl.getLength(); i++) {
470
                    Element el = (Element) nl.item(i);
471
                    if (el.getParentNode() != null
472
                            && DATA.equals(el.getParentNode().getNodeName()))
473
                    {
474
                        NodeList nl2 = el.getChildNodes();
475
                        if (nl2.getLength() > 0) {
476
                            nl2.item(0).setNodeValue(name);
477
                        }
478
                        break;
479
                    }
480
                }
481
            }
482
            OutputStream out = fo.getOutputStream();
483
            try {
484
                XMLUtil.write(doc, out, UTF_8);
485
            }
486
            finally {
487
                out.close();
488
            }
489
        }
490
        catch (Exception ex) {
491
            Exceptions.printStackTrace(ex);
492
            BaseHelper.copyByteAfterByte(str, fo);
493
        }
494
495
    }
496
    
303
    
497
    private int index;
304
    private int index;
498
    private WizardDescriptor.Panel[] panels;
305
    private WizardDescriptor.Panel[] panels;
(-)a/vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/ui/wizard/DocumentAdapter.java (-2 / +2 lines)
Lines 44-49 Link Here
44
import javax.swing.event.DocumentListener;
44
import javax.swing.event.DocumentListener;
45
45
46
abstract class DocumentAdapter implements DocumentListener {
46
abstract class DocumentAdapter implements DocumentListener {
47
    public void removeUpdate(DocumentEvent e) { insertUpdate(null); }
47
    public void removeUpdate(DocumentEvent e) { insertUpdate(e); }
48
    public void changedUpdate(DocumentEvent e) { insertUpdate(null); }
48
    public void changedUpdate(DocumentEvent e) { insertUpdate(e); }
49
}
49
}
(-)a/vmd.componentssupport/template/build.xml (-8 lines)
Removed Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
3
<!-- for some information on what you could do (e.g. targets to override). -->
4
<!-- If you delete this file and reopen the project it will be recreated. -->
5
<project name="_CODE_NAME_" default="netbeans" basedir=".">
6
    <description>Builds, tests, and runs the project _CODE_NAME_.</description>
7
    <import file="nbproject/build-impl.xml"/>
8
</project>
(-)a/vmd.componentssupport/template/manifest.mf (-4 lines)
Removed Link Here
1
Manifest-Version: 1.0
2
OpenIDE-Module: _CODE_NAME_
3
OpenIDE-Module-Localizing-Bundle: _BUNDLE_PATH_
4
OpenIDE-Module-Specification-Version: 1.0
(-)a/vmd.componentssupport/template/nbproject/build-impl.xml (-27 lines)
Removed Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!--
3
*** GENERATED FROM project.xml - DO NOT EDIT  ***
4
***         EDIT ../build.xml INSTEAD         ***
5
-->
6
<project name="_CODE_NAME_-impl" basedir="..">
7
    <property file="nbproject/private/platform-private.properties"/>
8
    <property file="nbproject/platform.properties"/>
9
    <macrodef name="property" uri="http://www.netbeans.org/ns/nb-module-project/2">
10
        <attribute name="name"/>
11
        <attribute name="value"/>
12
        <sequential>
13
            <property name="@{name}" value="${@{value}}"/>
14
        </sequential>
15
    </macrodef>
16
    <property file="${user.properties.file}"/>
17
    <nbmproject2:property name="harness.dir" value="nbplatform.${nbplatform.active}.harness.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
18
    <nbmproject2:property name="netbeans.dest.dir" value="nbplatform.${nbplatform.active}.netbeans.dest.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
19
    <fail message="You must define 'nbplatform.${nbplatform.active}.harness.dir'">
20
        <condition>
21
            <not>
22
                <available file="${harness.dir}" type="dir"/>
23
            </not>
24
        </condition>
25
    </fail>
26
    <import file="${harness.dir}/build.xml"/>
27
</project>
(-)a/vmd.componentssupport/template/nbproject/genfiles.properties (-8 lines)
Removed Link Here
1
build.xml.data.CRC32=e75f04e7
2
build.xml.script.CRC32=f8e43aec
3
build.xml.stylesheet.CRC32=79c3b980
4
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
5
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
6
nbproject/build-impl.xml.data.CRC32=e75f04e7
7
nbproject/build-impl.xml.script.CRC32=24ed9cd8
8
nbproject/build-impl.xml.stylesheet.CRC32=deb65f65
(-)a/vmd.componentssupport/template/nbproject/platform.properties (-1 lines)
Removed Link Here
1
nbplatform.active=default
(-)a/vmd.componentssupport/template/nbproject/project.properties (-2 lines)
Removed Link Here
1
javac.source=1.5
2
javac.compilerargs=-Xlint -Xlint:-serial
(-)a/vmd.componentssupport/template/nbproject/project.xml (-45 lines)
Removed Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<project xmlns="http://www.netbeans.org/ns/project/1">
3
    <type>org.netbeans.modules.apisupport.project</type>
4
    <configuration>
5
        <data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
6
            <code-name-base>TEMPLATE_NAME_TO_BE_REPLACED</code-name-base>
7
            <standalone/>
8
            <module-dependencies>
9
                <dependency>
10
                    <code-name-base>org.netbeans.modules.vmd.midp</code-name-base>
11
                    <build-prerequisite/>
12
                    <compile-dependency/>
13
                    <run-dependency>
14
                        <specification-version>1.1</specification-version>
15
                    </run-dependency>
16
                </dependency>
17
                <dependency>
18
                    <code-name-base>org.netbeans.modules.vmd.model</code-name-base>
19
                    <build-prerequisite/>
20
                    <compile-dependency/>
21
                    <run-dependency>
22
                        <specification-version>1.1</specification-version>
23
                    </run-dependency>
24
                </dependency>
25
                <dependency>
26
                    <code-name-base>org.netbeans.modules.vmd.properties</code-name-base>
27
                    <build-prerequisite/>
28
                    <compile-dependency/>
29
                    <run-dependency>
30
                        <specification-version>1.1</specification-version>
31
                    </run-dependency>
32
                </dependency>
33
                <dependency>
34
                    <code-name-base>org.openide.util</code-name-base>
35
                    <build-prerequisite/>
36
                    <compile-dependency/>
37
                    <run-dependency>
38
                        <specification-version>7.12</specification-version>
39
                    </run-dependency>
40
                </dependency>
41
            </module-dependencies>
42
            <public-packages/>
43
        </data>
44
    </configuration>
45
</project>
(-)a/vmd.componentssupport/template/src/Bundle.properties (-4 lines)
Removed Link Here
1
OpenIDE-Module-Long-Description=\
2
     Visual Mobile Designer Custom Component Project
3
OpenIDE-Module-Name=_PROJECT_NAME_
4
OpenIDE-Module-Short-Description=VMD Custom Component Project
(-)a/vmd.componentssupport/template/src/layer.xml (-4 lines)
Removed Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.1//EN" "http://www.netbeans.org/dtds/filesystem-1_1.dtd">
3
<filesystem>
4
</filesystem>
(-)e4be93651686 (+8 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
3
<!-- for some information on what you could do (e.g. targets to override). -->
4
<!-- If you delete this file and reopen the project it will be recreated. -->
5
<project name="_CODE_NAME_" default="netbeans" basedir=".">
6
    <description>Builds, tests, and runs the project _CODE_NAME_.</description>
7
    <import file="nbproject/build-impl.xml"/>
8
</project>
(-)e4be93651686 (+4 lines)
Added Link Here
1
Manifest-Version: 1.0
2
OpenIDE-Module: _CODE_NAME_
3
OpenIDE-Module-Localizing-Bundle: _BUNDLE_PATH_
4
OpenIDE-Module-Specification-Version: 1.0
(-)e4be93651686 (+2 lines)
Added Link Here
1
javac.source=1.5
2
javac.compilerargs=-Xlint -Xlint:-serial
(-)e4be93651686 (+44 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<project xmlns="http://www.netbeans.org/ns/project/1">
3
    <type>org.netbeans.modules.apisupport.project</type>
4
    <configuration>
5
        <data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
6
            <code-name-base>TEMPLATE_NAME_TO_BE_REPLACED</code-name-base>
7
            <module-dependencies>
8
                <dependency>
9
                    <code-name-base>org.netbeans.modules.vmd.midp</code-name-base>
10
                    <build-prerequisite/>
11
                    <compile-dependency/>
12
                    <run-dependency>
13
                        <specification-version>1.1</specification-version>
14
                    </run-dependency>
15
                </dependency>
16
                <dependency>
17
                    <code-name-base>org.netbeans.modules.vmd.model</code-name-base>
18
                    <build-prerequisite/>
19
                    <compile-dependency/>
20
                    <run-dependency>
21
                        <specification-version>1.1</specification-version>
22
                    </run-dependency>
23
                </dependency>
24
                <dependency>
25
                    <code-name-base>org.netbeans.modules.vmd.properties</code-name-base>
26
                    <build-prerequisite/>
27
                    <compile-dependency/>
28
                    <run-dependency>
29
                        <specification-version>1.1</specification-version>
30
                    </run-dependency>
31
                </dependency>
32
                <dependency>
33
                    <code-name-base>org.openide.util</code-name-base>
34
                    <build-prerequisite/>
35
                    <compile-dependency/>
36
                    <run-dependency>
37
                        <specification-version>7.12</specification-version>
38
                    </run-dependency>
39
                </dependency>
40
            </module-dependencies>
41
            <public-packages/>
42
        </data>
43
    </configuration>
44
</project>
(-)e4be93651686 (+4 lines)
Added Link Here
1
OpenIDE-Module-Long-Description=\
2
    Mobility Visual Designer Custom Component Project
3
OpenIDE-Module-Name=_PROJECT_NAME_
4
OpenIDE-Module-Short-Description=VMD Custom Component Project
(-)e4be93651686 (+4 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.1//EN" "http://www.netbeans.org/dtds/filesystem-1_1.dtd">
3
<filesystem>
4
</filesystem>
(-)e4be93651686 (+8 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
3
<!-- for some information on what you could do (e.g. targets to override). -->
4
<!-- If you delete this file and reopen the project it will be recreated. -->
5
<project name="_CODE_NAME_" default="netbeans" basedir=".">
6
    <description>Builds, tests, and runs the project _CODE_NAME_.</description>
7
    <import file="nbproject/build-impl.xml"/>
8
</project>
(-)e4be93651686 (+4 lines)
Added Link Here
1
Manifest-Version: 1.0
2
OpenIDE-Module: _CODE_NAME_
3
OpenIDE-Module-Localizing-Bundle: _BUNDLE_PATH_
4
OpenIDE-Module-Specification-Version: 1.0
(-)e4be93651686 (+27 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!--
3
*** GENERATED FROM project.xml - DO NOT EDIT  ***
4
***         EDIT ../build.xml INSTEAD         ***
5
-->
6
<project name="_CODE_NAME_-impl" basedir="..">
7
    <property file="nbproject/private/platform-private.properties"/>
8
    <property file="nbproject/platform.properties"/>
9
    <macrodef name="property" uri="http://www.netbeans.org/ns/nb-module-project/2">
10
        <attribute name="name"/>
11
        <attribute name="value"/>
12
        <sequential>
13
            <property name="@{name}" value="${@{value}}"/>
14
        </sequential>
15
    </macrodef>
16
    <property file="${user.properties.file}"/>
17
    <nbmproject2:property name="harness.dir" value="nbplatform.${nbplatform.active}.harness.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
18
    <nbmproject2:property name="netbeans.dest.dir" value="nbplatform.${nbplatform.active}.netbeans.dest.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
19
    <fail message="You must define 'nbplatform.${nbplatform.active}.harness.dir'">
20
        <condition>
21
            <not>
22
                <available file="${harness.dir}" type="dir"/>
23
            </not>
24
        </condition>
25
    </fail>
26
    <import file="${harness.dir}/build.xml"/>
27
</project>
(-)e4be93651686 (+8 lines)
Added Link Here
1
build.xml.data.CRC32=e75f04e7
2
build.xml.script.CRC32=f8e43aec
3
build.xml.stylesheet.CRC32=79c3b980
4
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
5
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
6
nbproject/build-impl.xml.data.CRC32=e75f04e7
7
nbproject/build-impl.xml.script.CRC32=24ed9cd8
8
nbproject/build-impl.xml.stylesheet.CRC32=deb65f65
(-)e4be93651686 (+1 lines)
Added Link Here
1
nbplatform.active=_PLATFORM_ID_
(-)e4be93651686 (+2 lines)
Added Link Here
1
javac.source=1.5
2
javac.compilerargs=-Xlint -Xlint:-serial
(-)e4be93651686 (+45 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<project xmlns="http://www.netbeans.org/ns/project/1">
3
    <type>org.netbeans.modules.apisupport.project</type>
4
    <configuration>
5
        <data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
6
            <code-name-base>TEMPLATE_NAME_TO_BE_REPLACED</code-name-base>
7
            <standalone/>
8
            <module-dependencies>
9
                <dependency>
10
                    <code-name-base>org.netbeans.modules.vmd.midp</code-name-base>
11
                    <build-prerequisite/>
12
                    <compile-dependency/>
13
                    <run-dependency>
14
                        <specification-version>1.1</specification-version>
15
                    </run-dependency>
16
                </dependency>
17
                <dependency>
18
                    <code-name-base>org.netbeans.modules.vmd.model</code-name-base>
19
                    <build-prerequisite/>
20
                    <compile-dependency/>
21
                    <run-dependency>
22
                        <specification-version>1.1</specification-version>
23
                    </run-dependency>
24
                </dependency>
25
                <dependency>
26
                    <code-name-base>org.netbeans.modules.vmd.properties</code-name-base>
27
                    <build-prerequisite/>
28
                    <compile-dependency/>
29
                    <run-dependency>
30
                        <specification-version>1.1</specification-version>
31
                    </run-dependency>
32
                </dependency>
33
                <dependency>
34
                    <code-name-base>org.openide.util</code-name-base>
35
                    <build-prerequisite/>
36
                    <compile-dependency/>
37
                    <run-dependency>
38
                        <specification-version>7.12</specification-version>
39
                    </run-dependency>
40
                </dependency>
41
            </module-dependencies>
42
            <public-packages/>
43
        </data>
44
    </configuration>
45
</project>
(-)e4be93651686 (+4 lines)
Added Link Here
1
OpenIDE-Module-Long-Description=\
2
    Mobility Visual Designer Custom Component Project
3
OpenIDE-Module-Name=_PROJECT_NAME_
4
OpenIDE-Module-Short-Description=VMD Custom Component Project
(-)e4be93651686 (+4 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.1//EN" "http://www.netbeans.org/dtds/filesystem-1_1.dtd">
3
<filesystem>
4
</filesystem>
(-)e4be93651686 (+8 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!-- You may freely edit this file. See harness/README in the NetBeans platform -->
3
<!-- for some information on what you could do (e.g. targets to override). -->
4
<!-- If you delete this file and reopen the project it will be recreated. -->
5
<project name="_CODE_NAME_" default="netbeans" basedir=".">
6
    <description>Builds, tests, and runs the project _CODE_NAME_.</description>
7
    <import file="nbproject/build-impl.xml"/>
8
</project>
(-)e4be93651686 (+4 lines)
Added Link Here
1
Manifest-Version: 1.0
2
OpenIDE-Module: _CODE_NAME_
3
OpenIDE-Module-Localizing-Bundle: _BUNDLE_PATH_
4
OpenIDE-Module-Specification-Version: 1.0
(-)e4be93651686 (+30 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!--
3
*** GENERATED FROM project.xml - DO NOT EDIT  ***
4
***         EDIT ../build.xml INSTEAD         ***
5
-->
6
<project name="www-impl" basedir="..">
7
    <property file="nbproject/private/suite-private.properties"/>
8
    <property file="nbproject/suite.properties"/>
9
    <fail unless="suite.dir">You must set 'suite.dir' to point to your containing module suite</fail>
10
    <property file="${suite.dir}/nbproject/private/platform-private.properties"/>
11
    <property file="${suite.dir}/nbproject/platform.properties"/>
12
    <macrodef name="property" uri="http://www.netbeans.org/ns/nb-module-project/2">
13
        <attribute name="name"/>
14
        <attribute name="value"/>
15
        <sequential>
16
            <property name="@{name}" value="${@{value}}"/>
17
        </sequential>
18
    </macrodef>
19
    <property file="${user.properties.file}"/>
20
    <nbmproject2:property name="harness.dir" value="nbplatform.${nbplatform.active}.harness.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
21
    <nbmproject2:property name="netbeans.dest.dir" value="nbplatform.${nbplatform.active}.netbeans.dest.dir" xmlns:nbmproject2="http://www.netbeans.org/ns/nb-module-project/2"/>
22
    <fail message="You must define 'nbplatform.${nbplatform.active}.harness.dir'">
23
        <condition>
24
            <not>
25
                <available file="${harness.dir}" type="dir"/>
26
            </not>
27
        </condition>
28
    </fail>
29
    <import file="${harness.dir}/build.xml"/>
30
</project>
(-)e4be93651686 (+8 lines)
Added Link Here
1
build.xml.data.CRC32=bc9461d8
2
build.xml.script.CRC32=203ac72c
3
build.xml.stylesheet.CRC32=79c3b980
4
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
5
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
6
nbproject/build-impl.xml.data.CRC32=bc9461d8
7
nbproject/build-impl.xml.script.CRC32=cf6b1fcb
8
nbproject/build-impl.xml.stylesheet.CRC32=deb65f65
(-)e4be93651686 (+2 lines)
Added Link Here
1
javac.source=1.5
2
javac.compilerargs=-Xlint -Xlint:-serial
(-)e4be93651686 (+45 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<project xmlns="http://www.netbeans.org/ns/project/1">
3
    <type>org.netbeans.modules.apisupport.project</type>
4
    <configuration>
5
        <data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
6
            <code-name-base>TEMPLATE_NAME_TO_BE_REPLACED</code-name-base>
7
            <suite-component/>
8
            <module-dependencies>
9
                <dependency>
10
                    <code-name-base>org.netbeans.modules.vmd.midp</code-name-base>
11
                    <build-prerequisite/>
12
                    <compile-dependency/>
13
                    <run-dependency>
14
                        <specification-version>1.1</specification-version>
15
                    </run-dependency>
16
                </dependency>
17
                <dependency>
18
                    <code-name-base>org.netbeans.modules.vmd.model</code-name-base>
19
                    <build-prerequisite/>
20
                    <compile-dependency/>
21
                    <run-dependency>
22
                        <specification-version>1.1</specification-version>
23
                    </run-dependency>
24
                </dependency>
25
                <dependency>
26
                    <code-name-base>org.netbeans.modules.vmd.properties</code-name-base>
27
                    <build-prerequisite/>
28
                    <compile-dependency/>
29
                    <run-dependency>
30
                        <specification-version>1.1</specification-version>
31
                    </run-dependency>
32
                </dependency>
33
                <dependency>
34
                    <code-name-base>org.openide.util</code-name-base>
35
                    <build-prerequisite/>
36
                    <compile-dependency/>
37
                    <run-dependency>
38
                        <specification-version>7.12</specification-version>
39
                    </run-dependency>
40
                </dependency>
41
            </module-dependencies>
42
            <public-packages/>
43
        </data>
44
    </configuration>
45
</project>
(-)e4be93651686 (+4 lines)
Added Link Here
1
OpenIDE-Module-Long-Description=\
2
    Mobility Visual Designer Custom Component Project
3
OpenIDE-Module-Name=_PROJECT_NAME_
4
OpenIDE-Module-Short-Description=VMD Custom Component Project
(-)e4be93651686 (+4 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.1//EN" "http://www.netbeans.org/dtds/filesystem-1_1.dtd">
3
<filesystem>
4
</filesystem>

Return to bug 144060