# HG changeset patch
# User akorostelev@netbeans.org
# Date 1219709113 -14400
# Node ID 31e7311b0a15c95c283ee1ab8547db0ae4856b34
# Parent 6b8b093504533d2e453ab091cce7fe1f4ccd34a6
fix for 136248. To use API exposed by fix of 142283
diff -r 6b8b09350453 -r 31e7311b0a15 vmd.componentssupport/build.xml
--- a/vmd.componentssupport/build.xml Tue Aug 26 04:01:37 2008 +0400
+++ b/vmd.componentssupport/build.xml Tue Aug 26 04:05:13 2008 +0400
@@ -10,9 +10,17 @@
-
+
+
diff -r 6b8b09350453 -r 31e7311b0a15 vmd.componentssupport/nbproject/project.xml
--- a/vmd.componentssupport/nbproject/project.xml Tue Aug 26 04:01:37 2008 +0400
+++ b/vmd.componentssupport/nbproject/project.xml Tue Aug 26 04:05:13 2008 +0400
@@ -21,6 +21,14 @@
1
1.8
+
+
+
+ org.netbeans.modules.apisupport.project
+
+
+
+ 1.22
diff -r 6b8b09350453 -r 31e7311b0a15 vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/Bundle.properties
--- a/vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/Bundle.properties Tue Aug 26 04:01:37 2008 +0400
+++ b/vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/Bundle.properties Tue Aug 26 04:05:13 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 6b8b09350453 -r 31e7311b0a15 vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/layer.xml
--- a/vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/layer.xml Tue Aug 26 04:01:37 2008 +0400
+++ b/vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/layer.xml Tue Aug 26 04:05:13 2008 +0400
@@ -9,7 +9,7 @@
-
+
@@ -39,6 +39,9 @@
+
+
+
diff -r 6b8b09350453 -r 31e7311b0a15 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 Tue Aug 26 04:01:37 2008 +0400
+++ b/vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/ui/helpers/BaseHelper.java Tue Aug 26 04:05:13 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.vmd.componentssupport.ui.wizard.CustomComponentWizardIterator;
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;
@@ -197,8 +200,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 +317,32 @@
}
}
+ public static boolean isSuiteComponent(WizardDescriptor wizard){
+ Object value = wizard.getProperty(
+ CustomComponentWizardIterator.IS_STANDALONE_OR_SUITE_COMPONENT);
+ return !extractBoolean(value, true);
+ }
+
+ public static boolean isStandalone(WizardDescriptor wizard){
+ Object value = wizard.getProperty(
+ CustomComponentWizardIterator.IS_STANDALONE_OR_SUITE_COMPONENT);
+ return extractBoolean(value, false);
+ }
+
+ public static boolean isNetBeansOrg(WizardDescriptor wizard){
+ Object value = wizard.getProperty(
+ CustomComponentWizardIterator.IS_NETBEANS_ORG);
+ return extractBoolean(value, false);
+ }
+
+ private static boolean extractBoolean(Object value, boolean defaultValue){
+ if (value != null && value instanceof Boolean){
+ return (Boolean)value;
+ }
+ return defaultValue;
+ }
+
+
+
}
diff -r 6b8b09350453 -r 31e7311b0a15 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 Tue Aug 26 04:05:13 2008 +0400
@@ -0,0 +1,315 @@
+/*
+ * 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 = (String)wizard.getProperty(
+ CustomComponentWizardIterator.SUITE_ROOT);
+ 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 , (String)wizard.getProperty(
+ CustomComponentWizardIterator.PLATFORM_ID ));
+
+ 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 6b8b09350453 -r 31e7311b0a15 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 Tue Aug 26 04:01:37 2008 +0400
+++ b/vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/ui/wizard/BasicModuleConfVisualPanel.java Tue Aug 26 04:05:13 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
diff -r 6b8b09350453 -r 31e7311b0a15 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 Tue Aug 26 04:01:37 2008 +0400
+++ b/vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/ui/wizard/Bundle.properties Tue Aug 26 04:05:13 2008 +0400
@@ -99,6 +99,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 6b8b09350453 -r 31e7311b0a15 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 Tue Aug 26 04:01:37 2008 +0400
+++ b/vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/ui/wizard/ComponentPresentersVisualPanel.java Tue Aug 26 04:05:13 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 6b8b09350453 -r 31e7311b0a15 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 Tue Aug 26 04:01:37 2008 +0400
+++ b/vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/ui/wizard/CustomComponentVisualPanel.form Tue Aug 26 04:05:13 2008 +0400
@@ -11,150 +11,11 @@
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -170,6 +31,165 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r 6b8b09350453 -r 31e7311b0a15 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 Tue Aug 26 04:01:37 2008 +0400
+++ b/vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/ui/wizard/CustomComponentVisualPanel.java Tue Aug 26 04:05:13 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.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.ModuleTypePanelCreator;
+import org.netbeans.modules.apisupport.project.ui.wizard.spi.ModuleTypePanelCreator.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";
@@ -76,36 +84,30 @@
public CustomComponentVisualPanel(CustomComponentWizardPanel panel) {
initComponents();
+ initPanels();
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 +120,33 @@
}
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.equals(name)){
+ checkValidity();
+ }
+ }
+ });
+ }
+
+ //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,108 @@
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(){
+ if (typeChooserPanel != null){
+ typeChooserPanelContainer.removeAll();
+ typeChooserPanel = null;
+ }
+ typeChooserPanel = ModuleTypePanelCreator.create();
+ Component component = typeChooserPanel.getComponent();
+ typeChooserPanelContainer.add(component, 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 (!typeChooserPanel.validate(getSettings())){
+ return false;
+ }
+
+ markValid();
+ return true;
+ }
+
private boolean isProjectNameValid(){
if (getProjectNameValue().trim().length() == 0) {
setError(getMessage(MSG_NAME_CANNOT_BE_EMPTY));
@@ -187,21 +311,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 +341,7 @@
}
private final void setMessage(String message) {
- mySettings.putProperty(
+ getSettings().putProperty(
CustomComponentWizardIterator.WIZARD_PANEL_ERROR_MESSAGE,
message);
}
@@ -252,20 +361,55 @@
* @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(){
+ boolean ddd = isSuiteComponent();
+ 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 +418,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 +428,7 @@
}
Boolean getIsMainProject(){
- Boolean isMain = (Boolean) mySettings
+ Boolean isMain = (Boolean) getSettings()
.getProperty(CustomComponentWizardIterator.SET_AS_MAIN);
return isMain;
}
@@ -304,21 +448,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 +542,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 +589,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 +608,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 +651,32 @@
String projectName = projectNameTextField.getText();
String projectFolder = projectLocationTextField.getText();
- //if (projectFolder.trim().length() == 0 || projectFolder.equals(oldName)) {
createdFolderTextField.setText(projectFolder + File.separatorChar + projectName);
- //}
+ projectFolderChanged(getCreatedFolderValue());
+ typeChooserPanel.setProjectFolder(getSettings());
}
//myPanel.fireChangeEvent(); // Notify that the myPanel changed
}
+
+ private void projectFolderChanged(String projectFolder){
+ File folder = FileUtil.normalizeFile(new File(projectFolder));
+ getSettings().putProperty(ModuleTypePanel.PROJECT_FOLDER, folder);
+ }
+
+ private WizardDescriptor getSettings(){
+ return mySettings;
+ }
private WizardDescriptor mySettings;
private CustomComponentWizardPanel myPanel;
+ private ModuleTypePanel typeChooserPanel;
+ private boolean locationUpdated;
+ private boolean mainProjectTouched;
+
+ private boolean listenersAttached;
+ private DocumentListener nameDL;
+ private DocumentListener locationDL;
+ private ActionListener isMainAL;
}
diff -r 6b8b09350453 -r 31e7311b0a15 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 Tue Aug 26 04:01:37 2008 +0400
+++ b/vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/ui/wizard/CustomComponentWizardIterator.java Tue Aug 26 04:05:13 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.ModuleTypePanelCreator.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,15 @@
public static final String CODE_BASE_NAME
= "codeBaseName"; // NOI18N
public static final String DISPLAY_NAME = "displayName"; // NOI18N
+ public static final String IS_NETBEANS_ORG
+ = ModuleTypePanel.IS_NETBEANS_ORG;
+ public static final String IS_STANDALONE_OR_SUITE_COMPONENT
+ = ModuleTypePanel.IS_STANDALONE_OR_SUITE_COMPONENT;
+ public static final String SUITE_ROOT
+ = ModuleTypePanel.SUITE_ROOT;
+ public static final String PLATFORM_ID
+ = ModuleTypePanel.ACTIVE_PLATFORM;
+
// added library descriptors
public static final String LIBRARIES = "libraries"; // NOI18N
public static final String LIB_DISPLAY_NAMES
@@ -131,24 +121,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 +167,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 +199,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 +308,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 6b8b09350453 -r 31e7311b0a15 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 Tue Aug 26 04:01:37 2008 +0400
+++ b/vmd.componentssupport/src/org/netbeans/modules/vmd/componentssupport/ui/wizard/DocumentAdapter.java Tue Aug 26 04:05:13 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 6b8b09350453 -r 31e7311b0a15 vmd.componentssupport/template/build.xml
--- a/vmd.componentssupport/template/build.xml Tue Aug 26 04:01:37 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 6b8b09350453 -r 31e7311b0a15 vmd.componentssupport/template/manifest.mf
--- a/vmd.componentssupport/template/manifest.mf Tue Aug 26 04:01:37 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 6b8b09350453 -r 31e7311b0a15 vmd.componentssupport/template/nbproject/build-impl.xml
--- a/vmd.componentssupport/template/nbproject/build-impl.xml Tue Aug 26 04:01:37 2008 +0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff -r 6b8b09350453 -r 31e7311b0a15 vmd.componentssupport/template/nbproject/genfiles.properties
--- a/vmd.componentssupport/template/nbproject/genfiles.properties Tue Aug 26 04:01:37 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 6b8b09350453 -r 31e7311b0a15 vmd.componentssupport/template/nbproject/platform.properties
--- a/vmd.componentssupport/template/nbproject/platform.properties Tue Aug 26 04:01:37 2008 +0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-nbplatform.active=default
diff -r 6b8b09350453 -r 31e7311b0a15 vmd.componentssupport/template/nbproject/project.properties
--- a/vmd.componentssupport/template/nbproject/project.properties Tue Aug 26 04:01:37 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 6b8b09350453 -r 31e7311b0a15 vmd.componentssupport/template/nbproject/project.xml
--- a/vmd.componentssupport/template/nbproject/project.xml Tue Aug 26 04:01:37 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 6b8b09350453 -r 31e7311b0a15 vmd.componentssupport/template/src/Bundle.properties
--- a/vmd.componentssupport/template/src/Bundle.properties Tue Aug 26 04:01:37 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 6b8b09350453 -r 31e7311b0a15 vmd.componentssupport/template/src/layer.xml
--- a/vmd.componentssupport/template/src/layer.xml Tue Aug 26 04:01:37 2008 +0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-
-
-
-
diff -r 6b8b09350453 -r 31e7311b0a15 vmd.componentssupport/template_netbeansorg/build.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vmd.componentssupport/template_netbeansorg/build.xml Tue Aug 26 04:05:13 2008 +0400
@@ -0,0 +1,8 @@
+
+
+
+
+
+ Builds, tests, and runs the project _CODE_NAME_.
+
+
diff -r 6b8b09350453 -r 31e7311b0a15 vmd.componentssupport/template_netbeansorg/manifest.mf
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vmd.componentssupport/template_netbeansorg/manifest.mf Tue Aug 26 04:05:13 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 6b8b09350453 -r 31e7311b0a15 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 Tue Aug 26 04:05:13 2008 +0400
@@ -0,0 +1,2 @@
+javac.source=1.5
+javac.compilerargs=-Xlint -Xlint:-serial
diff -r 6b8b09350453 -r 31e7311b0a15 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 Tue Aug 26 04:05:13 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 6b8b09350453 -r 31e7311b0a15 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 Tue Aug 26 04:05:13 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 6b8b09350453 -r 31e7311b0a15 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 Tue Aug 26 04:05:13 2008 +0400
@@ -0,0 +1,4 @@
+
+
+
+
diff -r 6b8b09350453 -r 31e7311b0a15 vmd.componentssupport/template_standalone/build.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vmd.componentssupport/template_standalone/build.xml Tue Aug 26 04:05:13 2008 +0400
@@ -0,0 +1,8 @@
+
+
+
+
+
+ Builds, tests, and runs the project _CODE_NAME_.
+
+
diff -r 6b8b09350453 -r 31e7311b0a15 vmd.componentssupport/template_standalone/manifest.mf
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vmd.componentssupport/template_standalone/manifest.mf Tue Aug 26 04:05:13 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 6b8b09350453 -r 31e7311b0a15 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 Tue Aug 26 04:05:13 2008 +0400
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r 6b8b09350453 -r 31e7311b0a15 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 Tue Aug 26 04:05:13 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 6b8b09350453 -r 31e7311b0a15 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 Tue Aug 26 04:05:13 2008 +0400
@@ -0,0 +1,1 @@
+nbplatform.active=_PLATFORM_ID_
diff -r 6b8b09350453 -r 31e7311b0a15 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 Tue Aug 26 04:05:13 2008 +0400
@@ -0,0 +1,2 @@
+javac.source=1.5
+javac.compilerargs=-Xlint -Xlint:-serial
diff -r 6b8b09350453 -r 31e7311b0a15 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 Tue Aug 26 04:05:13 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 6b8b09350453 -r 31e7311b0a15 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 Tue Aug 26 04:05:13 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 6b8b09350453 -r 31e7311b0a15 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 Tue Aug 26 04:05:13 2008 +0400
@@ -0,0 +1,4 @@
+
+
+
+
diff -r 6b8b09350453 -r 31e7311b0a15 vmd.componentssupport/template_suitecomponent/build.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vmd.componentssupport/template_suitecomponent/build.xml Tue Aug 26 04:05:13 2008 +0400
@@ -0,0 +1,8 @@
+
+
+
+
+
+ Builds, tests, and runs the project _CODE_NAME_.
+
+
diff -r 6b8b09350453 -r 31e7311b0a15 vmd.componentssupport/template_suitecomponent/manifest.mf
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/vmd.componentssupport/template_suitecomponent/manifest.mf Tue Aug 26 04:05:13 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 6b8b09350453 -r 31e7311b0a15 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 Tue Aug 26 04:05:13 2008 +0400
@@ -0,0 +1,30 @@
+
+
+
+
+
+ You must set 'suite.dir' to point to your containing module suite
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff -r 6b8b09350453 -r 31e7311b0a15 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 Tue Aug 26 04:05:13 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 6b8b09350453 -r 31e7311b0a15 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 Tue Aug 26 04:05:13 2008 +0400
@@ -0,0 +1,2 @@
+javac.source=1.5
+javac.compilerargs=-Xlint -Xlint:-serial
diff -r 6b8b09350453 -r 31e7311b0a15 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 Tue Aug 26 04:05:13 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 6b8b09350453 -r 31e7311b0a15 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 Tue Aug 26 04:05:13 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 6b8b09350453 -r 31e7311b0a15 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 Tue Aug 26 04:05:13 2008 +0400
@@ -0,0 +1,4 @@
+
+
+
+