# HG changeset patch # User akorostelev@netbeans.org # Date 1219951836 -14400 # Node ID 7de4d4fa1f4be33d6e8f2c35575ac6c48b0149aa # Parent e4be93651686cabb2d2a89e76ee0bb23cad03041 fix for 136248. To use API exposed by fix of 142283 diff -r e4be93651686 -r 7de4d4fa1f4b vmd.componentssupport/build.xml --- a/vmd.componentssupport/build.xml Thu Aug 28 23:26:11 2008 +0400 +++ b/vmd.componentssupport/build.xml Thu Aug 28 23:30:36 2008 +0400 @@ -10,9 +10,17 @@ - + + diff -r e4be93651686 -r 7de4d4fa1f4b vmd.componentssupport/nbproject/project.xml --- a/vmd.componentssupport/nbproject/project.xml Thu Aug 28 23:26:11 2008 +0400 +++ b/vmd.componentssupport/nbproject/project.xml Thu Aug 28 23:30:36 2008 +0400 @@ -21,6 +21,14 @@ 1 1.8 + + + + org.netbeans.modules.apisupport.project + + + + 1.22 diff -r e4be93651686 -r 7de4d4fa1f4b vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/Bundle.properties --- a/vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/Bundle.properties Thu Aug 28 23:26:11 2008 +0400 +++ b/vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/Bundle.properties Thu Aug 28 23:30:36 2008 +0400 @@ -42,7 +42,7 @@ OpenIDE-Module-Short-Description=Visual Mobile Designer - components creation #System file system -Templates/Project/J2ME/CustomComponentProject.zip=Mobile Designer Components +Templates/Project/J2ME/CustomComponentProject=Mobile Designer Components Templates/J2MEComponents=Mobile Designer Templates/J2MEComponents/CustomComponent=Mobile Designer Component diff -r e4be93651686 -r 7de4d4fa1f4b vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/layer.xml --- a/vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/layer.xml Thu Aug 28 23:26:11 2008 +0400 +++ b/vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/layer.xml Thu Aug 28 23:30:36 2008 +0400 @@ -9,7 +9,7 @@ - + @@ -39,6 +39,9 @@ + + + diff -r e4be93651686 -r 7de4d4fa1f4b vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/ui/helpers/BaseHelper.java --- a/vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/ui/helpers/BaseHelper.java Thu Aug 28 23:26:11 2008 +0400 +++ b/vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/ui/helpers/BaseHelper.java Thu Aug 28 23:30:36 2008 +0400 @@ -39,6 +39,7 @@ package org.netbeans.modules.vmd.componentssupport.ui.helpers; +import java.io.ByteArrayInputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; @@ -60,7 +61,9 @@ import javax.script.ScriptException; import javax.swing.text.PlainDocument; import org.netbeans.api.queries.FileEncodingQuery; +import org.netbeans.modules.apisupport.project.ui.wizard.spi.ModuleTypePanel; import org.netbeans.spi.project.support.ant.EditableProperties; +import org.openide.WizardDescriptor; import org.openide.filesystems.FileLock; import org.openide.filesystems.FileObject; import org.openide.filesystems.FileUtil; @@ -107,7 +110,8 @@ public static String getDefaultCodeNameBase(String projectName){ //return normalizeCNB(EXAMPLE_BASE_NAME + projectName); - return EXAMPLE_BASE_NAME + normalizeCNB(projectName); + //return EXAMPLE_BASE_NAME + normalizeCNB(projectName); + return "";//NOI18N } /** @@ -197,8 +201,22 @@ } } - public static void copyByteAfterByte(File source, FileObject target) throws IOException { + public static void copyByteAfterByte(File source, FileObject target) + throws IOException + { InputStream is = new FileInputStream(source); + try { + copyByteAfterByte(is, target); + } finally { + is.close(); + } + } + + public static void copyByteAfterByte(String source, FileObject target) + throws IOException + { + ByteArrayInputStream is = new ByteArrayInputStream( + source.getBytes(UTF_8)); try { copyByteAfterByte(is, target); } finally { @@ -300,5 +318,24 @@ } } + public static boolean isSuiteComponent(WizardDescriptor wizard){ + return ModuleTypePanel.isSuiteComponent(wizard); + } + + public static boolean isStandalone(WizardDescriptor wizard){ + return ModuleTypePanel.isStandalone(wizard); + } + + public static boolean isNetBeansOrg(WizardDescriptor wizard){ + return ModuleTypePanel.isNetBeansOrg(wizard); + } + + public static String getSuiteRoot(WizardDescriptor wizard){ + return ModuleTypePanel.getSuiteRoot(wizard); + } + + public static String getActivePlatform(WizardDescriptor wizard){ + return ModuleTypePanel.getActivePlatformId(wizard); + } } diff -r e4be93651686 -r 7de4d4fa1f4b vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/ui/helpers/ProjectTemplateZipHelper.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/ui/helpers/ProjectTemplateZipHelper.java Thu Aug 28 23:30:36 2008 +0400 @@ -0,0 +1,313 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + * + * Contributor(s): + * + * Portions Copyrighted 2008 Sun Microsystems, Inc. + */ + +package org.netbeans.modules.vmd.componentssupport.ui.helpers; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream; +import org.netbeans.modules.vmd.componentssupport.ui.wizard.CustomComponentWizardIterator; +import org.netbeans.spi.project.support.ant.EditableProperties; +import org.netbeans.spi.project.support.ant.PropertyUtils; +import org.openide.WizardDescriptor; +import org.openide.filesystems.FileObject; +import org.openide.filesystems.FileUtil; +import org.openide.util.Exceptions; +import org.openide.xml.XMLUtil; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; +import org.xml.sax.InputSource; + +/** + * + * @author akorostelev + */ +public class ProjectTemplateZipHelper extends BaseHelper { + + private static final String PROJECT_XML = "nbproject/project.xml"; // NOI18N + private static final String BUILD_IMPL_XML + = "nbproject/build-impl.xml"; // NOI18N + private static final String BUILD_XML = "build.xml"; // NOI18N + private static final String PLATFORM_PROPERTIES + = "nbproject/platform.properties"; // NOI18N + private static final String SUITE_PROPERTIES + = "nbproject/suite.properties"; // NOI18N + private static final String SUITE_PRIVATE_PROPERTIES + = "nbproject/private/suite-private.properties"; // NOI18N + + // unzipped project filtering + private static final String CODE_NAME_BASE + = "code-name-base"; // NOI18N + private static final String DATA = "data"; // NOI18N + + // parameters for project + private static final String CODE_NAME_PARAM + = "_CODE_NAME_"; // NOI18N + private static final String BUNDLE_PATH_PARAM + = "_BUNDLE_PATH_"; // NOI18N + private static final String PROJECT_NAME_PARAM + = "_PROJECT_NAME_"; // NOI18N + private static final String PLATFORM_ID_PARAM + = "_PLATFORM_ID_"; // NOI18N + private static final String SUITE_PATH_PARAM + = "suite.dir"; // NOI18N + + // names of templates + private static final String BUNDLE_NAME = SRC + BUNDLE_PROPERTIES; // NOI18N + private static final String LAYER_NAME = SRC + LAYER_XML; // NOI18N + private static final String MANIFEST = "manifest.mf"; // NOI18N + private static final String LAYER = "OpenIDE-Module-Layer: "; // NOI18N + + public static void unZipFile( InputStream source, FileObject projectRoot , + WizardDescriptor wizard ) + throws IOException + { + try { + ZipInputStream zipIS = new ZipInputStream(source); + ZipEntry entry; + while ((entry = zipIS.getNextEntry()) != null) { + if (entry.isDirectory()) { + FileUtil.createFolder(projectRoot, entry.getName()); + } + else { + FileObject fo = null; + if (PROJECT_XML.equals(entry.getName())) { + // Special handling for setting name of Ant-based + // projects; customize as needed: + fo = FileUtil.createData(projectRoot, entry + .getName()); + filterProjectXML(fo, zipIS, (String)wizard.getProperty( + CustomComponentWizardIterator.CODE_BASE_NAME )); + } + else if ( MANIFEST.equals(entry.getName())){ + fo = FileUtil.createData(projectRoot, entry + .getName()); + filterManifest( fo , zipIS, wizard ); + } + else if ( PLATFORM_PROPERTIES.equals(entry.getName())){ + fo = FileUtil.createData(projectRoot, entry + .getName()); + filterPlatformProperties( fo , zipIS, wizard ); + } + else if ( LAYER_NAME.equals(entry.getName())){ + copyLayer( projectRoot , zipIS , wizard ); + } + else if ( BUNDLE_NAME.equals(entry.getName()) ) { + filterBundle( projectRoot , zipIS, wizard ); + } + else if ( BUILD_XML.equals(entry.getName()) + || BUILD_IMPL_XML.equals(entry.getName())) + { + fo = FileUtil.createData(projectRoot, entry + .getName()); + filterBuild( fo , zipIS, (String)wizard.getProperty( + CustomComponentWizardIterator.CODE_BASE_NAME ) ); + } + else { + fo = FileUtil.createData(projectRoot, entry + .getName()); + copyByteAfterByte(zipIS, fo); + } + } + } + } + finally { + source.close(); + } + createSuiteProperties(projectRoot, wizard); + } + + /** + * Detects whether projectDir is relative to + * suiteDir and creates nbproject/suite.properties or + * nbproject/private/suite-private.properties with + * suite.dir appropriately set. + */ + // copied from org.netbeans.modules.apisupport.project.NbModuleProjectGenerator + private static void createSuiteProperties(FileObject projectDir, + WizardDescriptor wizard) + throws IOException + { + if (!isSuiteComponent(wizard)){ + return; + } + + File projectDirF = FileUtil.toFile(projectDir); + String suiteDirPath = getSuiteRoot(wizard); + File suiteDir = FileUtil.normalizeFile(new File(suiteDirPath)); + + String suiteLocation; + String suitePropertiesLocation; + + String rel = PropertyUtils.relativizeFile(projectDirF, suiteDir); + if (rel != null) { + suiteLocation = "${basedir}/" + rel; // NOI18N + suitePropertiesLocation = SUITE_PROPERTIES; + } else { + suiteLocation = suiteDir.getAbsolutePath(); + suitePropertiesLocation = SUITE_PRIVATE_PROPERTIES; + } + EditableProperties props = new EditableProperties(true); + props.setProperty(SUITE_PATH_PARAM, suiteLocation); + FileObject suiteProperties = FileUtil.createData(projectDir, suitePropertiesLocation); + storeProperties(suiteProperties, props); + } + + private static void filterBuild( FileObject fo, ZipInputStream zipIS, + String codeBaseName ) throws IOException + { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + FileUtil.copy( zipIS , baos); + String content = baos.toString(UTF_8); + + content = content.replace( CODE_NAME_PARAM , codeBaseName ); + copyByteAfterByte(content, fo); + } + + private static void filterBundle( FileObject projectRoot, ZipInputStream is, + WizardDescriptor wizardDescriptor ) throws IOException + { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + FileUtil.copy(is, baos); + String content = baos.toString(UTF_8); + + content = content.replace( PROJECT_NAME_PARAM , + (String)wizardDescriptor.getProperty( + CustomComponentWizardIterator.DISPLAY_NAME ) ); + + FileObject fileObject = FileUtil.createData(projectRoot, + SRC + (String)wizardDescriptor.getProperty( + CustomComponentWizardIterator.BUNDLE_PATH) ); + copyByteAfterByte(content, fileObject); + } + + private static void copyLayer( FileObject projectRoot, ZipInputStream is, + WizardDescriptor wizard ) throws IOException + { + String layer = (String)wizard.getProperty( + CustomComponentWizardIterator.LAYER_PATH); + if ( layer == null || layer.length() ==0 ){ + return; + } + FileObject fileObject = FileUtil.createData(projectRoot, SRC + layer ); + copyByteAfterByte(is, fileObject ); + } + + private static void filterManifest( FileObject fo, ZipInputStream is, + WizardDescriptor wizard ) throws IOException + { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + FileUtil.copy(is, baos); + String content = baos.toString(UTF_8); + + content = content.replace( CODE_NAME_PARAM , (String)wizard.getProperty( + CustomComponentWizardIterator.CODE_BASE_NAME )); + content = content.replace( BUNDLE_PATH_PARAM, (String)wizard.getProperty( + CustomComponentWizardIterator.BUNDLE_PATH)); + StringBuilder builder = new StringBuilder( content ); + String layer = (String)wizard.getProperty( + CustomComponentWizardIterator.LAYER_PATH); + if ( layer != null){ + builder.append( LAYER ); + builder.append( layer ); + builder.append( "\n" ); + } + + copyByteAfterByte(builder.toString(), fo); + } + + private static void filterPlatformProperties( FileObject fo, ZipInputStream is, + WizardDescriptor wizard ) throws IOException + { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + FileUtil.copy(is, baos); + String content = baos.toString(UTF_8); + + content = content.replace( PLATFORM_ID_PARAM , getActivePlatform(wizard)); + + copyByteAfterByte(content, fo); + } + + private static void filterProjectXML( FileObject fo, ZipInputStream str, + String name ) throws IOException + { + try { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + FileUtil.copy(str, baos); + Document doc = XMLUtil.parse(new InputSource( + new ByteArrayInputStream(baos.toByteArray())), false, + false, null, null); + NodeList nl = doc.getDocumentElement().getElementsByTagName( + CODE_NAME_BASE); + if (nl != null) { + for (int i = 0; i < nl.getLength(); i++) { + Element el = (Element) nl.item(i); + if (el.getParentNode() != null + && DATA.equals(el.getParentNode().getNodeName())) + { + NodeList nl2 = el.getChildNodes(); + if (nl2.getLength() > 0) { + nl2.item(0).setNodeValue(name); + } + break; + } + } + } + OutputStream out = fo.getOutputStream(); + try { + XMLUtil.write(doc, out, UTF_8); + } + finally { + out.close(); + } + } + catch (Exception ex) { + Exceptions.printStackTrace(ex); + copyByteAfterByte(str, fo); + } + + } + +} diff -r e4be93651686 -r 7de4d4fa1f4b vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/ui/wizard/BasicModuleConfVisualPanel.form --- a/vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/ui/wizard/BasicModuleConfVisualPanel.form Thu Aug 28 23:26:11 2008 +0400 +++ b/vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/ui/wizard/BasicModuleConfVisualPanel.form Thu Aug 28 23:30:36 2008 +0400 @@ -17,7 +17,7 @@ - + @@ -34,7 +34,7 @@ - + @@ -49,7 +49,7 @@ - + @@ -64,7 +64,7 @@ - + @@ -79,42 +79,77 @@ - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r e4be93651686 -r 7de4d4fa1f4b vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/ui/wizard/BasicModuleConfVisualPanel.java --- a/vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/ui/wizard/BasicModuleConfVisualPanel.java Thu Aug 28 23:26:11 2008 +0400 +++ b/vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/ui/wizard/BasicModuleConfVisualPanel.java Thu Aug 28 23:30:36 2008 +0400 @@ -67,6 +67,8 @@ private static final String MSG_INVALID_CNB = "MSG_InvalidCNB"; // NOI18N + private static final String MSG_INVALID_NBORG_CNB + = "BasicConfVisualPanel_err_wrong_nborg_name"; // NOI18N private static final String ACS_LAYER_VALUE = "ACS_CTL_LayerValue"; // NOI18N private static final String ACS_DISPLAY_NAME_VALUE @@ -79,8 +81,6 @@ private static final long serialVersionUID = -7699370587627049750L; - // TODO should perform all checks together on any change. current code (copied) - // allows incorrect behavior in some cases. public BasicModuleConfVisualPanel( BasicModuleConfWizardPanel panel) { myPanel = panel; initComponents(); @@ -149,9 +149,30 @@ setError(getMessage(MSG_INVALID_CNB)); return false; } + if (BaseHelper.isNetBeansOrg(mySettings)) { + // Ensure that official naming conventions are respected. + String cnbShort = abbreviateCNB(dotName); + String name = (String)mySettings.getProperty( + CustomComponentWizardIterator.PROJECT_NAME); + if (!name.equals(cnbShort)) { + setError(getMessage(MSG_INVALID_NBORG_CNB, cnbShort)); + return false; + } + } return true; } + // copied from org.netbeans.modules.apisupport.project.universe.ModuleList + private static String abbreviateCNB(String cnb) { + return cnb.replaceFirst("^org\\.netbeans\\.modules\\.", ""). // NOI18N + replaceFirst("^org\\.netbeans\\.(libs|lib|api|spi|core)\\.", "$1."). // NOI18N + replaceFirst("^org\\.netbeans\\.", "o.n."). // NOI18N + replaceFirst("^org\\.openide\\.", "openide."). // NOI18N + replaceFirst("^org\\.", "o."). // NOI18N + replaceFirst("^com\\.sun\\.", "c.s."). // NOI18N + replaceFirst("^com\\.", "c."); // NOI18N + } + private void updateValuesOnCNBUpdate(){ String dotName = getCodeNameBaseValue(); // update layer and bundle from the cnb @@ -307,8 +328,8 @@ } } - private static String getMessage(String key) { - return NbBundle.getMessage(BasicModuleConfVisualPanel.class, key); + private static String getMessage(String key, Object... params) { + return NbBundle.getMessage(BasicModuleConfVisualPanel.class, key, params); } /** This method is called from within the constructor to @@ -330,6 +351,8 @@ bundleValue = new javax.swing.JTextField(); layerValue = new javax.swing.JTextField(); filler = new javax.swing.JLabel(); + generateLayer = new javax.swing.JCheckBox(); + cnbHint = new javax.swing.JLabel(); setLayout(new java.awt.GridBagLayout()); @@ -339,67 +362,92 @@ org.openide.awt.Mnemonics.setLocalizedText(codeNameBase, org.openide.util.NbBundle.getMessage(BasicModuleConfVisualPanel.class, "LBL_CodeNameBase")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; - gridBagConstraints.insets = new java.awt.Insets(1, 0, 6, 12); + gridBagConstraints.insets = new java.awt.Insets(2, 5, 6, 12); confPanel.add(codeNameBase, gridBagConstraints); displayName.setLabelFor(displayNameValue); org.openide.awt.Mnemonics.setLocalizedText(displayName, org.openide.util.NbBundle.getMessage(BasicModuleConfVisualPanel.class, "LBL_ModuleDisplayName")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 1; + gridBagConstraints.gridy = 2; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; - gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 12); + gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 12); confPanel.add(displayName, gridBagConstraints); bundle.setLabelFor(bundleValue); org.openide.awt.Mnemonics.setLocalizedText(bundle, org.openide.util.NbBundle.getMessage(BasicModuleConfVisualPanel.class, "LBL_LocalizingBundle")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 2; + gridBagConstraints.gridy = 3; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; - gridBagConstraints.insets = new java.awt.Insets(18, 0, 0, 12); + gridBagConstraints.insets = new java.awt.Insets(18, 5, 0, 12); confPanel.add(bundle, gridBagConstraints); layer.setLabelFor(layerValue); org.openide.awt.Mnemonics.setLocalizedText(layer, org.openide.util.NbBundle.getMessage(BasicModuleConfVisualPanel.class, "LBL_XMLLayer")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 3; + gridBagConstraints.gridy = 5; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; - gridBagConstraints.insets = new java.awt.Insets(6, 0, 0, 12); + gridBagConstraints.insets = new java.awt.Insets(3, 20, 0, 12); confPanel.add(layer, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.weightx = 1.0; - gridBagConstraints.insets = new java.awt.Insets(1, 0, 6, 0); + gridBagConstraints.insets = new java.awt.Insets(1, 0, 5, 0); confPanel.add(codeNameBaseValue, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; - gridBagConstraints.gridy = 1; + gridBagConstraints.gridy = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; confPanel.add(displayNameValue, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; - gridBagConstraints.gridy = 2; + gridBagConstraints.gridy = 3; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.insets = new java.awt.Insets(18, 0, 0, 0); confPanel.add(bundleValue, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; - gridBagConstraints.gridy = 3; + gridBagConstraints.gridy = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.insets = new java.awt.Insets(6, 0, 0, 0); confPanel.add(layerValue, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; - gridBagConstraints.gridy = 4; + gridBagConstraints.gridy = 6; gridBagConstraints.gridwidth = 2; gridBagConstraints.weighty = 1.0; confPanel.add(filler, gridBagConstraints); + + generateLayer.setSelected(true); + org.openide.awt.Mnemonics.setLocalizedText(generateLayer, getMessage("CTL_GenerateLayer")); // NOI18N + generateLayer.setEnabled(false); + generateLayer.setFocusable(false); + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 4; + gridBagConstraints.gridwidth = 2; + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; + gridBagConstraints.ipady = -2; + gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; + gridBagConstraints.insets = new java.awt.Insets(6, 0, 0, 0); + confPanel.add(generateLayer, gridBagConstraints); + generateLayer.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(BasicModuleConfVisualPanel.class, "ACS_CTL_GenerateLayer")); // NOI18N + generateLayer.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(BasicModuleConfVisualPanel.class, "ACS_CTL_GenerateLayer")); // NOI18N + + org.openide.awt.Mnemonics.setLocalizedText(cnbHint, getMessage("LBL_CodeNameBaseHint")); + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 1; + gridBagConstraints.gridy = 1; + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; + gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; + gridBagConstraints.insets = new java.awt.Insets(0, 0, 6, 0); + confPanel.add(cnbHint, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; @@ -408,18 +456,21 @@ gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.weighty = 1.0; + gridBagConstraints.insets = new java.awt.Insets(4, 0, 4, 0); add(confPanel, gridBagConstraints); }// //GEN-END:initComponents // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JLabel bundle; private javax.swing.JTextField bundleValue; + private javax.swing.JLabel cnbHint; private javax.swing.JLabel codeNameBase; private javax.swing.JTextField codeNameBaseValue; private javax.swing.JPanel confPanel; private javax.swing.JLabel displayName; private javax.swing.JTextField displayNameValue; private javax.swing.JLabel filler; + private javax.swing.JCheckBox generateLayer; private javax.swing.JLabel layer; private javax.swing.JTextField layerValue; // End of variables declaration//GEN-END:variables diff -r e4be93651686 -r 7de4d4fa1f4b vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/ui/wizard/Bundle.properties --- a/vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/ui/wizard/Bundle.properties Thu Aug 28 23:26:11 2008 +0400 +++ b/vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/ui/wizard/Bundle.properties Thu Aug 28 23:30:36 2008 +0400 @@ -85,11 +85,14 @@ LBL_ModuleDisplayName=Module &Display Name: LBL_LocalizingBundle=&Localizing Bundle: LBL_XMLLayer=&XML Layer: +CTL_GenerateLayer=&Generate XML Layer +LBL_CodeNameBaseHint=(e.g. "org.yourorg.modulename") ACS_BasicConfVisualPanel=Basic Module Configuration ACS_CTL_BundleValue=Localizing Bundle ACS_CTL_CodeNameBaseValue=Code name base ACS_CTL_DisplayNameValue=Display Name ACS_CTL_LayerValue=Layer +ACS_CTL_GenerateLayer=Generate XML Layer # Main Wizard Step "Basic Module Configuration" - messages MSG_InvalidCNB=Code Name Base is not valid @@ -99,6 +102,7 @@ BasicConfVisualPanel_err_bundle_def_pkg=Cannot use default package for bundle. BasicConfVisualPanel_err_layer_ext=Layer must have "{0}" extension. BasicConfVisualPanel_err_bundle_ext=Bundle must have "{0}" extension. +BasicConfVisualPanel_err_wrong_nborg_name=For this code name base, module must be in a directory named "{0}". # Main Wizard Step "Libraries Descriptors" LBL_AddedLibDescriptors=Chosen Libraries &Descriptors: diff -r e4be93651686 -r 7de4d4fa1f4b vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/ui/wizard/ComponentPresentersVisualPanel.java --- a/vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/ui/wizard/ComponentPresentersVisualPanel.java Thu Aug 28 23:26:11 2008 +0400 +++ b/vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/ui/wizard/ComponentPresentersVisualPanel.java Thu Aug 28 23:30:36 2008 +0400 @@ -41,10 +41,20 @@ package org.netbeans.modules.vmd.componentssupport.ui.wizard; +import java.net.URL; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; import javax.swing.JPanel; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; +import org.netbeans.api.project.libraries.Library; +import org.netbeans.modules.vmd.componentssupport.ui.helpers.JavaMELibsConfigurationHelper; +import org.netbeans.modules.vmd.componentssupport.ui.helpers.JavaMELibsPreviewHelper; import org.openide.WizardDescriptor; +import org.openide.filesystems.FileObject; +import org.openide.filesystems.FileUtil; +import org.openide.filesystems.URLMapper; import org.openide.util.HelpCtx; import org.openide.util.NbBundle; diff -r e4be93651686 -r 7de4d4fa1f4b vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/ui/wizard/CustomComponentVisualPanel.form --- a/vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/ui/wizard/CustomComponentVisualPanel.form Thu Aug 28 23:26:11 2008 +0400 +++ b/vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/ui/wizard/CustomComponentVisualPanel.form Thu Aug 28 23:30:36 2008 +0400 @@ -11,150 +11,11 @@ + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -170,6 +31,165 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r e4be93651686 -r 7de4d4fa1f4b vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/ui/wizard/CustomComponentVisualPanel.java --- a/vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/ui/wizard/CustomComponentVisualPanel.java Thu Aug 28 23:26:11 2008 +0400 +++ b/vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/ui/wizard/CustomComponentVisualPanel.java Thu Aug 28 23:30:36 2008 +0400 @@ -42,12 +42,20 @@ package org.netbeans.modules.vmd.componentssupport.ui.wizard; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; import java.io.File; +import javax.swing.JComponent; import javax.swing.JFileChooser; import javax.swing.JPanel; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; import javax.swing.text.Document; +import org.netbeans.modules.apisupport.project.ui.wizard.spi.ModuleTypePanel; import org.netbeans.spi.project.ui.support.ProjectChooser; import org.openide.WizardDescriptor; import org.openide.WizardValidationException; @@ -55,7 +63,7 @@ import org.openide.util.HelpCtx; import org.openide.util.NbBundle; -class CustomComponentVisualPanel extends JPanel implements DocumentListener { +class CustomComponentVisualPanel extends JPanel { public static final String PROP_PROJECT_NAME = "projectName"; public static final String BROWSE = "BROWSE"; @@ -77,35 +85,28 @@ public CustomComponentVisualPanel(CustomComponentWizardPanel panel) { initComponents(); this.myPanel = panel; + putClientProperty("NewProjectWizard_Title", NbBundle.getMessage(CustomComponentVisualPanel.class, "TXT_MobileDesigner")); - // Register listener on the textFields to make the automatic updates - projectNameTextField.getDocument().addDocumentListener(this); - projectLocationTextField.getDocument().addDocumentListener(this); + initDocumentListeners(); + attachDocumentListeners(); - initAccessibility();; + initAccessibility(); } - @Override + @Override public void addNotify() { super.addNotify(); + attachDocumentListeners(); //same problem as in 31086, initial focus on Cancel button projectNameTextField.requestFocus(); } - // Implementation of DocumentListener -------------------------------------- - public void changedUpdate(DocumentEvent e) { - updateTexts(e); - checkValidity(); + @Override + public void removeNotify() { + // prevent checking when the panel is not "active" + removeDocumentListeners(); + super.removeNotify(); } - - public void insertUpdate(DocumentEvent e) { - changedUpdate(e); - } - - public void removeUpdate(DocumentEvent e) { - changedUpdate(e); - } - // ------------- void store(WizardDescriptor d) { String name = projectNameTextField.getText().trim(); @@ -118,13 +119,34 @@ } void read(WizardDescriptor settings) { - mySettings = settings; + if (mySettings == null){ + mySettings = settings; + mySettings.addPropertyChangeListener(new PropertyChangeListener() { + + public void propertyChange(PropertyChangeEvent evt) { + String name = evt.getPropertyName(); + Object value = evt.getNewValue(); + + if (ModuleTypePanel.IS_STANDALONE_OR_SUITE_COMPONENT.equals(name)) { + moduletypeChanged(value); + } else if (ModuleTypePanel.SUITE_ROOT.equals(name)) { + moduleSuiteValueChanged(value); + } else if (ModuleTypePanel.ACTIVE_PLATFORM_ID.equals(name)){ + checkValidity(); + } + } + }); + initPanels(mySettings); + } + + //typeChooserPanel.read(mySettings); + // invoke store to have changes in mySettings + //typeChooserPanel.store(mySettings); if (getIsMainProject() != null){ this.mainProject.setSelected(getIsMainProject()); } - this.projectLocationTextField.setText( - getProjectLocation().getAbsolutePath()); + setLocation(getProjectLocation().getAbsolutePath()); this.projectNameTextField.setText(getProjectName()); this.projectNameTextField.selectAll(); @@ -134,6 +156,107 @@ return new HelpCtx(CustomComponentVisualPanel.class); } + private void initDocumentListeners() { + nameDL = new DocumentAdapter() { + public void insertUpdate(DocumentEvent e) { + updateTexts(e); + checkValidity(); + } + }; + locationDL = new DocumentAdapter() { + public void insertUpdate(DocumentEvent e) { + locationUpdated = true; + updateTexts(e); + checkValidity(); + } + }; + isMainAL = new ActionListener() { + public void actionPerformed(ActionEvent e) { + mainProjectTouched = true; + } + }; + } + + private void attachDocumentListeners() { + if (!listenersAttached) { + projectNameTextField.getDocument().addDocumentListener(nameDL); + projectLocationTextField.getDocument().addDocumentListener(locationDL); + mainProject.addActionListener(isMainAL); + listenersAttached = true; + } + } + + private void removeDocumentListeners() { + if (listenersAttached) { + projectNameTextField.getDocument().removeDocumentListener(nameDL); + projectLocationTextField.getDocument().removeDocumentListener(locationDL); + mainProject.removeActionListener(isMainAL); + listenersAttached = false; + } + } + + private void initPanels(WizardDescriptor settings){ + if (typeChooserPanel != null){ + typeChooserPanelContainer.removeAll(); + typeChooserPanel = null; + } + typeChooserPanel = ModuleTypePanel.createComponent(settings); + typeChooserPanelContainer.add(typeChooserPanel, BorderLayout.CENTER); + typeChooserPanelContainer.validate(); + validate(); + } + + private void moduleSuiteValueChanged(Object val) { + String suite = null; + if (val != null && val instanceof String){ + suite = (String)val; + } + if (!locationUpdated) { + setLocation(computeLocationValue(suite)); + } + checkValidity(); + } + + private void moduletypeChanged(Object val) { + Boolean isStandAlone = null; + if (val != null && val instanceof Boolean){ + isStandAlone = ((Boolean)val).booleanValue(); + } + // null means both radio uttons are deselected and disaled + if (isStandAlone == null){ + return; + } + + if (!mainProjectTouched) { + mainProject.setSelected(isStandAlone); + } + if (!locationUpdated) { + setLocation(computeInitialLocationValue()); + } + checkValidity(); + } + + private void setLocation(String location) { + boolean revert = !locationUpdated; + projectLocationTextField.setText(location); + locationUpdated = revert ^ true; + } + + boolean checkValidity() { + if (!isProjectNameValid()){ + return false; + } else if (!isProjectLocationValid()){ + return false; + } else if (!isCreatedFolderValid()){ + return false; + } else if (!ModuleTypePanel.validate(getSettings())){ + return false; + } + + markValid(); + return true; + } + private boolean isProjectNameValid(){ if (getProjectNameValue().trim().length() == 0) { setError(getMessage(MSG_NAME_CANNOT_BE_EMPTY)); @@ -187,21 +310,6 @@ return true; } - // TODO - boolean checkValidity() { - if (!isProjectNameValid()){ - return false; - } else if (!isProjectLocationValid()){ - return false; - } else if (!isCreatedFolderValid()){ - return false; - } - - - markValid(); - return true; - } - private String getProjectNameValue(){ return projectNameTextField.getText(); } @@ -232,7 +340,7 @@ } private final void setMessage(String message) { - mySettings.putProperty( + getSettings().putProperty( CustomComponentWizardIterator.WIZARD_PANEL_ERROR_MESSAGE, message); } @@ -252,20 +360,54 @@ * @return File Directory that will contain project folder */ File getProjectLocation(){ - File projectLocation = (File) mySettings + File projectLocation = (File) getSettings() .getProperty(CustomComponentWizardIterator.PROJECT_DIR); // project directory if (projectLocation == null || projectLocation.getParentFile() == null || !projectLocation.getParentFile().isDirectory()) { - projectLocation = ProjectChooser.getProjectsFolder(); + projectLocation = new File(computeInitialLocationValue()); } else { projectLocation = projectLocation.getParentFile(); } return projectLocation; } + private String computeInitialLocationValue(){ + if (typeChooserPanel != null && isSuiteComponent()) { + return computeLocationValue(getSelectedSuite()); + } else { + String path = ProjectChooser.getProjectsFolder().getAbsolutePath(); + return computeLocationValue(path); + } + } + + private String computeLocationValue(String value) { + if (value == null) { + value = System.getProperty("user.home"); // NOI18N + } + File file = new File(value); + if (!file.exists() && file.getParent() != null) { + return computeLocationValue(file.getParent()); + } else { + return file.exists() ? value : System.getProperty("user.home"); // NOI18N + } + } + + private Boolean isSuiteComponent(){ + Boolean result = null; + if (getSettings() != null){ + result = (Boolean) getSettings().getProperty( + ModuleTypePanel.IS_STANDALONE_OR_SUITE_COMPONENT); + } + return result != null ? !result : false; + } + + private String getSelectedSuite(){ + return (String)getSettings().getProperty(ModuleTypePanel.SUITE_ROOT); + } + /** * Returns project name value stored in WizardDescriptor, or * default value if it wasn't stored yet @@ -274,7 +416,7 @@ * name wich is not used as directory name in project location directory yet. */ String getProjectName(){ - String projectName = (String) mySettings + String projectName = (String) getSettings() .getProperty(CustomComponentWizardIterator.PROJECT_NAME); // project name if (projectName == null) { @@ -284,7 +426,7 @@ } Boolean getIsMainProject(){ - Boolean isMain = (Boolean) mySettings + Boolean isMain = (Boolean) getSettings() .getProperty(CustomComponentWizardIterator.SET_AS_MAIN); return isMain; } @@ -304,21 +446,92 @@ */ // //GEN-BEGIN:initComponents private void initComponents() { + java.awt.GridBagConstraints gridBagConstraints; + mainProject = new javax.swing.JCheckBox(); + infoPanel = new javax.swing.JPanel(); projectNameLabel = new javax.swing.JLabel(); projectNameTextField = new javax.swing.JTextField(); + createdFolderTextField = new javax.swing.JTextField(); projectLocationLabel = new javax.swing.JLabel(); + createdFolderLabel = new javax.swing.JLabel(); projectLocationTextField = new javax.swing.JTextField(); browseButton = new javax.swing.JButton(); - createdFolderLabel = new javax.swing.JLabel(); - createdFolderTextField = new javax.swing.JTextField(); - mainProject = new javax.swing.JCheckBox(); + typeChooserPanelContainer = new javax.swing.JPanel(); + fillerPanel = new javax.swing.JPanel(); + + setLayout(new java.awt.GridBagLayout()); + + mainProject.setSelected(true); + org.openide.awt.Mnemonics.setLocalizedText(mainProject, org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "LBL_SetAsMainProject")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 2; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.insets = new java.awt.Insets(12, 0, 0, 0); + add(mainProject, gridBagConstraints); + mainProject.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "ACSN_SetAsMainProject")); // NOI18N + mainProject.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "ACSD_SetAsMainProject")); // NOI18N + + infoPanel.setLayout(new java.awt.GridBagLayout()); projectNameLabel.setLabelFor(projectNameTextField); org.openide.awt.Mnemonics.setLocalizedText(projectNameLabel, org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "LBL_ProjectName")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 0; + gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; + gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 12); + infoPanel.add(projectNameLabel, gridBagConstraints); + projectNameLabel.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "ACSN_ProjectName")); // NOI18N + projectNameLabel.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "ACSD_ProjectName")); // NOI18N + + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 1; + gridBagConstraints.gridy = 0; + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; + gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; + gridBagConstraints.weightx = 1.0; + infoPanel.add(projectNameTextField, gridBagConstraints); + + createdFolderTextField.setEditable(false); + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 1; + gridBagConstraints.gridy = 2; + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; + gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; + gridBagConstraints.insets = new java.awt.Insets(0, 0, 6, 0); + infoPanel.add(createdFolderTextField, gridBagConstraints); projectLocationLabel.setLabelFor(projectLocationTextField); org.openide.awt.Mnemonics.setLocalizedText(projectLocationLabel, org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "LBL_ProjectLocation")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 1; + gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; + gridBagConstraints.insets = new java.awt.Insets(6, 0, 6, 12); + infoPanel.add(projectLocationLabel, gridBagConstraints); + projectLocationLabel.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "ACSN_ProjectLocation")); // NOI18N + projectLocationLabel.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "ACSD_ProjectLocation")); // NOI18N + + createdFolderLabel.setLabelFor(createdFolderTextField); + org.openide.awt.Mnemonics.setLocalizedText(createdFolderLabel, org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "LBL_ProjectFolder")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 2; + gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; + gridBagConstraints.insets = new java.awt.Insets(0, 0, 6, 12); + infoPanel.add(createdFolderLabel, gridBagConstraints); + createdFolderLabel.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "ACSN_ProjectFolder")); // NOI18N + createdFolderLabel.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "ACSD_ProjectFolder")); // NOI18N + + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 1; + gridBagConstraints.gridy = 1; + gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; + gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; + gridBagConstraints.insets = new java.awt.Insets(6, 0, 6, 0); + infoPanel.add(projectLocationTextField, gridBagConstraints); org.openide.awt.Mnemonics.setLocalizedText(browseButton, org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "LBL_Browse_Button")); // NOI18N browseButton.setActionCommand(BROWSE); @@ -327,66 +540,35 @@ browseButtonActionPerformed(evt); } }); - - createdFolderLabel.setLabelFor(createdFolderTextField); - org.openide.awt.Mnemonics.setLocalizedText(createdFolderLabel, org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "LBL_ProjectFolder")); // NOI18N - - createdFolderTextField.setEditable(false); - - mainProject.setSelected(true); - org.openide.awt.Mnemonics.setLocalizedText(mainProject, org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "LBL_SetAsMainProject")); // NOI18N - - org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); - this.setLayout(layout); - layout.setHorizontalGroup( - layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) - .add(org.jdesktop.layout.GroupLayout.LEADING, mainProject, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 541, Short.MAX_VALUE) - .add(layout.createSequentialGroup() - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(projectLocationLabel) - .add(createdFolderLabel) - .add(projectNameLabel)) - .add(19, 19, 19) - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(projectNameTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 441, Short.MAX_VALUE) - .add(org.jdesktop.layout.GroupLayout.TRAILING, projectLocationTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 441, Short.MAX_VALUE) - .add(org.jdesktop.layout.GroupLayout.TRAILING, createdFolderTextField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 441, Short.MAX_VALUE)))) - .add(18, 18, 18) - .add(browseButton) - .add(0, 0, 0)) - ); - layout.setVerticalGroup( - layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) - .add(layout.createSequentialGroup() - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) - .add(projectNameLabel) - .add(projectNameTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) - .add(projectLocationTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) - .add(projectLocationLabel) - .add(browseButton)) - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) - .add(createdFolderTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) - .add(createdFolderLabel)) - .add(18, 18, 18) - .add(mainProject) - .addContainerGap(183, Short.MAX_VALUE)) - ); - - projectNameLabel.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "ACSN_ProjectName")); // NOI18N - projectNameLabel.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "ACSD_ProjectName")); // NOI18N - projectLocationLabel.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "ACSN_ProjectLocation")); // NOI18N - projectLocationLabel.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "ACSD_ProjectLocation")); // NOI18N + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 2; + gridBagConstraints.gridy = 1; + gridBagConstraints.insets = new java.awt.Insets(6, 12, 6, 0); + infoPanel.add(browseButton, gridBagConstraints); browseButton.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "ACSN_Browse_Button")); // NOI18N browseButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "ACSN_Browse_Button")); // NOI18N - createdFolderLabel.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "ACSN_ProjectFolder")); // NOI18N - createdFolderLabel.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "ACSD_ProjectFolder")); // NOI18N - mainProject.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "ACSN_SetAsMainProject")); // NOI18N - mainProject.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(CustomComponentVisualPanel.class, "ACSD_SetAsMainProject")); // NOI18N + + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 0; + gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; + gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; + add(infoPanel, gridBagConstraints); + + typeChooserPanelContainer.setLayout(new java.awt.BorderLayout()); + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 1; + gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; + add(typeChooserPanelContainer, gridBagConstraints); + gridBagConstraints = new java.awt.GridBagConstraints(); + gridBagConstraints.gridx = 0; + gridBagConstraints.gridy = 3; + gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; + gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; + gridBagConstraints.weightx = 1.0; + gridBagConstraints.weighty = 1.0; + add(fillerPanel, gridBagConstraints); }// //GEN-END:initComponents private void browseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_browseButtonActionPerformed @@ -405,8 +587,8 @@ } if (JFileChooser.APPROVE_OPTION == chooser.showOpenDialog(this)) { File projectDir = chooser.getSelectedFile();//GEN-LAST:event_browseButtonActionPerformed - projectLocationTextField.setText( - FileUtil.normalizeFile(projectDir).getAbsolutePath()); + String projectDirPath = FileUtil.normalizeFile(projectDir).getAbsolutePath(); + projectLocationTextField.setText(computeLocationValue(projectDirPath)); } //myPanel.fireChangeEvent(); } @@ -424,11 +606,14 @@ private javax.swing.JButton browseButton; private javax.swing.JLabel createdFolderLabel; private javax.swing.JTextField createdFolderTextField; + private javax.swing.JPanel fillerPanel; + private javax.swing.JPanel infoPanel; private javax.swing.JCheckBox mainProject; private javax.swing.JLabel projectLocationLabel; private javax.swing.JTextField projectLocationTextField; private javax.swing.JLabel projectNameLabel; private javax.swing.JTextField projectNameTextField; + private javax.swing.JPanel typeChooserPanelContainer; // End of variables declaration//GEN-END:variables // TODO: use FileUtil.findFreeFolderName here @@ -464,15 +649,29 @@ String projectName = projectNameTextField.getText(); String projectFolder = projectLocationTextField.getText(); - //if (projectFolder.trim().length() == 0 || projectFolder.equals(oldName)) { createdFolderTextField.setText(projectFolder + File.separatorChar + projectName); - //} + projectFolderChanged(getCreatedFolderValue()); } - //myPanel.fireChangeEvent(); // Notify that the myPanel changed + } + + private void projectFolderChanged(String projectFolder){ + File folder = FileUtil.normalizeFile(new File(projectFolder)); + ModuleTypePanel.setProjectFolder(getSettings(), folder); + } + private WizardDescriptor getSettings(){ + return mySettings; } private WizardDescriptor mySettings; private CustomComponentWizardPanel myPanel; + private JComponent typeChooserPanel; + private boolean locationUpdated; + private boolean mainProjectTouched; + + private boolean listenersAttached; + private DocumentListener nameDL; + private DocumentListener locationDL; + private ActionListener isMainAL; } diff -r e4be93651686 -r 7de4d4fa1f4b vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/ui/wizard/CustomComponentWizardIterator.java --- a/vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/ui/wizard/CustomComponentWizardIterator.java Thu Aug 28 23:26:11 2008 +0400 +++ b/vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/ui/wizard/CustomComponentWizardIterator.java Thu Aug 28 23:30:36 2008 +0400 @@ -42,12 +42,8 @@ package org.netbeans.modules.vmd.componentssupport.ui.wizard; import java.awt.Component; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; import java.text.MessageFormat; import java.util.Collections; import java.util.Enumeration; @@ -56,8 +52,6 @@ import java.util.Map; import java.util.NoSuchElementException; import java.util.Set; -import java.util.zip.ZipEntry; -import java.util.zip.ZipInputStream; import javax.swing.JComponent; import javax.swing.event.ChangeListener; @@ -65,36 +59,20 @@ import org.netbeans.api.project.FileOwnerQuery; import org.netbeans.api.project.Project; import org.netbeans.api.project.ProjectManager; +import org.netbeans.modules.apisupport.project.ui.wizard.spi.ModuleTypePanel; import org.netbeans.modules.vmd.componentssupport.ui.helpers.BaseHelper; import org.netbeans.modules.vmd.componentssupport.ui.helpers.CustomComponentHelper; import org.netbeans.modules.vmd.componentssupport.ui.helpers.JavaMELibsConfigurationHelper; +import org.netbeans.modules.vmd.componentssupport.ui.helpers.ProjectTemplateZipHelper; import org.netbeans.spi.project.ui.support.ProjectChooser; -import org.netbeans.spi.project.ui.templates.support.Templates; import org.openide.WizardDescriptor; import org.openide.filesystems.FileObject; import org.openide.filesystems.FileUtil; -import org.openide.util.Exceptions; import org.openide.util.NbBundle; -import org.openide.xml.XMLUtil; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.NodeList; -import org.xml.sax.InputSource; public class CustomComponentWizardIterator implements WizardDescriptor./* Progress */InstantiatingIterator { - - // unzipped project filtering - private static final String UTF_8 = "UTF-8"; // NOI18N - - private static final String CODE_NAME_BASE - = "code-name-base"; // NOI18N - private static final String DATA = "data"; // NOI18N - private static final String PROJECT_XML = "nbproject/project.xml"; // NOI18N - private static final String BUILD_IMPL_XML - = "nbproject/build-impl.xml"; // NOI18N - private static final String BUILD_XML = "build.xml"; // NOI18N // wizard properties public static final String WIZARD_PANEL_ERROR_MESSAGE @@ -105,6 +83,9 @@ public static final String SELECTED_INDEX = WizardDescriptor.PROP_CONTENT_SELECTED_INDEX;// NOI18N + public static final String BUNDLE_PROPERTIES + = BaseHelper.BUNDLE_PROPERTIES; + public static final String LAYER_XML = BaseHelper.LAYER_XML; // steps public static final String STEP_BASIC_PARAMS = "LBL_BasicProjectParamsStep"; // NOI18N @@ -123,6 +104,7 @@ public static final String CODE_BASE_NAME = "codeBaseName"; // NOI18N public static final String DISPLAY_NAME = "displayName"; // NOI18N + // added library descriptors public static final String LIBRARIES = "libraries"; // NOI18N public static final String LIB_DISPLAY_NAMES @@ -131,24 +113,13 @@ // added Custom components public static final String CUSTOM_COMPONENTS = "customComponents"; // NOI18N - - // parameters for project - private static final String CODE_NAME_PARAM - = "_CODE_NAME_"; // NOI18N - private static final String BUNDLE_PATH_PARAM - = "_BUNDLE_PATH_"; // NOI18N - private static final String PROJECT_NAME_PARAM - = "_PROJECT_NAME_"; // NOI18N - // names of templates - public static final String BUNDLE_PROPERTIES - = "Bundle.properties"; // NOI18N - public static final String LAYER_XML = "layer.xml"; // NOI18N - - private static final String SRC = "src/"; // NOI18N - private static final String BUNDLE_NAME = SRC + BUNDLE_PROPERTIES; // NOI18N - private static final String LAYER_NAME = SRC + LAYER_XML; // NOI18N - private static final String MANIFEST = "manifest.mf"; // NOI18N - private static final String LAYER = "OpenIDE-Module-Layer: "; // NOI18N + + private static final String TEMPLATE_PROJECT_NETBEANSORG + = "CustomComponentProject_netbeansorg.zip"; //NOI18N + private static final String TEMPLATE_PROJECT_STANDALONE + = "CustomComponentProject_standalone.zip"; //NOI18N + private static final String TEMPLATE_PROJECT_SUITECOMPONENT + = "CustomComponentProject_suitecomponent.zip"; //NOI18N private CustomComponentWizardIterator() { } @@ -188,9 +159,11 @@ .getProperty(PROJECT_DIR)); dirF.mkdirs(); - FileObject template = Templates.getTemplate(myWizard); + FileObject template = getProjectTemplate(myWizard); FileObject dir = FileUtil.toFileObject(dirF); - unZipFile(template.getInputStream(), dir , myWizard ); + + ProjectTemplateZipHelper. + unZipFile(template.getInputStream(), dir , myWizard ); // Always open top dir as a project: @@ -218,6 +191,17 @@ // store custom component descriptors configureComponents(createdProject, myWizard); return resultSet; + } + + private FileObject getProjectTemplate(WizardDescriptor wizard){ + if (BaseHelper.isNetBeansOrg(wizard)){ + return BaseHelper.getTemplate(TEMPLATE_PROJECT_NETBEANSORG); + } else if (BaseHelper.isSuiteComponent(wizard)){ + return BaseHelper.getTemplate(TEMPLATE_PROJECT_SUITECOMPONENT); + } else if (BaseHelper.isStandalone(wizard)){ + return BaseHelper.getTemplate(TEMPLATE_PROJECT_STANDALONE); + } + throw new IllegalArgumentException("unsupported wizard type"); } public void initialize( WizardDescriptor wiz ) { @@ -316,183 +300,6 @@ return Collections.EMPTY_SET; } - private static void unZipFile( InputStream source, FileObject projectRoot , - WizardDescriptor wizard ) - throws IOException - { - try { - ZipInputStream zipIS = new ZipInputStream(source); - ZipEntry entry; - while ((entry = zipIS.getNextEntry()) != null) { - if (entry.isDirectory()) { - FileUtil.createFolder(projectRoot, entry.getName()); - } - else { - FileObject fo = null; - if (PROJECT_XML.equals(entry.getName())) { - // Special handling for setting name of Ant-based - // projects; customize as needed: - fo = FileUtil.createData(projectRoot, entry - .getName()); - filterProjectXML(fo, zipIS, (String)wizard.getProperty( - CODE_BASE_NAME )); - } - else if ( MANIFEST.equals(entry.getName())){ - fo = FileUtil.createData(projectRoot, entry - .getName()); - filterManifest( fo , zipIS, wizard ); - } - else if ( LAYER_NAME.equals(entry.getName())){ - copyLayer( projectRoot , zipIS , wizard ); - } - else if ( BUNDLE_NAME.equals(entry.getName()) ) { - filterBundle( projectRoot , zipIS, wizard ); - } - else if ( BUILD_XML.equals(entry.getName()) - || BUILD_IMPL_XML.equals(entry.getName())) - { - fo = FileUtil.createData(projectRoot, entry - .getName()); - filterBuild( fo , zipIS, (String)wizard.getProperty( - CODE_BASE_NAME ) ); - } - else { - fo = FileUtil.createData(projectRoot, entry - .getName()); - BaseHelper.copyByteAfterByte(zipIS, fo); - } - } - } - } - finally { - source.close(); - } - } - - private static void filterBuild( FileObject fo, ZipInputStream zipIS, - String codeBaseName ) throws IOException - { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - FileUtil.copy( zipIS , baos); - String content = baos.toString(UTF_8); - - content = content.replace( CODE_NAME_PARAM , codeBaseName ); - - ByteArrayInputStream inputStream = new ByteArrayInputStream(content - .getBytes(UTF_8)); - OutputStream out = fo.getOutputStream(); - try { - FileUtil.copy(inputStream, out); - } - finally { - out.close(); - } - } - - private static void filterBundle( FileObject projectRoot, ZipInputStream is, - WizardDescriptor wizardDescriptor ) throws IOException - { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - FileUtil.copy(is, baos); - String content = baos.toString(UTF_8); - - content = content.replace( PROJECT_NAME_PARAM , - (String)wizardDescriptor.getProperty( DISPLAY_NAME ) ); - - ByteArrayInputStream inputStream = new ByteArrayInputStream(content - .getBytes(UTF_8)); - FileObject fileObject = FileUtil.createData(projectRoot, - SRC + (String)wizardDescriptor.getProperty( BUNDLE_PATH) ); - OutputStream out = fileObject.getOutputStream(); - try { - FileUtil.copy(inputStream, out); - } - finally { - out.close(); - } - } - - private static void copyLayer( FileObject projectRoot, ZipInputStream is, - WizardDescriptor wizard ) throws IOException - { - String layer = (String)wizard.getProperty( LAYER_PATH); - if ( layer == null || layer.length() ==0 ){ - return; - } - FileObject fileObject = FileUtil.createData(projectRoot, SRC + layer ); - BaseHelper.copyByteAfterByte(is, fileObject ); - } - - private static void filterManifest( FileObject fo, ZipInputStream is, - WizardDescriptor wizard ) throws IOException - { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - FileUtil.copy(is, baos); - String content = baos.toString(UTF_8); - - content = content.replace( CODE_NAME_PARAM , (String)wizard.getProperty( - CODE_BASE_NAME )); - content = content.replace( BUNDLE_PATH_PARAM, (String)wizard.getProperty( - BUNDLE_PATH)); - StringBuilder builder = new StringBuilder( content ); - String layer = (String)wizard.getProperty( LAYER_PATH); - if ( layer != null){ - builder.append( LAYER ); - builder.append( layer ); - builder.append( "\n" ); - } - - ByteArrayInputStream inputStream = new ByteArrayInputStream( - builder.toString().getBytes(UTF_8)); - OutputStream out = fo.getOutputStream(); - try { - FileUtil.copy(inputStream, out); - } - finally { - out.close(); - } - } - - - private static void filterProjectXML( FileObject fo, ZipInputStream str, - String name ) throws IOException - { - try { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - FileUtil.copy(str, baos); - Document doc = XMLUtil.parse(new InputSource( - new ByteArrayInputStream(baos.toByteArray())), false, - false, null, null); - NodeList nl = doc.getDocumentElement().getElementsByTagName( - CODE_NAME_BASE); - if (nl != null) { - for (int i = 0; i < nl.getLength(); i++) { - Element el = (Element) nl.item(i); - if (el.getParentNode() != null - && DATA.equals(el.getParentNode().getNodeName())) - { - NodeList nl2 = el.getChildNodes(); - if (nl2.getLength() > 0) { - nl2.item(0).setNodeValue(name); - } - break; - } - } - } - OutputStream out = fo.getOutputStream(); - try { - XMLUtil.write(doc, out, UTF_8); - } - finally { - out.close(); - } - } - catch (Exception ex) { - Exceptions.printStackTrace(ex); - BaseHelper.copyByteAfterByte(str, fo); - } - - } private int index; private WizardDescriptor.Panel[] panels; diff -r e4be93651686 -r 7de4d4fa1f4b vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/ui/wizard/DocumentAdapter.java --- a/vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/ui/wizard/DocumentAdapter.java Thu Aug 28 23:26:11 2008 +0400 +++ b/vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/ui/wizard/DocumentAdapter.java Thu Aug 28 23:30:36 2008 +0400 @@ -44,6 +44,6 @@ import javax.swing.event.DocumentListener; abstract class DocumentAdapter implements DocumentListener { - public void removeUpdate(DocumentEvent e) { insertUpdate(null); } - public void changedUpdate(DocumentEvent e) { insertUpdate(null); } + public void removeUpdate(DocumentEvent e) { insertUpdate(e); } + public void changedUpdate(DocumentEvent e) { insertUpdate(e); } } \ No newline at end of file diff -r e4be93651686 -r 7de4d4fa1f4b vmd.componentssupport/template/build.xml --- a/vmd.componentssupport/template/build.xml Thu Aug 28 23:26:11 2008 +0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ - - - - - - Builds, tests, and runs the project _CODE_NAME_. - - diff -r e4be93651686 -r 7de4d4fa1f4b vmd.componentssupport/template/manifest.mf --- a/vmd.componentssupport/template/manifest.mf Thu Aug 28 23:26:11 2008 +0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,4 +0,0 @@ -Manifest-Version: 1.0 -OpenIDE-Module: _CODE_NAME_ -OpenIDE-Module-Localizing-Bundle: _BUNDLE_PATH_ -OpenIDE-Module-Specification-Version: 1.0 diff -r e4be93651686 -r 7de4d4fa1f4b vmd.componentssupport/template/nbproject/build-impl.xml --- a/vmd.componentssupport/template/nbproject/build-impl.xml Thu Aug 28 23:26:11 2008 +0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff -r e4be93651686 -r 7de4d4fa1f4b vmd.componentssupport/template/nbproject/genfiles.properties --- a/vmd.componentssupport/template/nbproject/genfiles.properties Thu Aug 28 23:26:11 2008 +0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ -build.xml.data.CRC32=e75f04e7 -build.xml.script.CRC32=f8e43aec -build.xml.stylesheet.CRC32=79c3b980 -# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. -# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. -nbproject/build-impl.xml.data.CRC32=e75f04e7 -nbproject/build-impl.xml.script.CRC32=24ed9cd8 -nbproject/build-impl.xml.stylesheet.CRC32=deb65f65 diff -r e4be93651686 -r 7de4d4fa1f4b vmd.componentssupport/template/nbproject/platform.properties --- a/vmd.componentssupport/template/nbproject/platform.properties Thu Aug 28 23:26:11 2008 +0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -nbplatform.active=default diff -r e4be93651686 -r 7de4d4fa1f4b vmd.componentssupport/template/nbproject/project.properties --- a/vmd.componentssupport/template/nbproject/project.properties Thu Aug 28 23:26:11 2008 +0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -javac.source=1.5 -javac.compilerargs=-Xlint -Xlint:-serial diff -r e4be93651686 -r 7de4d4fa1f4b vmd.componentssupport/template/nbproject/project.xml --- a/vmd.componentssupport/template/nbproject/project.xml Thu Aug 28 23:26:11 2008 +0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ - - - org.netbeans.modules.apisupport.project - - - TEMPLATE_NAME_TO_BE_REPLACED - - - - org.netbeans.modules.vmd.midp - - - - 1.1 - - - - org.netbeans.modules.vmd.model - - - - 1.1 - - - - org.netbeans.modules.vmd.properties - - - - 1.1 - - - - org.openide.util - - - - 7.12 - - - - - - - diff -r e4be93651686 -r 7de4d4fa1f4b vmd.componentssupport/template/src/Bundle.properties --- a/vmd.componentssupport/template/src/Bundle.properties Thu Aug 28 23:26:11 2008 +0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,4 +0,0 @@ -OpenIDE-Module-Long-Description=\ - Visual Mobile Designer Custom Component Project -OpenIDE-Module-Name=_PROJECT_NAME_ -OpenIDE-Module-Short-Description=VMD Custom Component Project diff -r e4be93651686 -r 7de4d4fa1f4b vmd.componentssupport/template/src/layer.xml --- a/vmd.componentssupport/template/src/layer.xml Thu Aug 28 23:26:11 2008 +0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,4 +0,0 @@ - - - - diff -r e4be93651686 -r 7de4d4fa1f4b vmd.componentssupport/template_netbeansorg/build.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vmd.componentssupport/template_netbeansorg/build.xml Thu Aug 28 23:30:36 2008 +0400 @@ -0,0 +1,8 @@ + + + + + + Builds, tests, and runs the project _CODE_NAME_. + + diff -r e4be93651686 -r 7de4d4fa1f4b vmd.componentssupport/template_netbeansorg/manifest.mf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vmd.componentssupport/template_netbeansorg/manifest.mf Thu Aug 28 23:30:36 2008 +0400 @@ -0,0 +1,4 @@ +Manifest-Version: 1.0 +OpenIDE-Module: _CODE_NAME_ +OpenIDE-Module-Localizing-Bundle: _BUNDLE_PATH_ +OpenIDE-Module-Specification-Version: 1.0 diff -r e4be93651686 -r 7de4d4fa1f4b vmd.componentssupport/template_netbeansorg/nbproject/project.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vmd.componentssupport/template_netbeansorg/nbproject/project.properties Thu Aug 28 23:30:36 2008 +0400 @@ -0,0 +1,2 @@ +javac.source=1.5 +javac.compilerargs=-Xlint -Xlint:-serial diff -r e4be93651686 -r 7de4d4fa1f4b vmd.componentssupport/template_netbeansorg/nbproject/project.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vmd.componentssupport/template_netbeansorg/nbproject/project.xml Thu Aug 28 23:30:36 2008 +0400 @@ -0,0 +1,44 @@ + + + org.netbeans.modules.apisupport.project + + + TEMPLATE_NAME_TO_BE_REPLACED + + + org.netbeans.modules.vmd.midp + + + + 1.1 + + + + org.netbeans.modules.vmd.model + + + + 1.1 + + + + org.netbeans.modules.vmd.properties + + + + 1.1 + + + + org.openide.util + + + + 7.12 + + + + + + + diff -r e4be93651686 -r 7de4d4fa1f4b vmd.componentssupport/template_netbeansorg/src/Bundle.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vmd.componentssupport/template_netbeansorg/src/Bundle.properties Thu Aug 28 23:30:36 2008 +0400 @@ -0,0 +1,4 @@ +OpenIDE-Module-Long-Description=\ + Mobility Visual Designer Custom Component Project +OpenIDE-Module-Name=_PROJECT_NAME_ +OpenIDE-Module-Short-Description=VMD Custom Component Project diff -r e4be93651686 -r 7de4d4fa1f4b vmd.componentssupport/template_netbeansorg/src/layer.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vmd.componentssupport/template_netbeansorg/src/layer.xml Thu Aug 28 23:30:36 2008 +0400 @@ -0,0 +1,4 @@ + + + + diff -r e4be93651686 -r 7de4d4fa1f4b vmd.componentssupport/template_standalone/build.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vmd.componentssupport/template_standalone/build.xml Thu Aug 28 23:30:36 2008 +0400 @@ -0,0 +1,8 @@ + + + + + + Builds, tests, and runs the project _CODE_NAME_. + + diff -r e4be93651686 -r 7de4d4fa1f4b vmd.componentssupport/template_standalone/manifest.mf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vmd.componentssupport/template_standalone/manifest.mf Thu Aug 28 23:30:36 2008 +0400 @@ -0,0 +1,4 @@ +Manifest-Version: 1.0 +OpenIDE-Module: _CODE_NAME_ +OpenIDE-Module-Localizing-Bundle: _BUNDLE_PATH_ +OpenIDE-Module-Specification-Version: 1.0 diff -r e4be93651686 -r 7de4d4fa1f4b vmd.componentssupport/template_standalone/nbproject/build-impl.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vmd.componentssupport/template_standalone/nbproject/build-impl.xml Thu Aug 28 23:30:36 2008 +0400 @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff -r e4be93651686 -r 7de4d4fa1f4b vmd.componentssupport/template_standalone/nbproject/genfiles.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vmd.componentssupport/template_standalone/nbproject/genfiles.properties Thu Aug 28 23:30:36 2008 +0400 @@ -0,0 +1,8 @@ +build.xml.data.CRC32=e75f04e7 +build.xml.script.CRC32=f8e43aec +build.xml.stylesheet.CRC32=79c3b980 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=e75f04e7 +nbproject/build-impl.xml.script.CRC32=24ed9cd8 +nbproject/build-impl.xml.stylesheet.CRC32=deb65f65 diff -r e4be93651686 -r 7de4d4fa1f4b vmd.componentssupport/template_standalone/nbproject/platform.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vmd.componentssupport/template_standalone/nbproject/platform.properties Thu Aug 28 23:30:36 2008 +0400 @@ -0,0 +1,1 @@ +nbplatform.active=_PLATFORM_ID_ diff -r e4be93651686 -r 7de4d4fa1f4b vmd.componentssupport/template_standalone/nbproject/project.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vmd.componentssupport/template_standalone/nbproject/project.properties Thu Aug 28 23:30:36 2008 +0400 @@ -0,0 +1,2 @@ +javac.source=1.5 +javac.compilerargs=-Xlint -Xlint:-serial diff -r e4be93651686 -r 7de4d4fa1f4b vmd.componentssupport/template_standalone/nbproject/project.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vmd.componentssupport/template_standalone/nbproject/project.xml Thu Aug 28 23:30:36 2008 +0400 @@ -0,0 +1,45 @@ + + + org.netbeans.modules.apisupport.project + + + TEMPLATE_NAME_TO_BE_REPLACED + + + + org.netbeans.modules.vmd.midp + + + + 1.1 + + + + org.netbeans.modules.vmd.model + + + + 1.1 + + + + org.netbeans.modules.vmd.properties + + + + 1.1 + + + + org.openide.util + + + + 7.12 + + + + + + + diff -r e4be93651686 -r 7de4d4fa1f4b vmd.componentssupport/template_standalone/src/Bundle.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vmd.componentssupport/template_standalone/src/Bundle.properties Thu Aug 28 23:30:36 2008 +0400 @@ -0,0 +1,4 @@ +OpenIDE-Module-Long-Description=\ + Mobility Visual Designer Custom Component Project +OpenIDE-Module-Name=_PROJECT_NAME_ +OpenIDE-Module-Short-Description=VMD Custom Component Project diff -r e4be93651686 -r 7de4d4fa1f4b vmd.componentssupport/template_standalone/src/layer.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vmd.componentssupport/template_standalone/src/layer.xml Thu Aug 28 23:30:36 2008 +0400 @@ -0,0 +1,4 @@ + + + + diff -r e4be93651686 -r 7de4d4fa1f4b vmd.componentssupport/template_suitecomponent/build.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vmd.componentssupport/template_suitecomponent/build.xml Thu Aug 28 23:30:36 2008 +0400 @@ -0,0 +1,8 @@ + + + + + + Builds, tests, and runs the project _CODE_NAME_. + + diff -r e4be93651686 -r 7de4d4fa1f4b vmd.componentssupport/template_suitecomponent/manifest.mf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vmd.componentssupport/template_suitecomponent/manifest.mf Thu Aug 28 23:30:36 2008 +0400 @@ -0,0 +1,4 @@ +Manifest-Version: 1.0 +OpenIDE-Module: _CODE_NAME_ +OpenIDE-Module-Localizing-Bundle: _BUNDLE_PATH_ +OpenIDE-Module-Specification-Version: 1.0 diff -r e4be93651686 -r 7de4d4fa1f4b vmd.componentssupport/template_suitecomponent/nbproject/build-impl.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vmd.componentssupport/template_suitecomponent/nbproject/build-impl.xml Thu Aug 28 23:30:36 2008 +0400 @@ -0,0 +1,30 @@ + + + + + + You must set 'suite.dir' to point to your containing module suite + + + + + + + + + + + + + + + + + + + + + diff -r e4be93651686 -r 7de4d4fa1f4b vmd.componentssupport/template_suitecomponent/nbproject/genfiles.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vmd.componentssupport/template_suitecomponent/nbproject/genfiles.properties Thu Aug 28 23:30:36 2008 +0400 @@ -0,0 +1,8 @@ +build.xml.data.CRC32=bc9461d8 +build.xml.script.CRC32=203ac72c +build.xml.stylesheet.CRC32=79c3b980 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=bc9461d8 +nbproject/build-impl.xml.script.CRC32=cf6b1fcb +nbproject/build-impl.xml.stylesheet.CRC32=deb65f65 diff -r e4be93651686 -r 7de4d4fa1f4b vmd.componentssupport/template_suitecomponent/nbproject/project.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vmd.componentssupport/template_suitecomponent/nbproject/project.properties Thu Aug 28 23:30:36 2008 +0400 @@ -0,0 +1,2 @@ +javac.source=1.5 +javac.compilerargs=-Xlint -Xlint:-serial diff -r e4be93651686 -r 7de4d4fa1f4b vmd.componentssupport/template_suitecomponent/nbproject/project.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vmd.componentssupport/template_suitecomponent/nbproject/project.xml Thu Aug 28 23:30:36 2008 +0400 @@ -0,0 +1,45 @@ + + + org.netbeans.modules.apisupport.project + + + TEMPLATE_NAME_TO_BE_REPLACED + + + + org.netbeans.modules.vmd.midp + + + + 1.1 + + + + org.netbeans.modules.vmd.model + + + + 1.1 + + + + org.netbeans.modules.vmd.properties + + + + 1.1 + + + + org.openide.util + + + + 7.12 + + + + + + + diff -r e4be93651686 -r 7de4d4fa1f4b vmd.componentssupport/template_suitecomponent/src/Bundle.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vmd.componentssupport/template_suitecomponent/src/Bundle.properties Thu Aug 28 23:30:36 2008 +0400 @@ -0,0 +1,4 @@ +OpenIDE-Module-Long-Description=\ + Mobility Visual Designer Custom Component Project +OpenIDE-Module-Name=_PROJECT_NAME_ +OpenIDE-Module-Short-Description=VMD Custom Component Project diff -r e4be93651686 -r 7de4d4fa1f4b vmd.componentssupport/template_suitecomponent/src/layer.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vmd.componentssupport/template_suitecomponent/src/layer.xml Thu Aug 28 23:30:36 2008 +0400 @@ -0,0 +1,4 @@ + + + +