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 142283
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 (-1 / +45 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.vmd.componentssupport.ui.wizard.CustomComponentWizardIterator;
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 197-204 Link Here
197
            }
200
            }
198
    }
201
    }
199
202
200
    public static void copyByteAfterByte(File source, FileObject target) throws IOException {
203
    public static void copyByteAfterByte(File source, FileObject target) 
204
            throws IOException 
205
    {
201
            InputStream is = new FileInputStream(source);
206
            InputStream is = new FileInputStream(source);
207
            try {
208
                copyByteAfterByte(is, target);
209
            } finally {
210
                is.close();
211
            }
212
    }
213
214
    public static void copyByteAfterByte(String source, FileObject target) 
215
            throws IOException 
216
    {
217
        ByteArrayInputStream is = new ByteArrayInputStream(
218
                source.getBytes(UTF_8));
202
            try {
219
            try {
203
                copyByteAfterByte(is, target);
220
                copyByteAfterByte(is, target);
204
            } finally {
221
            } finally {
Lines 300-304 Link Here
300
        }
317
        }
301
    }
318
    }
302
    
319
    
320
    public static boolean isSuiteComponent(WizardDescriptor wizard){
321
        Object value = wizard.getProperty(
322
                CustomComponentWizardIterator.IS_SUITE_COMPONENT);
323
        return extractBoolean(value, false);
324
    }
325
    
326
    public static boolean isStandalone(WizardDescriptor wizard){
327
        Object value = wizard.getProperty(
328
                CustomComponentWizardIterator.IS_STANDALONE);
329
        return extractBoolean(value, false);
330
    }
331
    
332
    public static boolean isNetBeansOrg(WizardDescriptor wizard){
333
        Object value = wizard.getProperty(
334
                CustomComponentWizardIterator.IS_NETBEANS_ORG);
335
        return extractBoolean(value, false);
336
    }
337
    
338
    private static boolean extractBoolean(Object value, boolean defaultValue){
339
        if (value != null && value instanceof Boolean){
340
            return (Boolean)value;
341
        }
342
        return defaultValue;
343
    }
344
    
345
346
    
303
347
304
}
348
}
(-)8ba22ec90f60 (+315 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 = (String)wizard.getProperty(
179
                CustomComponentWizardIterator.SUITE_ROOT);
180
        File suiteDir = FileUtil.normalizeFile(new File(suiteDirPath));
181
        
182
        String suiteLocation;
183
        String suitePropertiesLocation;
184
        
185
        String rel = PropertyUtils.relativizeFile(projectDirF, suiteDir);
186
        if (rel != null) {
187
            suiteLocation = "${basedir}/" + rel; // NOI18N
188
            suitePropertiesLocation = SUITE_PROPERTIES;
189
        } else {
190
            suiteLocation = suiteDir.getAbsolutePath();
191
            suitePropertiesLocation = SUITE_PRIVATE_PROPERTIES;
192
        }
193
        EditableProperties props = new EditableProperties(true);
194
        props.setProperty(SUITE_PATH_PARAM, suiteLocation); 
195
        FileObject suiteProperties = FileUtil.createData(projectDir, suitePropertiesLocation);
196
        storeProperties(suiteProperties, props);
197
    }
198
199
    private static void filterBuild( FileObject fo, ZipInputStream zipIS,
200
            String codeBaseName ) throws IOException
201
    {
202
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
203
        FileUtil.copy( zipIS , baos);
204
        String content = baos.toString(UTF_8);
205
        
206
        content = content.replace( CODE_NAME_PARAM , codeBaseName );
207
        copyByteAfterByte(content, fo);
208
    }
209
210
    private static void filterBundle( FileObject projectRoot, ZipInputStream is,
211
            WizardDescriptor wizardDescriptor ) throws IOException
212
    {
213
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
214
        FileUtil.copy(is, baos);
215
        String content = baos.toString(UTF_8);
216
        
217
        content = content.replace( PROJECT_NAME_PARAM , 
218
                (String)wizardDescriptor.getProperty( 
219
                        CustomComponentWizardIterator.DISPLAY_NAME ) );
220
221
        FileObject fileObject = FileUtil.createData(projectRoot, 
222
                SRC + (String)wizardDescriptor.getProperty( 
223
                        CustomComponentWizardIterator.BUNDLE_PATH) );
224
        copyByteAfterByte(content, fileObject);
225
    }
226
227
    private static void copyLayer( FileObject projectRoot, ZipInputStream is,
228
            WizardDescriptor wizard ) throws IOException
229
    {
230
        String layer = (String)wizard.getProperty( 
231
                CustomComponentWizardIterator.LAYER_PATH);
232
        if ( layer == null || layer.length() ==0 ){
233
            return;
234
        }
235
        FileObject fileObject = FileUtil.createData(projectRoot, SRC + layer );
236
        copyByteAfterByte(is, fileObject );
237
    }
238
239
    private static void filterManifest( FileObject fo, ZipInputStream is,
240
            WizardDescriptor wizard ) throws IOException
241
    {
242
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
243
        FileUtil.copy(is, baos);
244
        String content = baos.toString(UTF_8);
245
        
246
        content = content.replace( CODE_NAME_PARAM , (String)wizard.getProperty( 
247
                CustomComponentWizardIterator.CODE_BASE_NAME ));
248
        content = content.replace( BUNDLE_PATH_PARAM, (String)wizard.getProperty( 
249
                CustomComponentWizardIterator.BUNDLE_PATH));
250
        StringBuilder builder = new StringBuilder( content );
251
        String layer = (String)wizard.getProperty( 
252
                CustomComponentWizardIterator.LAYER_PATH);
253
        if ( layer != null){
254
            builder.append( LAYER );
255
            builder.append( layer );
256
            builder.append( "\n" );
257
        }
258
259
        copyByteAfterByte(builder.toString(), fo);
260
    }
261
262
    private static void filterPlatformProperties( FileObject fo, ZipInputStream is,
263
            WizardDescriptor wizard ) throws IOException
264
    {
265
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
266
        FileUtil.copy(is, baos);
267
        String content = baos.toString(UTF_8);
268
        
269
        content = content.replace( PLATFORM_ID_PARAM , (String)wizard.getProperty( 
270
                CustomComponentWizardIterator.PLATFORM_ID ));
271
272
        copyByteAfterByte(content, fo);
273
    }
274
275
    private static void filterProjectXML( FileObject fo, ZipInputStream str,
276
            String name ) throws IOException
277
    {
278
        try {
279
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
280
            FileUtil.copy(str, baos);
281
            Document doc = XMLUtil.parse(new InputSource(
282
                    new ByteArrayInputStream(baos.toByteArray())), false,
283
                    false, null, null);
284
            NodeList nl = doc.getDocumentElement().getElementsByTagName(
285
                    CODE_NAME_BASE);
286
            if (nl != null) {
287
                for (int i = 0; i < nl.getLength(); i++) {
288
                    Element el = (Element) nl.item(i);
289
                    if (el.getParentNode() != null
290
                            && DATA.equals(el.getParentNode().getNodeName()))
291
                    {
292
                        NodeList nl2 = el.getChildNodes();
293
                        if (nl2.getLength() > 0) {
294
                            nl2.item(0).setNodeValue(name);
295
                        }
296
                        break;
297
                    }
298
                }
299
            }
300
            OutputStream out = fo.getOutputStream();
301
            try {
302
                XMLUtil.write(doc, out, UTF_8);
303
            }
304
            finally {
305
                out.close();
306
            }
307
        }
308
        catch (Exception ex) {
309
            Exceptions.printStackTrace(ex);
310
            copyByteAfterByte(str, fo);
311
        }
312
313
    }
314
    
315
}
(-)a/vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/ui/wizard/BasicModuleConfVisualPanel.java (-4 / +25 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
(-)a/vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/ui/wizard/Bundle.properties (+1 lines)
Lines 99-104 Link Here
99
BasicConfVisualPanel_err_bundle_def_pkg=Cannot use default package for bundle.
99
BasicConfVisualPanel_err_bundle_def_pkg=Cannot use default package for bundle.
100
BasicConfVisualPanel_err_layer_ext=Layer must have "{0}" extension.
100
BasicConfVisualPanel_err_layer_ext=Layer must have "{0}" extension.
101
BasicConfVisualPanel_err_bundle_ext=Bundle must have "{0}" extension.
101
BasicConfVisualPanel_err_bundle_ext=Bundle must have "{0}" extension.
102
BasicConfVisualPanel_err_wrong_nborg_name=For this code name base, module must be in a directory named "{0}".
102
103
103
# Main Wizard Step "Libraries Descriptors"
104
# Main Wizard Step "Libraries Descriptors"
104
LBL_AddedLibDescriptors=Chosen Libraries &Descriptors:
105
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 (-106 / +316 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.GridBagConstraints;
48
import java.awt.event.ActionEvent;
49
import java.awt.event.ActionListener;
50
import java.beans.PropertyChangeEvent;
51
import java.beans.PropertyChangeListener;
45
import java.io.File;
52
import java.io.File;
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.ModuleTypeChooserPanelExt;
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 76-111 Link Here
76
84
77
    public CustomComponentVisualPanel(CustomComponentWizardPanel panel) {
85
    public CustomComponentVisualPanel(CustomComponentWizardPanel panel) {
78
        initComponents();
86
        initComponents();
87
        initPanels();
79
        this.myPanel = panel;
88
        this.myPanel = panel;
89
        
80
        putClientProperty("NewProjectWizard_Title", NbBundle.getMessage(CustomComponentVisualPanel.class, "TXT_MobileDesigner"));
90
        putClientProperty("NewProjectWizard_Title", NbBundle.getMessage(CustomComponentVisualPanel.class, "TXT_MobileDesigner"));
81
        // Register listener on the textFields to make the automatic updates
91
        initDocumentListeners();
82
        projectNameTextField.getDocument().addDocumentListener(this);
92
        attachDocumentListeners();
83
        projectLocationTextField.getDocument().addDocumentListener(this);
84
93
85
        initAccessibility();;
94
        initAccessibility();
86
    }
95
    }
87
96
88
    @Override
97
    @Override 
89
    public void addNotify() {
98
    public void addNotify() {
90
        super.addNotify();
99
        super.addNotify();
100
        attachDocumentListeners();
91
        //same problem as in 31086, initial focus on Cancel button
101
        //same problem as in 31086, initial focus on Cancel button
92
        projectNameTextField.requestFocus();
102
        projectNameTextField.requestFocus();
93
    }
103
    }
94
104
95
    // Implementation of DocumentListener --------------------------------------
105
    @Override 
96
    public void changedUpdate(DocumentEvent e) {
106
    public void removeNotify() {
97
        updateTexts(e);
107
        // prevent checking when the panel is not "active"
98
        checkValidity();
108
        removeDocumentListeners();
109
        super.removeNotify();
99
    }
110
    }
100
101
    public void insertUpdate(DocumentEvent e) {
102
        changedUpdate(e);
103
    }
104
105
    public void removeUpdate(DocumentEvent e) {
106
        changedUpdate(e);
107
    }
108
    // -------------
109
111
110
    void store(WizardDescriptor d) {
112
    void store(WizardDescriptor d) {
111
        String name = projectNameTextField.getText().trim();
113
        String name = projectNameTextField.getText().trim();
Lines 115-130 Link Here
115
        d.putProperty(CustomComponentWizardIterator.PROJECT_DIR, new File(folder));
117
        d.putProperty(CustomComponentWizardIterator.PROJECT_DIR, new File(folder));
116
        d.putProperty(CustomComponentWizardIterator.PROJECT_NAME, name);
118
        d.putProperty(CustomComponentWizardIterator.PROJECT_NAME, name);
117
        d.putProperty(CustomComponentWizardIterator.SET_AS_MAIN, setAsMain);
119
        d.putProperty(CustomComponentWizardIterator.SET_AS_MAIN, setAsMain);
120
121
        typeChooserPanel.store(d);
118
    }
122
    }
119
123
120
    void read(WizardDescriptor settings) {
124
    void read(WizardDescriptor settings) {
121
        mySettings = settings;
125
        mySettings = settings;
122
126
127
        typeChooserPanel.read(mySettings);
128
        // invoke store to have changes in mySettings
129
        typeChooserPanel.store(mySettings);
130
123
        if (getIsMainProject() != null){
131
        if (getIsMainProject() != null){
124
            this.mainProject.setSelected(getIsMainProject());
132
            this.mainProject.setSelected(getIsMainProject());
125
        }
133
        }
126
        this.projectLocationTextField.setText(
134
        setLocation(getProjectLocation().getAbsolutePath());
127
                getProjectLocation().getAbsolutePath());
128
135
129
        this.projectNameTextField.setText(getProjectName());
136
        this.projectNameTextField.setText(getProjectName());
130
        this.projectNameTextField.selectAll();
137
        this.projectNameTextField.selectAll();
Lines 134-139 Link Here
134
        return new HelpCtx(CustomComponentVisualPanel.class);
141
        return new HelpCtx(CustomComponentVisualPanel.class);
135
    }
142
    }
136
    
143
    
144
    private void initDocumentListeners() {
145
        nameDL = new DocumentAdapter() {
146
            public void insertUpdate(DocumentEvent e) {
147
                updateTexts(e);
148
                checkValidity();
149
            }
150
        };
151
        locationDL = new DocumentAdapter() {
152
            public void insertUpdate(DocumentEvent e) {
153
                locationUpdated = true;
154
                updateTexts(e);
155
                checkValidity();
156
            }
157
        };
158
        isMainAL = new ActionListener() {
159
            public void actionPerformed(ActionEvent e) {
160
                mainProjectTouched = true;
161
            }
162
        };
163
    }
164
    
165
    private void attachDocumentListeners() {
166
        if (!listenersAttached) {
167
            projectNameTextField.getDocument().addDocumentListener(nameDL);
168
            projectLocationTextField.getDocument().addDocumentListener(locationDL);
169
            mainProject.addActionListener(isMainAL);
170
            listenersAttached = true;
171
        }
172
    }
173
    
174
    private void removeDocumentListeners() {
175
        if (listenersAttached) {
176
            projectNameTextField.getDocument().removeDocumentListener(nameDL);
177
            projectLocationTextField.getDocument().removeDocumentListener(locationDL);
178
            mainProject.removeActionListener(isMainAL);
179
            listenersAttached = false;
180
        }
181
    }
182
    
183
    private void initPanels(){
184
        if (typeChooserPanel != null){
185
            typeChooserPanelContainer.removeAll();
186
            typeChooserPanel = null;
187
        }
188
        typeChooserPanel = ModuleTypeChooserPanelExt.PanelCreator.create();
189
        Component component = typeChooserPanel.getComponent();
190
        typeChooserPanelContainer.add(component, BorderLayout.CENTER);
191
        typeChooserPanelContainer.validate();
192
        validate();
193
        
194
        typeChooserPanel.addPropertyChangeListener(new PropertyChangeListener() {
195
            public void propertyChange(PropertyChangeEvent evt) {
196
                String name = evt.getPropertyName();
197
                Object value = evt.getNewValue();
198
199
                typeChooserPanel.store(getSettings());
200
201
                if (ModuleTypeChooserPanelExt.IS_STANDALONE.equals(name)) {
202
                    standAloneModuletypeChanged(value);
203
                } else if (ModuleTypeChooserPanelExt.IS_SUITE_COMPONENT.equals(name)) {
204
                    suiteComponenttypeChanged(value);
205
                } else if (ModuleTypeChooserPanelExt.SUITE_ROOT.equals(name)) {
206
                    moduleSuiteValueChanged(value);
207
                }
208
                checkValidity();
209
            }
210
        });
211
    }
212
    
213
    private void moduleSuiteValueChanged(Object val) {
214
        String suite = null;
215
        if (val != null && val instanceof String){
216
            suite = (String)val;
217
        }
218
        if (!locationUpdated) {
219
            setLocation(computeLocationValue(suite));
220
        }
221
    }
222
223
    private void suiteComponenttypeChanged(Object val) {
224
        Boolean isSuiteComp = false;
225
        if (val != null && val instanceof Boolean){
226
            isSuiteComp = ((Boolean)val).booleanValue();
227
        }
228
        
229
        if (!mainProjectTouched) {
230
            mainProject.setSelected(!isSuiteComp);
231
        }
232
        if (!locationUpdated) {
233
            setLocation(computeInitialLocationValue());
234
        }
235
    }
236
237
    private void standAloneModuletypeChanged(Object val) {
238
        Boolean isStandAlone = false;
239
        if (val != null && val instanceof Boolean){
240
            isStandAlone = ((Boolean)val).booleanValue();
241
        }
242
        
243
        if (!mainProjectTouched) {
244
            mainProject.setSelected(isStandAlone);
245
        }
246
        if (!locationUpdated) {
247
            setLocation(computeInitialLocationValue());
248
        }
249
    }
250
251
    private void setLocation(String location) {
252
        boolean revert = !locationUpdated;
253
        projectLocationTextField.setText(location);
254
        locationUpdated = revert ^ true;
255
    }
256
    
257
    boolean checkValidity() {
258
        if (!isProjectNameValid()){
259
            return false;
260
        } else if (!isProjectLocationValid()){
261
            return false;
262
        } else if (!isCreatedFolderValid()){
263
            return false;
264
        } else if (!typeChooserPanel.validate(getSettings())){
265
            return false;
266
        }
267
268
        markValid();
269
        return true;
270
    }
271
137
    private boolean isProjectNameValid(){
272
    private boolean isProjectNameValid(){
138
        if (getProjectNameValue().trim().length() == 0) {
273
        if (getProjectNameValue().trim().length() == 0) {
139
            setError(getMessage(MSG_NAME_CANNOT_BE_EMPTY));
274
            setError(getMessage(MSG_NAME_CANNOT_BE_EMPTY));
Lines 187-207 Link Here
187
        return true;
322
        return true;
188
    }
323
    }
189
324
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(){
325
    private String getProjectNameValue(){
206
        return projectNameTextField.getText();
326
        return projectNameTextField.getText();
207
    }
327
    }
Lines 232-238 Link Here
232
    }
352
    }
233
353
234
    private final void setMessage(String message) {
354
    private final void setMessage(String message) {
235
        mySettings.putProperty(
355
        getSettings().putProperty(
236
                CustomComponentWizardIterator.WIZARD_PANEL_ERROR_MESSAGE,
356
                CustomComponentWizardIterator.WIZARD_PANEL_ERROR_MESSAGE,
237
                message);
357
                message);
238
    }
358
    }
Lines 252-271 Link Here
252
     * @return File Directory that will contain project folder
372
     * @return File Directory that will contain project folder
253
     */
373
     */
254
    File getProjectLocation(){
374
    File getProjectLocation(){
255
        File projectLocation = (File) mySettings
375
        File projectLocation = (File) getSettings()
256
                .getProperty(CustomComponentWizardIterator.PROJECT_DIR);
376
                .getProperty(CustomComponentWizardIterator.PROJECT_DIR);
257
        // project directory
377
        // project directory
258
        if (projectLocation == null
378
        if (projectLocation == null
259
                || projectLocation.getParentFile() == null
379
                || projectLocation.getParentFile() == null
260
                || !projectLocation.getParentFile().isDirectory())
380
                || !projectLocation.getParentFile().isDirectory())
261
        {
381
        {
262
            projectLocation = ProjectChooser.getProjectsFolder();
382
            projectLocation = new File(computeInitialLocationValue());
263
        } else {
383
        } else {
264
            projectLocation = projectLocation.getParentFile();
384
            projectLocation = projectLocation.getParentFile();
265
        }
385
        }
266
        return projectLocation;
386
        return projectLocation;
267
    }
387
    }
268
388
389
    private String computeInitialLocationValue(){
390
        if (typeChooserPanel != null && isSuiteComponent()) {
391
            return computeLocationValue(getSelectedSuite());
392
        } else {
393
            String path = ProjectChooser.getProjectsFolder().getAbsolutePath();
394
            return computeLocationValue(path);
395
        }
396
    }
397
    
398
    private String computeLocationValue(String value) {
399
        if (value == null) {
400
            value = System.getProperty("user.home"); // NOI18N
401
        }
402
        File file = new File(value);
403
        if (!file.exists() && file.getParent() != null) {
404
            return computeLocationValue(file.getParent());
405
        } else {
406
            return file.exists() ? value : System.getProperty("user.home"); // NOI18N
407
        }
408
    }
409
    
410
    private Boolean isSuiteComponent(){
411
        Boolean result = (Boolean)getSettings().getProperty(ModuleTypeChooserPanelExt.IS_SUITE_COMPONENT);
412
        return result != null ? result : false;
413
    }
414
    
415
    private String getSelectedSuite(){
416
        return (String)getSettings().getProperty(ModuleTypeChooserPanelExt.SUITE_ROOT);
417
    }
418
    
269
    /**
419
    /**
270
     * Returns project name value stored in WizardDescriptor, or
420
     * Returns project name value stored in WizardDescriptor, or
271
     * default value if it wasn't stored yet
421
     * 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.
424
     * name wich is not used as directory name in project location directory yet.
275
     */
425
     */
276
    String getProjectName(){
426
    String getProjectName(){
277
        String projectName = (String) mySettings
427
        String projectName = (String) getSettings()
278
                .getProperty(CustomComponentWizardIterator.PROJECT_NAME);
428
                .getProperty(CustomComponentWizardIterator.PROJECT_NAME);
279
        // project name
429
        // project name
280
        if (projectName == null) {
430
        if (projectName == null) {
Lines 284-290 Link Here
284
    }
434
    }
285
435
286
    Boolean getIsMainProject(){
436
    Boolean getIsMainProject(){
287
        Boolean isMain = (Boolean) mySettings
437
        Boolean isMain = (Boolean) getSettings()
288
                .getProperty(CustomComponentWizardIterator.SET_AS_MAIN);
438
                .getProperty(CustomComponentWizardIterator.SET_AS_MAIN);
289
        return isMain;
439
        return isMain;
290
    }
440
    }
Lines 304-324 Link Here
304
     */
454
     */
305
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
455
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
306
    private void initComponents() {
456
    private void initComponents() {
457
        java.awt.GridBagConstraints gridBagConstraints;
307
458
459
        mainProject = new javax.swing.JCheckBox();
460
        infoPanel = new javax.swing.JPanel();
308
        projectNameLabel = new javax.swing.JLabel();
461
        projectNameLabel = new javax.swing.JLabel();
309
        projectNameTextField = new javax.swing.JTextField();
462
        projectNameTextField = new javax.swing.JTextField();
463
        createdFolderTextField = new javax.swing.JTextField();
310
        projectLocationLabel = new javax.swing.JLabel();
464
        projectLocationLabel = new javax.swing.JLabel();
465
        createdFolderLabel = new javax.swing.JLabel();
311
        projectLocationTextField = new javax.swing.JTextField();
466
        projectLocationTextField = new javax.swing.JTextField();
312
        browseButton = new javax.swing.JButton();
467
        browseButton = new javax.swing.JButton();
313
        createdFolderLabel = new javax.swing.JLabel();
468
        typeChooserPanelContainer = new javax.swing.JPanel();
314
        createdFolderTextField = new javax.swing.JTextField();
469
        fillerPanel = new javax.swing.JPanel();
315
        mainProject = new javax.swing.JCheckBox();
470
471
        setLayout(new java.awt.GridBagLayout());
472
473
        mainProject.setSelected(true);
474
        org.openide.awt.Mnemonics.setLocalizedText(mainProject, org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "LBL_SetAsMainProject")); // NOI18N
475
        gridBagConstraints = new java.awt.GridBagConstraints();
476
        gridBagConstraints.gridx = 0;
477
        gridBagConstraints.gridy = 2;
478
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
479
        gridBagConstraints.insets = new java.awt.Insets(12, 0, 0, 0);
480
        add(mainProject, gridBagConstraints);
481
        mainProject.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "ACSN_SetAsMainProject")); // NOI18N
482
        mainProject.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "ACSD_SetAsMainProject")); // NOI18N
483
484
        infoPanel.setLayout(new java.awt.GridBagLayout());
316
485
317
        projectNameLabel.setLabelFor(projectNameTextField);
486
        projectNameLabel.setLabelFor(projectNameTextField);
318
        org.openide.awt.Mnemonics.setLocalizedText(projectNameLabel, org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "LBL_ProjectName")); // NOI18N
487
        org.openide.awt.Mnemonics.setLocalizedText(projectNameLabel, org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "LBL_ProjectName")); // NOI18N
488
        gridBagConstraints = new java.awt.GridBagConstraints();
489
        gridBagConstraints.gridx = 0;
490
        gridBagConstraints.gridy = 0;
491
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
492
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 12);
493
        infoPanel.add(projectNameLabel, gridBagConstraints);
494
        projectNameLabel.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "ACSN_ProjectName")); // NOI18N
495
        projectNameLabel.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "ACSD_ProjectName")); // NOI18N
496
497
        gridBagConstraints = new java.awt.GridBagConstraints();
498
        gridBagConstraints.gridx = 1;
499
        gridBagConstraints.gridy = 0;
500
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
501
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
502
        gridBagConstraints.weightx = 1.0;
503
        infoPanel.add(projectNameTextField, gridBagConstraints);
504
505
        createdFolderTextField.setEditable(false);
506
        gridBagConstraints = new java.awt.GridBagConstraints();
507
        gridBagConstraints.gridx = 1;
508
        gridBagConstraints.gridy = 2;
509
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
510
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
511
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 6, 0);
512
        infoPanel.add(createdFolderTextField, gridBagConstraints);
319
513
320
        projectLocationLabel.setLabelFor(projectLocationTextField);
514
        projectLocationLabel.setLabelFor(projectLocationTextField);
321
        org.openide.awt.Mnemonics.setLocalizedText(projectLocationLabel, org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "LBL_ProjectLocation")); // NOI18N
515
        org.openide.awt.Mnemonics.setLocalizedText(projectLocationLabel, org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "LBL_ProjectLocation")); // NOI18N
516
        gridBagConstraints = new java.awt.GridBagConstraints();
517
        gridBagConstraints.gridx = 0;
518
        gridBagConstraints.gridy = 1;
519
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
520
        gridBagConstraints.insets = new java.awt.Insets(6, 0, 6, 12);
521
        infoPanel.add(projectLocationLabel, gridBagConstraints);
522
        projectLocationLabel.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "ACSN_ProjectLocation")); // NOI18N
523
        projectLocationLabel.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "ACSD_ProjectLocation")); // NOI18N
524
525
        createdFolderLabel.setLabelFor(createdFolderTextField);
526
        org.openide.awt.Mnemonics.setLocalizedText(createdFolderLabel, org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "LBL_ProjectFolder")); // NOI18N
527
        gridBagConstraints = new java.awt.GridBagConstraints();
528
        gridBagConstraints.gridx = 0;
529
        gridBagConstraints.gridy = 2;
530
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
531
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 6, 12);
532
        infoPanel.add(createdFolderLabel, gridBagConstraints);
533
        createdFolderLabel.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "ACSN_ProjectFolder")); // NOI18N
534
        createdFolderLabel.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "ACSD_ProjectFolder")); // NOI18N
535
536
        gridBagConstraints = new java.awt.GridBagConstraints();
537
        gridBagConstraints.gridx = 1;
538
        gridBagConstraints.gridy = 1;
539
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
540
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
541
        gridBagConstraints.insets = new java.awt.Insets(6, 0, 6, 0);
542
        infoPanel.add(projectLocationTextField, gridBagConstraints);
322
543
323
        org.openide.awt.Mnemonics.setLocalizedText(browseButton, org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "LBL_Browse_Button")); // NOI18N
544
        org.openide.awt.Mnemonics.setLocalizedText(browseButton, org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "LBL_Browse_Button")); // NOI18N
324
        browseButton.setActionCommand(BROWSE);
545
        browseButton.setActionCommand(BROWSE);
Lines 327-392 Link Here
327
                browseButtonActionPerformed(evt);
548
                browseButtonActionPerformed(evt);
328
            }
549
            }
329
        });
550
        });
330
551
        gridBagConstraints = new java.awt.GridBagConstraints();
331
        createdFolderLabel.setLabelFor(createdFolderTextField);
552
        gridBagConstraints.gridx = 2;
332
        org.openide.awt.Mnemonics.setLocalizedText(createdFolderLabel, org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "LBL_ProjectFolder")); // NOI18N
553
        gridBagConstraints.gridy = 1;
333
554
        gridBagConstraints.insets = new java.awt.Insets(6, 12, 6, 0);
334
        createdFolderTextField.setEditable(false);
555
        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
556
        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
557
        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
558
387
        createdFolderLabel.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "ACSD_ProjectFolder")); // NOI18N
559
        gridBagConstraints = new java.awt.GridBagConstraints();
388
        mainProject.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "ACSN_SetAsMainProject")); // NOI18N
560
        gridBagConstraints.gridx = 0;
389
        mainProject.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "ACSD_SetAsMainProject")); // NOI18N
561
        gridBagConstraints.gridy = 0;
562
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
563
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
564
        add(infoPanel, gridBagConstraints);
565
566
        typeChooserPanelContainer.setLayout(new java.awt.BorderLayout());
567
        gridBagConstraints = new java.awt.GridBagConstraints();
568
        gridBagConstraints.gridx = 0;
569
        gridBagConstraints.gridy = 1;
570
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
571
        add(typeChooserPanelContainer, gridBagConstraints);
572
        gridBagConstraints = new java.awt.GridBagConstraints();
573
        gridBagConstraints.gridx = 0;
574
        gridBagConstraints.gridy = 3;
575
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
576
        gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
577
        gridBagConstraints.weightx = 1.0;
578
        gridBagConstraints.weighty = 1.0;
579
        add(fillerPanel, gridBagConstraints);
390
    }// </editor-fold>//GEN-END:initComponents
580
    }// </editor-fold>//GEN-END:initComponents
391
581
392
    private void browseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseButtonActionPerformed
582
    private void browseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseButtonActionPerformed
Lines 405-412 Link Here
405
            }
595
            }
406
            if (JFileChooser.APPROVE_OPTION == chooser.showOpenDialog(this)) {
596
            if (JFileChooser.APPROVE_OPTION == chooser.showOpenDialog(this)) {
407
                File projectDir = chooser.getSelectedFile();//GEN-LAST:event_browseButtonActionPerformed
597
                File projectDir = chooser.getSelectedFile();//GEN-LAST:event_browseButtonActionPerformed
408
                projectLocationTextField.setText(
598
                String projectDirPath = FileUtil.normalizeFile(projectDir).getAbsolutePath();
409
                        FileUtil.normalizeFile(projectDir).getAbsolutePath());
599
                projectLocationTextField.setText(computeLocationValue(projectDirPath));
410
            }
600
            }
411
            //myPanel.fireChangeEvent();
601
            //myPanel.fireChangeEvent();
412
        }
602
        }
Lines 424-434 Link Here
424
    private javax.swing.JButton browseButton;
614
    private javax.swing.JButton browseButton;
425
    private javax.swing.JLabel createdFolderLabel;
615
    private javax.swing.JLabel createdFolderLabel;
426
    private javax.swing.JTextField createdFolderTextField;
616
    private javax.swing.JTextField createdFolderTextField;
617
    private javax.swing.JPanel fillerPanel;
618
    private javax.swing.JPanel infoPanel;
427
    private javax.swing.JCheckBox mainProject;
619
    private javax.swing.JCheckBox mainProject;
428
    private javax.swing.JLabel projectLocationLabel;
620
    private javax.swing.JLabel projectLocationLabel;
429
    private javax.swing.JTextField projectLocationTextField;
621
    private javax.swing.JTextField projectLocationTextField;
430
    private javax.swing.JLabel projectNameLabel;
622
    private javax.swing.JLabel projectNameLabel;
431
    private javax.swing.JTextField projectNameTextField;
623
    private javax.swing.JTextField projectNameTextField;
624
    private javax.swing.JPanel typeChooserPanelContainer;
432
    // End of variables declaration//GEN-END:variables
625
    // End of variables declaration//GEN-END:variables
433
626
434
    // TODO: use FileUtil.findFreeFolderName here
627
    // TODO: use FileUtil.findFreeFolderName here
Lines 464-478 Link Here
464
            String projectName = projectNameTextField.getText();
657
            String projectName = projectNameTextField.getText();
465
            String projectFolder = projectLocationTextField.getText();
658
            String projectFolder = projectLocationTextField.getText();
466
659
467
            //if (projectFolder.trim().length() == 0 || projectFolder.equals(oldName)) {
468
            createdFolderTextField.setText(projectFolder + File.separatorChar + projectName);
660
            createdFolderTextField.setText(projectFolder + File.separatorChar + projectName);
469
        //}
661
            projectFolderChanged(getCreatedFolderValue());
662
            typeChooserPanel.updateUI(getSettings());
470
663
471
        }
664
        }
472
        //myPanel.fireChangeEvent(); // Notify that the myPanel changed
665
        //myPanel.fireChangeEvent(); // Notify that the myPanel changed
473
666
474
    }
667
    }
668
    
669
    private void projectFolderChanged(String projectFolder){
670
        File folder = FileUtil.normalizeFile(new File(projectFolder));
671
        getSettings().putProperty(ModuleTypeChooserPanelExt.PROJECT_FOLDER, folder);
672
    }
673
674
    private WizardDescriptor getSettings(){
675
        return mySettings;
676
    }
475
677
476
    private WizardDescriptor mySettings;
678
    private WizardDescriptor mySettings;
477
    private CustomComponentWizardPanel myPanel;
679
    private CustomComponentWizardPanel myPanel;
680
    private ModuleTypeChooserPanelExt typeChooserPanel;
681
    private boolean locationUpdated;
682
    private boolean mainProjectTouched;
683
684
    private boolean listenersAttached;
685
    private DocumentListener nameDL;
686
    private DocumentListener locationDL;
687
    private ActionListener isMainAL;
478
}
688
}
(-)a/vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/ui/wizard/CustomComponentWizardIterator.java (-220 / +38 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.ModuleTypeChooserPanelExt;
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;
68
import org.netbeans.spi.project.ui.templates.support.Templates;
73
import org.openide.WizardDescriptor;
69
import org.openide.WizardDescriptor;
74
import org.openide.filesystems.FileObject;
70
import org.openide.filesystems.FileObject;
75
import org.openide.filesystems.FileUtil;
71
import org.openide.filesystems.FileUtil;
76
import org.openide.util.Exceptions;
77
import org.openide.util.NbBundle;
72
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
73
84
public class CustomComponentWizardIterator implements
74
public class CustomComponentWizardIterator implements
85
        WizardDescriptor./* Progress */InstantiatingIterator
75
        WizardDescriptor./* Progress */InstantiatingIterator
86
{
76
{
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
77
99
    // wizard properties
78
    // wizard properties
100
    public static final String WIZARD_PANEL_ERROR_MESSAGE 
79
    public static final String WIZARD_PANEL_ERROR_MESSAGE 
Lines 105-110 Link Here
105
    public static final String SELECTED_INDEX 
84
    public static final String SELECTED_INDEX 
106
                                            = WizardDescriptor.PROP_CONTENT_SELECTED_INDEX;// NOI18N
85
                                            = WizardDescriptor.PROP_CONTENT_SELECTED_INDEX;// NOI18N
107
86
87
    public static final String BUNDLE_PROPERTIES
88
                                            = BaseHelper.BUNDLE_PROPERTIES;
89
    public static final String LAYER_XML    = BaseHelper.LAYER_XML;
108
    // steps
90
    // steps
109
    public static final String STEP_BASIC_PARAMS 
91
    public static final String STEP_BASIC_PARAMS 
110
                                            = "LBL_BasicProjectParamsStep";      // NOI18N
92
                                            = "LBL_BasicProjectParamsStep";      // NOI18N
Lines 123-128 Link Here
123
    public static final String CODE_BASE_NAME
105
    public static final String CODE_BASE_NAME
124
                                            = "codeBaseName";                    // NOI18N
106
                                            = "codeBaseName";                    // NOI18N
125
    public static final String DISPLAY_NAME = "displayName";                     // NOI18N
107
    public static final String DISPLAY_NAME = "displayName";                     // NOI18N
108
    public static final String IS_NETBEANS_ORG 
109
                                = ModuleTypeChooserPanelExt.IS_NETBEANS_ORG;
110
    public static final String IS_STANDALONE 
111
                                = ModuleTypeChooserPanelExt.IS_STANDALONE;
112
    public static final String IS_SUITE_COMPONENT 
113
                                = ModuleTypeChooserPanelExt.IS_SUITE_COMPONENT;
114
    public static final String SUITE_ROOT 
115
                                = ModuleTypeChooserPanelExt.SUITE_ROOT;
116
    public static final String PLATFORM_ID 
117
                                = ModuleTypeChooserPanelExt.ACTIVE_PLATFORM;
118
    
126
    // added library descriptors
119
    // added library descriptors
127
    public static final String LIBRARIES    = "libraries";                       // NOI18N
120
    public static final String LIBRARIES    = "libraries";                       // NOI18N
128
    public static final String LIB_DISPLAY_NAMES
121
    public static final String LIB_DISPLAY_NAMES
Lines 131-154 Link Here
131
    // added Custom components
124
    // added Custom components
132
    public static final String CUSTOM_COMPONENTS  
125
    public static final String CUSTOM_COMPONENTS  
133
                                            = "customComponents";                // NOI18N
126
                                            = "customComponents";                // NOI18N
134
127
    
135
    // parameters for project
128
    private static final String TEMPLATE_PROJECT_NETBEANSORG 
136
    private static final String CODE_NAME_PARAM 
129
                                = "CustomComponentProject_netbeansorg.zip";     //NOI18N
137
                                            = "_CODE_NAME_";                     // NOI18N
130
    private static final String TEMPLATE_PROJECT_STANDALONE 
138
    private static final String BUNDLE_PATH_PARAM 
131
                                = "CustomComponentProject_standalone.zip";      //NOI18N
139
                                            = "_BUNDLE_PATH_";                   // NOI18N
132
    private static final String TEMPLATE_PROJECT_SUITECOMPONENT 
140
    private static final String PROJECT_NAME_PARAM 
133
                                = "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
134
153
    private CustomComponentWizardIterator() {
135
    private CustomComponentWizardIterator() {
154
    }
136
    }
Lines 188-196 Link Here
188
                .getProperty(PROJECT_DIR));
170
                .getProperty(PROJECT_DIR));
189
        dirF.mkdirs();
171
        dirF.mkdirs();
190
172
191
        FileObject template = Templates.getTemplate(myWizard);
173
        FileObject template = getProjectTemplate(myWizard);
192
        FileObject dir = FileUtil.toFileObject(dirF);
174
        FileObject dir = FileUtil.toFileObject(dirF);
193
        unZipFile(template.getInputStream(), dir , myWizard );
175
        
176
        ProjectTemplateZipHelper.
177
                unZipFile(template.getInputStream(), dir , myWizard );
194
178
195
        
179
        
196
        // Always open top dir as a project:
180
        // Always open top dir as a project:
Lines 218-223 Link Here
218
        // store custom component descriptors
202
        // store custom component descriptors
219
        configureComponents(createdProject, myWizard);
203
        configureComponents(createdProject, myWizard);
220
        return resultSet;
204
        return resultSet;
205
    }
206
    
207
    private FileObject getProjectTemplate(WizardDescriptor wizard){
208
        if (BaseHelper.isNetBeansOrg(wizard)){
209
            return BaseHelper.getTemplate(TEMPLATE_PROJECT_NETBEANSORG);
210
        } else if (BaseHelper.isSuiteComponent(wizard)){
211
            return BaseHelper.getTemplate(TEMPLATE_PROJECT_SUITECOMPONENT);
212
        } else if (BaseHelper.isStandalone(wizard)){
213
            return BaseHelper.getTemplate(TEMPLATE_PROJECT_STANDALONE);
214
        }
215
        throw new IllegalArgumentException("unsupported wizard type");
221
    }
216
    }
222
217
223
    public void initialize( WizardDescriptor wiz ) {
218
    public void initialize( WizardDescriptor wiz ) {
Lines 316-498 Link Here
316
            return Collections.EMPTY_SET;
311
            return Collections.EMPTY_SET;
317
    }
312
    }
318
    
313
    
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
    
314
    
497
    private int index;
315
    private int index;
498
    private WizardDescriptor.Panel[] panels;
316
    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
    Mobility Visual 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>
(-)8ba22ec90f60 (+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>
(-)8ba22ec90f60 (+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
(-)8ba22ec90f60 (+2 lines)
Added Link Here
1
javac.source=1.5
2
javac.compilerargs=-Xlint -Xlint:-serial
(-)8ba22ec90f60 (+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>
(-)8ba22ec90f60 (+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
(-)8ba22ec90f60 (+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>
(-)8ba22ec90f60 (+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>
(-)8ba22ec90f60 (+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
(-)8ba22ec90f60 (+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>
(-)8ba22ec90f60 (+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
(-)8ba22ec90f60 (+1 lines)
Added Link Here
1
nbplatform.active=_PLATFORM_ID_
(-)8ba22ec90f60 (+2 lines)
Added Link Here
1
javac.source=1.5
2
javac.compilerargs=-Xlint -Xlint:-serial
(-)8ba22ec90f60 (+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>
(-)8ba22ec90f60 (+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
(-)8ba22ec90f60 (+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>
(-)8ba22ec90f60 (+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>
(-)8ba22ec90f60 (+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
(-)8ba22ec90f60 (+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>
(-)8ba22ec90f60 (+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
(-)8ba22ec90f60 (+2 lines)
Added Link Here
1
javac.source=1.5
2
javac.compilerargs=-Xlint -Xlint:-serial
(-)8ba22ec90f60 (+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>
(-)8ba22ec90f60 (+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
(-)8ba22ec90f60 (+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 142283