Removing projectpackager; obsoleted by #205771.
1.1 --- a/projectpackager/build.xml Fri Dec 09 12:45:32 2011 -0500
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,45 +0,0 @@
1.4 -<?xml version="1.0" encoding="UTF-8"?>
1.5 -<!--
1.6 -DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
1.7 -
1.8 -Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
1.9 -
1.10 -
1.11 -The contents of this file are subject to the terms of either the GNU
1.12 -General Public License Version 2 only ("GPL") or the Common
1.13 -Development and Distribution License("CDDL") (collectively, the
1.14 -"License"). You may not use this file except in compliance with the
1.15 -License. You can obtain a copy of the License at
1.16 -http://www.netbeans.org/cddl-gplv2.html
1.17 -or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
1.18 -specific language governing permissions and limitations under the
1.19 -License. When distributing the software, include this License Header
1.20 -Notice in each file and include the License file at
1.21 -nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
1.22 -particular file as subject to the "Classpath" exception as provided
1.23 -by Sun in the GPL Version 2 section of the License file that
1.24 -accompanied this code. If applicable, add the following below the
1.25 -License Header, with the fields enclosed by brackets [] replaced by
1.26 -your own identifying information:
1.27 -"Portions Copyrighted [year] [name of copyright owner]"
1.28 -
1.29 -Contributor(s):
1.30 -
1.31 -The Original Software is NetBeans. The Initial Developer of the Original
1.32 -Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
1.33 -Microsystems, Inc. All Rights Reserved.
1.34 -
1.35 -If you wish your version of this file to be governed by only the CDDL
1.36 -or only the GPL Version 2, indicate your decision by adding
1.37 -"[Contributor] elects to include this software in this distribution
1.38 -under the [CDDL or GPL Version 2] license." If you do not indicate a
1.39 -single choice of license, a recipient has the option to distribute
1.40 -your version of this file under either the CDDL, the GPL Version 2 or
1.41 -to extend the choice of license to its licensees as provided above.
1.42 -However, if you add GPL Version 2 code and therefore, elected the GPL
1.43 -Version 2 license, then the option applies only if the new code is
1.44 -made subject to such option by the copyright holder.
1.45 --->
1.46 -<project name="contrib/projectpackager" default="netbeans" basedir=".">
1.47 - <import file="../../nbbuild/templates/projectized.xml"/>
1.48 -</project>
2.1 --- a/projectpackager/manifest.mf Fri Dec 09 12:45:32 2011 -0500
2.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
2.3 @@ -1,5 +0,0 @@
2.4 -Manifest-Version: 1.0
2.5 -OpenIDE-Module: org.netbeans.modules.projectpackager/1
2.6 -OpenIDE-Module-Layer: org/netbeans/modules/projectpackager/resources/layer.xml
2.7 -OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/projectpackager/resources/Bundle.properties
2.8 -OpenIDE-Module-Specification-Version: 1.6
3.1 --- a/projectpackager/nbproject/project.properties Fri Dec 09 12:45:32 2011 -0500
3.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
3.3 @@ -1,42 +0,0 @@
3.4 -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3.5 -#
3.6 -# Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
3.7 -#
3.8 -# The contents of this file are subject to the terms of either the GNU
3.9 -# General Public License Version 2 only ("GPL") or the Common
3.10 -# Development and Distribution License("CDDL") (collectively, the
3.11 -# "License"). You may not use this file except in compliance with the
3.12 -# License. You can obtain a copy of the License at
3.13 -# http://www.netbeans.org/cddl-gplv2.html
3.14 -# or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
3.15 -# specific language governing permissions and limitations under the
3.16 -# License. When distributing the software, include this License Header
3.17 -# Notice in each file and include the License file at
3.18 -# nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
3.19 -# particular file as subject to the "Classpath" exception as provided
3.20 -# by Sun in the GPL Version 2 section of the License file that
3.21 -# accompanied this code. If applicable, add the following below the
3.22 -# License Header, with the fields enclosed by brackets [] replaced by
3.23 -# your own identifying information:
3.24 -# "Portions Copyrighted [year] [name of copyright owner]"
3.25 -#
3.26 -# Contributor(s):
3.27 -#
3.28 -# The Original Software is NetBeans. The Initial Developer of the Original
3.29 -# Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
3.30 -# Microsystems, Inc. All Rights Reserved.
3.31 -#
3.32 -# If you wish your version of this file to be governed by only the CDDL
3.33 -# or only the GPL Version 2, indicate your decision by adding
3.34 -# "[Contributor] elects to include this software in this distribution
3.35 -# under the [CDDL or GPL Version 2] license." If you do not indicate a
3.36 -# single choice of license, a recipient has the option to distribute
3.37 -# your version of this file under either the CDDL, the GPL Version 2 or
3.38 -# to extend the choice of license to its licensees as provided above.
3.39 -# However, if you add GPL Version 2 code and therefore, elected the GPL
3.40 -# Version 2 license, then the option applies only if the new code is
3.41 -# made subject to such option by the copyright holder.
3.42 -
3.43 -javac.compilerargs=-Xlint -Xlint:-serial -Xlint -Xlint:-serial
3.44 -javac.source=1.6
3.45 -nbm.module.author=Roman Strobl
4.1 --- a/projectpackager/nbproject/project.xml Fri Dec 09 12:45:32 2011 -0500
4.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
4.3 @@ -1,170 +0,0 @@
4.4 -<?xml version="1.0" encoding="UTF-8"?>
4.5 -<!--
4.6 -DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
4.7 -
4.8 -Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
4.9 -
4.10 -
4.11 -The contents of this file are subject to the terms of either the GNU
4.12 -General Public License Version 2 only ("GPL") or the Common
4.13 -Development and Distribution License("CDDL") (collectively, the
4.14 -"License"). You may not use this file except in compliance with the
4.15 -License. You can obtain a copy of the License at
4.16 -http://www.netbeans.org/cddl-gplv2.html
4.17 -or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
4.18 -specific language governing permissions and limitations under the
4.19 -License. When distributing the software, include this License Header
4.20 -Notice in each file and include the License file at
4.21 -nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
4.22 -particular file as subject to the "Classpath" exception as provided
4.23 -by Sun in the GPL Version 2 section of the License file that
4.24 -accompanied this code. If applicable, add the following below the
4.25 -License Header, with the fields enclosed by brackets [] replaced by
4.26 -your own identifying information:
4.27 -"Portions Copyrighted [year] [name of copyright owner]"
4.28 -
4.29 -Contributor(s):
4.30 -
4.31 -The Original Software is NetBeans. The Initial Developer of the Original
4.32 -Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
4.33 -Microsystems, Inc. All Rights Reserved.
4.34 -
4.35 -If you wish your version of this file to be governed by only the CDDL
4.36 -or only the GPL Version 2, indicate your decision by adding
4.37 -"[Contributor] elects to include this software in this distribution
4.38 -under the [CDDL or GPL Version 2] license." If you do not indicate a
4.39 -single choice of license, a recipient has the option to distribute
4.40 -your version of this file under either the CDDL, the GPL Version 2 or
4.41 -to extend the choice of license to its licensees as provided above.
4.42 -However, if you add GPL Version 2 code and therefore, elected the GPL
4.43 -Version 2 license, then the option applies only if the new code is
4.44 -made subject to such option by the copyright holder.
4.45 --->
4.46 -<project xmlns="http://www.netbeans.org/ns/project/1">
4.47 - <type>org.netbeans.modules.apisupport.project</type>
4.48 - <configuration>
4.49 - <data xmlns="http://www.netbeans.org/ns/nb-module-project/2">
4.50 - <code-name-base>org.netbeans.modules.projectpackager</code-name-base>
4.51 - <module-dependencies>
4.52 - <dependency>
4.53 - <code-name-base>org.apache.tools.ant.module</code-name-base>
4.54 - <build-prerequisite/>
4.55 - <compile-dependency/>
4.56 - <run-dependency>
4.57 - <release-version>3</release-version>
4.58 - <specification-version>3.26</specification-version>
4.59 - </run-dependency>
4.60 - </dependency>
4.61 - <dependency>
4.62 - <code-name-base>org.jdesktop.layout</code-name-base>
4.63 - <build-prerequisite/>
4.64 - <compile-dependency/>
4.65 - <run-dependency>
4.66 - <release-version>1</release-version>
4.67 - <specification-version>1.1</specification-version>
4.68 - </run-dependency>
4.69 - </dependency>
4.70 - <dependency>
4.71 - <code-name-base>org.netbeans.api.progress</code-name-base>
4.72 - <build-prerequisite/>
4.73 - <compile-dependency/>
4.74 - <run-dependency>
4.75 - <release-version>1</release-version>
4.76 - <specification-version>1.0</specification-version>
4.77 - </run-dependency>
4.78 - </dependency>
4.79 - <dependency>
4.80 - <code-name-base>org.netbeans.modules.keyring</code-name-base>
4.81 - <build-prerequisite/>
4.82 - <compile-dependency/>
4.83 - <run-dependency>
4.84 - <specification-version>1.7</specification-version>
4.85 - </run-dependency>
4.86 - </dependency>
4.87 - <dependency>
4.88 - <code-name-base>org.netbeans.modules.projectapi</code-name-base>
4.89 - <build-prerequisite/>
4.90 - <compile-dependency/>
4.91 - <run-dependency>
4.92 - <release-version>1</release-version>
4.93 - <specification-version>1.6</specification-version>
4.94 - </run-dependency>
4.95 - </dependency>
4.96 - <dependency>
4.97 - <code-name-base>org.netbeans.modules.projectuiapi</code-name-base>
4.98 - <build-prerequisite/>
4.99 - <compile-dependency/>
4.100 - <run-dependency>
4.101 - <release-version>1</release-version>
4.102 - <specification-version>1.8.0.5</specification-version>
4.103 - </run-dependency>
4.104 - </dependency>
4.105 - <dependency>
4.106 - <code-name-base>org.netbeans.modules.queries</code-name-base>
4.107 - <build-prerequisite/>
4.108 - <compile-dependency/>
4.109 - <run-dependency>
4.110 - <release-version>1</release-version>
4.111 - <specification-version>1.5</specification-version>
4.112 - </run-dependency>
4.113 - </dependency>
4.114 - <dependency>
4.115 - <code-name-base>org.netbeans.modules.websvc.jaxrpc16</code-name-base>
4.116 - <run-dependency>
4.117 - <release-version>1</release-version>
4.118 - <specification-version>1.6</specification-version>
4.119 - </run-dependency>
4.120 - </dependency>
4.121 - <dependency>
4.122 - <code-name-base>org.openide.awt</code-name-base>
4.123 - <build-prerequisite/>
4.124 - <compile-dependency/>
4.125 - <run-dependency>
4.126 - <specification-version>7.29</specification-version>
4.127 - </run-dependency>
4.128 - </dependency>
4.129 - <dependency>
4.130 - <code-name-base>org.openide.dialogs</code-name-base>
4.131 - <build-prerequisite/>
4.132 - <compile-dependency/>
4.133 - <run-dependency>
4.134 - <specification-version>6.2</specification-version>
4.135 - </run-dependency>
4.136 - </dependency>
4.137 - <dependency>
4.138 - <code-name-base>org.openide.execution</code-name-base>
4.139 - <build-prerequisite/>
4.140 - <compile-dependency/>
4.141 - <run-dependency>
4.142 - <specification-version>1.6</specification-version>
4.143 - </run-dependency>
4.144 - </dependency>
4.145 - <dependency>
4.146 - <code-name-base>org.openide.filesystems</code-name-base>
4.147 - <build-prerequisite/>
4.148 - <compile-dependency/>
4.149 - <run-dependency>
4.150 - <specification-version>7.19</specification-version>
4.151 - </run-dependency>
4.152 - </dependency>
4.153 - <dependency>
4.154 - <code-name-base>org.openide.util</code-name-base>
4.155 - <build-prerequisite/>
4.156 - <compile-dependency/>
4.157 - <run-dependency>
4.158 - <specification-version>8.0</specification-version>
4.159 - </run-dependency>
4.160 - </dependency>
4.161 - <dependency>
4.162 - <code-name-base>org.openide.util.lookup</code-name-base>
4.163 - <build-prerequisite/>
4.164 - <compile-dependency/>
4.165 - <run-dependency>
4.166 - <specification-version>8.0</specification-version>
4.167 - </run-dependency>
4.168 - </dependency>
4.169 - </module-dependencies>
4.170 - <public-packages/>
4.171 - </data>
4.172 - </configuration>
4.173 -</project>
5.1 --- a/projectpackager/src/org/netbeans/modules/projectpackager/exporter/Bundle.properties Fri Dec 09 12:45:32 2011 -0500
5.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
5.3 @@ -1,40 +0,0 @@
5.4 -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
5.5 -#
5.6 -# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
5.7 -#
5.8 -# The contents of this file are subject to the terms of either the GNU
5.9 -# General Public License Version 2 only ("GPL") or the Common
5.10 -# Development and Distribution License("CDDL") (collectively, the
5.11 -# "License"). You may not use this file except in compliance with the
5.12 -# License. You can obtain a copy of the License at
5.13 -# http://www.netbeans.org/cddl-gplv2.html
5.14 -# or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
5.15 -# specific language governing permissions and limitations under the
5.16 -# License. When distributing the software, include this License Header
5.17 -# Notice in each file and include the License file at
5.18 -# nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
5.19 -# particular file as subject to the "Classpath" exception as provided
5.20 -# by Sun in the GPL Version 2 section of the License file that
5.21 -# accompanied this code. If applicable, add the following below the
5.22 -# License Header, with the fields enclosed by brackets [] replaced by
5.23 -# your own identifying information:
5.24 -# "Portions Copyrighted [year] [name of copyright owner]"
5.25 -#
5.26 -# If you wish your version of this file to be governed by only the CDDL
5.27 -# or only the GPL Version 2, indicate your decision by adding
5.28 -# "[Contributor] elects to include this software in this distribution
5.29 -# under the [CDDL or GPL Version 2] license." If you do not indicate a
5.30 -# single choice of license, a recipient has the option to distribute
5.31 -# your version of this file under either the CDDL, the GPL Version 2 or
5.32 -# to extend the choice of license to its licensees as provided above.
5.33 -# However, if you add GPL Version 2 code and therefore, elected the GPL
5.34 -# Version 2 license, then the option applies only if the new code is
5.35 -# made subject to such option by the copyright holder.
5.36 -#
5.37 -# Contributor(s):
5.38 -#
5.39 -# Portions Copyrighted 2008 Sun Microsystems, Inc.
5.40 -
5.41 -SMTP_Mail_From=E-mail From:
5.42 -SMTP_Mail_Subject=E-mail Subject:
5.43 -SMTP_Mail_Body=E-mail Body:
6.1 --- a/projectpackager/src/org/netbeans/modules/projectpackager/exporter/EmailSettingsDialog.form Fri Dec 09 12:45:32 2011 -0500
6.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
6.3 @@ -1,239 +0,0 @@
6.4 -<?xml version="1.0" encoding="UTF-8" ?>
6.5 -
6.6 -<Form version="1.3" maxVersion="1.3" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
6.7 - <NonVisualComponents>
6.8 - <Component class="javax.swing.JLabel" name="jLabel3">
6.9 - <Properties>
6.10 - <Property name="text" type="java.lang.String" value="jLabel3"/>
6.11 - </Properties>
6.12 - </Component>
6.13 - <Container class="javax.swing.JScrollPane" name="jScrollPane1">
6.14 - <AuxValues>
6.15 - <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
6.16 - </AuxValues>
6.17 -
6.18 - <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
6.19 - <SubComponents>
6.20 - <Component class="javax.swing.JTextArea" name="jTextArea1">
6.21 - <Properties>
6.22 - <Property name="columns" type="int" value="20"/>
6.23 - <Property name="rows" type="int" value="5"/>
6.24 - </Properties>
6.25 - </Component>
6.26 - </SubComponents>
6.27 - </Container>
6.28 - </NonVisualComponents>
6.29 - <Properties>
6.30 - <Property name="defaultCloseOperation" type="int" value="2"/>
6.31 - <Property name="title" type="java.lang.String" value="E-mail Settings"/>
6.32 - <Property name="resizable" type="boolean" value="false"/>
6.33 - </Properties>
6.34 - <SyntheticProperties>
6.35 - <SyntheticProperty name="formSizePolicy" type="int" value="1"/>
6.36 - </SyntheticProperties>
6.37 - <AuxValues>
6.38 - <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
6.39 - <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
6.40 - <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
6.41 - <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
6.42 - <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
6.43 - <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="2"/>
6.44 - <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
6.45 - <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
6.46 - <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
6.47 - </AuxValues>
6.48 -
6.49 - <Layout>
6.50 - <DimensionLayout dim="0">
6.51 - <Group type="103" groupAlignment="0" attributes="0">
6.52 - <Group type="102" attributes="0">
6.53 - <EmptySpace max="-2" attributes="0"/>
6.54 - <Group type="103" groupAlignment="0" attributes="0">
6.55 - <Component id="useSSL" alignment="0" min="-2" max="-2" attributes="0"/>
6.56 - <Component id="jLabel6" alignment="0" min="-2" max="-2" attributes="0"/>
6.57 - <Group type="102" alignment="1" attributes="0">
6.58 - <Group type="103" groupAlignment="0" attributes="0">
6.59 - <Component id="smtpServer" alignment="0" min="-2" max="-2" attributes="0"/>
6.60 - <Component id="smtpUsername" alignment="0" min="-2" max="-2" attributes="0"/>
6.61 - <Component id="smtpPassword" alignment="0" min="-2" max="-2" attributes="0"/>
6.62 - </Group>
6.63 - <EmptySpace pref="13" max="32767" attributes="0"/>
6.64 - <Group type="103" groupAlignment="0" max="-2" attributes="0">
6.65 - <Component id="smtpServerField" alignment="1" max="32767" attributes="1"/>
6.66 - <Group type="102" alignment="1" attributes="0">
6.67 - <Group type="103" groupAlignment="1" attributes="0">
6.68 - <Component id="smtpPasswordField" alignment="1" min="-2" pref="178" max="-2" attributes="1"/>
6.69 - <Component id="smtpUsernameField" alignment="1" min="-2" max="32767" attributes="1"/>
6.70 - </Group>
6.71 - <EmptySpace min="-2" pref="87" max="-2" attributes="0"/>
6.72 - </Group>
6.73 - </Group>
6.74 - </Group>
6.75 - <Group type="102" alignment="0" attributes="0">
6.76 - <Group type="103" groupAlignment="0" attributes="0">
6.77 - <Component id="mailSubjectLabel" alignment="0" min="-2" max="-2" attributes="0"/>
6.78 - <Component id="mailBodyLabel" alignment="0" min="-2" max="-2" attributes="0"/>
6.79 - <Component id="mailFromLabel" alignment="0" min="-2" max="-2" attributes="0"/>
6.80 - </Group>
6.81 - <EmptySpace max="-2" attributes="0"/>
6.82 - <Group type="103" groupAlignment="0" attributes="0">
6.83 - <Component id="mailFromField" alignment="0" pref="274" max="32767" attributes="0"/>
6.84 - <Component id="mailBodyField" pref="274" max="32767" attributes="0"/>
6.85 - <Component id="mailSubjectField" alignment="0" pref="274" max="32767" attributes="0"/>
6.86 - </Group>
6.87 - </Group>
6.88 - <Group type="102" alignment="1" attributes="0">
6.89 - <Component id="okButton" min="-2" pref="63" max="-2" attributes="0"/>
6.90 - <EmptySpace max="-2" attributes="0"/>
6.91 - <Component id="cancelButton" min="-2" max="-2" attributes="0"/>
6.92 - </Group>
6.93 - </Group>
6.94 - <EmptySpace max="-2" attributes="0"/>
6.95 - </Group>
6.96 - </Group>
6.97 - </DimensionLayout>
6.98 - <DimensionLayout dim="1">
6.99 - <Group type="103" groupAlignment="0" attributes="0">
6.100 - <Group type="102" attributes="0">
6.101 - <EmptySpace max="32767" attributes="0"/>
6.102 - <Group type="103" groupAlignment="3" attributes="0">
6.103 - <Component id="smtpServer" alignment="3" min="-2" max="-2" attributes="0"/>
6.104 - <Component id="smtpServerField" alignment="3" min="-2" max="-2" attributes="0"/>
6.105 - </Group>
6.106 - <EmptySpace max="-2" attributes="0"/>
6.107 - <Group type="103" groupAlignment="3" attributes="0">
6.108 - <Component id="smtpUsername" alignment="3" min="-2" max="-2" attributes="0"/>
6.109 - <Component id="smtpUsernameField" alignment="3" min="-2" max="-2" attributes="0"/>
6.110 - </Group>
6.111 - <EmptySpace max="-2" attributes="0"/>
6.112 - <Group type="103" groupAlignment="0" attributes="0">
6.113 - <Component id="smtpPassword" min="-2" max="-2" attributes="0"/>
6.114 - <Component id="smtpPasswordField" min="-2" max="-2" attributes="0"/>
6.115 - </Group>
6.116 - <EmptySpace max="-2" attributes="0"/>
6.117 - <Component id="useSSL" min="-2" max="-2" attributes="0"/>
6.118 - <EmptySpace max="-2" attributes="0"/>
6.119 - <Component id="jLabel6" min="-2" max="-2" attributes="0"/>
6.120 - <EmptySpace min="-2" pref="50" max="-2" attributes="0"/>
6.121 - <Group type="103" groupAlignment="3" attributes="0">
6.122 - <Component id="mailFromLabel" alignment="3" min="-2" max="-2" attributes="0"/>
6.123 - <Component id="mailFromField" alignment="3" min="-2" max="-2" attributes="0"/>
6.124 - </Group>
6.125 - <EmptySpace max="-2" attributes="0"/>
6.126 - <Group type="103" groupAlignment="3" attributes="0">
6.127 - <Component id="mailSubjectLabel" alignment="3" min="-2" max="-2" attributes="0"/>
6.128 - <Component id="mailSubjectField" alignment="3" min="-2" max="-2" attributes="0"/>
6.129 - </Group>
6.130 - <EmptySpace max="-2" attributes="0"/>
6.131 - <Group type="103" groupAlignment="3" attributes="0">
6.132 - <Component id="mailBodyLabel" alignment="3" min="-2" max="-2" attributes="0"/>
6.133 - <Component id="mailBodyField" alignment="3" min="-2" max="-2" attributes="0"/>
6.134 - </Group>
6.135 - <EmptySpace type="separate" max="-2" attributes="0"/>
6.136 - <Group type="103" groupAlignment="3" attributes="0">
6.137 - <Component id="okButton" alignment="3" min="-2" max="-2" attributes="0"/>
6.138 - <Component id="cancelButton" alignment="3" min="-2" max="-2" attributes="0"/>
6.139 - </Group>
6.140 - </Group>
6.141 - </Group>
6.142 - </DimensionLayout>
6.143 - </Layout>
6.144 - <SubComponents>
6.145 - <Component class="javax.swing.JButton" name="cancelButton">
6.146 - <Properties>
6.147 - <Property name="text" type="java.lang.String" value="Cancel"/>
6.148 - </Properties>
6.149 - <Events>
6.150 - <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cancelButtonActionPerformed"/>
6.151 - </Events>
6.152 - </Component>
6.153 - <Component class="javax.swing.JButton" name="okButton">
6.154 - <Properties>
6.155 - <Property name="text" type="java.lang.String" value="OK"/>
6.156 - </Properties>
6.157 - <Events>
6.158 - <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="okButtonActionPerformed"/>
6.159 - </Events>
6.160 - </Component>
6.161 - <Component class="javax.swing.JLabel" name="smtpServer">
6.162 - <Properties>
6.163 - <Property name="text" type="java.lang.String" value="SMTP Server:"/>
6.164 - </Properties>
6.165 - </Component>
6.166 - <Component class="javax.swing.JTextField" name="smtpServerField">
6.167 - </Component>
6.168 - <Component class="javax.swing.JLabel" name="smtpUsername">
6.169 - <Properties>
6.170 - <Property name="text" type="java.lang.String" value="SMTP Username:"/>
6.171 - </Properties>
6.172 - </Component>
6.173 - <Component class="javax.swing.JTextField" name="smtpUsernameField">
6.174 - </Component>
6.175 - <Component class="javax.swing.JLabel" name="smtpPassword">
6.176 - <Properties>
6.177 - <Property name="text" type="java.lang.String" value="SMTP Password:"/>
6.178 - </Properties>
6.179 - </Component>
6.180 - <Component class="javax.swing.JCheckBox" name="useSSL">
6.181 - <Properties>
6.182 - <Property name="text" type="java.lang.String" value="Use SSL for SMTP"/>
6.183 - <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
6.184 - <Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
6.185 - <EmptyBorder bottom="0" left="0" right="0" top="0"/>
6.186 - </Border>
6.187 - </Property>
6.188 - <Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
6.189 - <Insets value="[0, 0, 0, 0]"/>
6.190 - </Property>
6.191 - </Properties>
6.192 - </Component>
6.193 - <Component class="javax.swing.JLabel" name="jLabel6">
6.194 - <Properties>
6.195 - <Property name="text" type="java.lang.String" value="SMTP server is required, username and password is optional."/>
6.196 - </Properties>
6.197 - </Component>
6.198 - <Component class="javax.swing.JPasswordField" name="smtpPasswordField">
6.199 - <Properties>
6.200 - <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
6.201 - <Dimension value="[11, 18]"/>
6.202 - </Property>
6.203 - </Properties>
6.204 - </Component>
6.205 - <Component class="javax.swing.JLabel" name="mailFromLabel">
6.206 - <Properties>
6.207 - <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
6.208 - <ComponentRef name="mailFromField"/>
6.209 - </Property>
6.210 - <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
6.211 - <ResourceString bundle="org/netbeans/modules/projectpackager/resources/Bundle.properties" key="SMTP_Mail_From" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
6.212 - </Property>
6.213 - </Properties>
6.214 - </Component>
6.215 - <Component class="javax.swing.JTextField" name="mailFromField">
6.216 - </Component>
6.217 - <Component class="javax.swing.JLabel" name="mailSubjectLabel">
6.218 - <Properties>
6.219 - <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
6.220 - <ComponentRef name="mailSubjectField"/>
6.221 - </Property>
6.222 - <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
6.223 - <ResourceString bundle="org/netbeans/modules/projectpackager/resources/Bundle.properties" key="SMTP_Mail_Subject" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
6.224 - </Property>
6.225 - </Properties>
6.226 - </Component>
6.227 - <Component class="javax.swing.JTextField" name="mailSubjectField">
6.228 - </Component>
6.229 - <Component class="javax.swing.JLabel" name="mailBodyLabel">
6.230 - <Properties>
6.231 - <Property name="labelFor" type="java.awt.Component" editor="org.netbeans.modules.form.ComponentChooserEditor">
6.232 - <ComponentRef name="mailBodyField"/>
6.233 - </Property>
6.234 - <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
6.235 - <ResourceString bundle="org/netbeans/modules/projectpackager/resources/Bundle.properties" key="SMTP_Mail_Body" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
6.236 - </Property>
6.237 - </Properties>
6.238 - </Component>
6.239 - <Component class="javax.swing.JTextField" name="mailBodyField">
6.240 - </Component>
6.241 - </SubComponents>
6.242 -</Form>
7.1 --- a/projectpackager/src/org/netbeans/modules/projectpackager/exporter/EmailSettingsDialog.java Fri Dec 09 12:45:32 2011 -0500
7.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
7.3 @@ -1,294 +0,0 @@
7.4 -/*
7.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
7.6 - *
7.7 - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
7.8 - *
7.9 - * The contents of this file are subject to the terms of either the GNU
7.10 - * General Public License Version 2 only ("GPL") or the Common
7.11 - * Development and Distribution License("CDDL") (collectively, the
7.12 - * "License"). You may not use this file except in compliance with the
7.13 - * License. You can obtain a copy of the License at
7.14 - * http://www.netbeans.org/cddl-gplv2.html
7.15 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
7.16 - * specific language governing permissions and limitations under the
7.17 - * License. When distributing the software, include this License Header
7.18 - * Notice in each file and include the License file at
7.19 - * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
7.20 - * particular file as subject to the "Classpath" exception as provided
7.21 - * by Sun in the GPL Version 2 section of the License file that
7.22 - * accompanied this code. If applicable, add the following below the
7.23 - * License Header, with the fields enclosed by brackets [] replaced by
7.24 - * your own identifying information:
7.25 - * "Portions Copyrighted [year] [name of copyright owner]"
7.26 - *
7.27 - * Contributor(s):
7.28 - *
7.29 - * The Original Software is NetBeans. The Initial Developer of the Original
7.30 - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
7.31 - * Microsystems, Inc. All Rights Reserved.
7.32 - *
7.33 - * If you wish your version of this file to be governed by only the CDDL
7.34 - * or only the GPL Version 2, indicate your decision by adding
7.35 - * "[Contributor] elects to include this software in this distribution
7.36 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
7.37 - * single choice of license, a recipient has the option to distribute
7.38 - * your version of this file under either the CDDL, the GPL Version 2 or
7.39 - * to extend the choice of license to its licensees as provided above.
7.40 - * However, if you add GPL Version 2 code and therefore, elected the GPL
7.41 - * Version 2 license, then the option applies only if the new code is
7.42 - * made subject to such option by the copyright holder.
7.43 - */
7.44 -
7.45 -package org.netbeans.modules.projectpackager.exporter;
7.46 -
7.47 -import org.netbeans.modules.projectpackager.tools.ProjectPackagerSettings;
7.48 -
7.49 -/**
7.50 - * E-mail settings dialog
7.51 - * @author Roman "Roumen" Strobl
7.52 - */
7.53 -public class EmailSettingsDialog extends javax.swing.JFrame {
7.54 -
7.55 - /**
7.56 - * Constructor of the dialog
7.57 - */
7.58 - public EmailSettingsDialog() {
7.59 - // XXX use of JFrame is totally wrong; should use DialogDescriptor instead
7.60 - initComponents();
7.61 - setLocationRelativeTo(null);
7.62 - EmailSettingsUITools.setEmailSettingsDialog(this);
7.63 - smtpServerField.setText(ProjectPackagerSettings.getSmtpServer());
7.64 - smtpUsernameField.setText(ProjectPackagerSettings.getSmtpUsername());
7.65 - smtpPasswordField.setText(ProjectPackagerSettings.getSmtpPassword());
7.66 - useSSL.setSelected(ProjectPackagerSettings.getSmtpUseSSL());
7.67 - mailFromField.setText(ProjectPackagerSettings.getMailFrom());
7.68 - mailSubjectField.setText(ProjectPackagerSettings.getMailSubject());
7.69 - mailBodyField.setText(ProjectPackagerSettings.getMailBody());
7.70 - }
7.71 -
7.72 - /** This method is called from within the constructor to
7.73 - * initialize the form.
7.74 - * WARNING: Do NOT modify this code. The content of this method is
7.75 - * always regenerated by the Form Editor.
7.76 - */
7.77 - // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
7.78 - private void initComponents() {
7.79 -
7.80 - jLabel3 = new javax.swing.JLabel();
7.81 - jScrollPane1 = new javax.swing.JScrollPane();
7.82 - jTextArea1 = new javax.swing.JTextArea();
7.83 - cancelButton = new javax.swing.JButton();
7.84 - okButton = new javax.swing.JButton();
7.85 - smtpServer = new javax.swing.JLabel();
7.86 - smtpServerField = new javax.swing.JTextField();
7.87 - smtpUsername = new javax.swing.JLabel();
7.88 - smtpUsernameField = new javax.swing.JTextField();
7.89 - smtpPassword = new javax.swing.JLabel();
7.90 - useSSL = new javax.swing.JCheckBox();
7.91 - jLabel6 = new javax.swing.JLabel();
7.92 - smtpPasswordField = new javax.swing.JPasswordField();
7.93 - mailFromLabel = new javax.swing.JLabel();
7.94 - mailFromField = new javax.swing.JTextField();
7.95 - mailSubjectLabel = new javax.swing.JLabel();
7.96 - mailSubjectField = new javax.swing.JTextField();
7.97 - mailBodyLabel = new javax.swing.JLabel();
7.98 - mailBodyField = new javax.swing.JTextField();
7.99 -
7.100 - jLabel3.setText("jLabel3");
7.101 -
7.102 - jTextArea1.setColumns(20);
7.103 - jTextArea1.setRows(5);
7.104 - jScrollPane1.setViewportView(jTextArea1);
7.105 -
7.106 - setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
7.107 - setTitle("E-mail Settings");
7.108 - setResizable(false);
7.109 -
7.110 - cancelButton.setText("Cancel");
7.111 - cancelButton.addActionListener(new java.awt.event.ActionListener() {
7.112 - public void actionPerformed(java.awt.event.ActionEvent evt) {
7.113 - cancelButtonActionPerformed(evt);
7.114 - }
7.115 - });
7.116 -
7.117 - okButton.setText("OK");
7.118 - okButton.addActionListener(new java.awt.event.ActionListener() {
7.119 - public void actionPerformed(java.awt.event.ActionEvent evt) {
7.120 - okButtonActionPerformed(evt);
7.121 - }
7.122 - });
7.123 -
7.124 - smtpServer.setText("SMTP Server:");
7.125 -
7.126 - smtpUsername.setText("SMTP Username:");
7.127 -
7.128 - smtpPassword.setText("SMTP Password:");
7.129 -
7.130 - useSSL.setText("Use SSL for SMTP");
7.131 - useSSL.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
7.132 - useSSL.setMargin(new java.awt.Insets(0, 0, 0, 0));
7.133 -
7.134 - jLabel6.setText("SMTP server is required, username and password is optional.");
7.135 -
7.136 - smtpPasswordField.setPreferredSize(new java.awt.Dimension(11, 18));
7.137 -
7.138 - mailFromLabel.setLabelFor(mailFromField);
7.139 - mailFromLabel.setText(org.openide.util.NbBundle.getMessage(EmailSettingsDialog.class, "SMTP_Mail_From")); // NOI18N
7.140 -
7.141 - mailSubjectLabel.setLabelFor(mailSubjectField);
7.142 - mailSubjectLabel.setText(org.openide.util.NbBundle.getMessage(EmailSettingsDialog.class, "SMTP_Mail_Subject")); // NOI18N
7.143 -
7.144 - mailBodyLabel.setLabelFor(mailBodyField);
7.145 - mailBodyLabel.setText(org.openide.util.NbBundle.getMessage(EmailSettingsDialog.class, "SMTP_Mail_Body")); // NOI18N
7.146 -
7.147 - org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
7.148 - getContentPane().setLayout(layout);
7.149 - layout.setHorizontalGroup(
7.150 - layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
7.151 - .add(layout.createSequentialGroup()
7.152 - .addContainerGap()
7.153 - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
7.154 - .add(useSSL)
7.155 - .add(jLabel6)
7.156 - .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
7.157 - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
7.158 - .add(smtpServer)
7.159 - .add(smtpUsername)
7.160 - .add(smtpPassword))
7.161 - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 13, Short.MAX_VALUE)
7.162 - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
7.163 - .add(org.jdesktop.layout.GroupLayout.TRAILING, smtpServerField)
7.164 - .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
7.165 - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
7.166 - .add(smtpPasswordField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 178, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
7.167 - .add(smtpUsernameField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
7.168 - .add(87, 87, 87))))
7.169 - .add(layout.createSequentialGroup()
7.170 - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
7.171 - .add(mailSubjectLabel)
7.172 - .add(mailBodyLabel)
7.173 - .add(mailFromLabel))
7.174 - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
7.175 - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
7.176 - .add(mailFromField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 274, Short.MAX_VALUE)
7.177 - .add(mailBodyField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 274, Short.MAX_VALUE)
7.178 - .add(mailSubjectField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 274, Short.MAX_VALUE)))
7.179 - .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
7.180 - .add(okButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 63, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
7.181 - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
7.182 - .add(cancelButton)))
7.183 - .addContainerGap())
7.184 - );
7.185 - layout.setVerticalGroup(
7.186 - layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
7.187 - .add(layout.createSequentialGroup()
7.188 - .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
7.189 - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
7.190 - .add(smtpServer)
7.191 - .add(smtpServerField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
7.192 - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
7.193 - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
7.194 - .add(smtpUsername)
7.195 - .add(smtpUsernameField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
7.196 - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
7.197 - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
7.198 - .add(smtpPassword)
7.199 - .add(smtpPasswordField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
7.200 - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
7.201 - .add(useSSL)
7.202 - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
7.203 - .add(jLabel6)
7.204 - .add(50, 50, 50)
7.205 - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
7.206 - .add(mailFromLabel)
7.207 - .add(mailFromField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
7.208 - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
7.209 - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
7.210 - .add(mailSubjectLabel)
7.211 - .add(mailSubjectField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
7.212 - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
7.213 - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
7.214 - .add(mailBodyLabel)
7.215 - .add(mailBodyField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
7.216 - .add(18, 18, 18)
7.217 - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
7.218 - .add(okButton)
7.219 - .add(cancelButton)))
7.220 - );
7.221 -
7.222 - pack();
7.223 - }// </editor-fold>//GEN-END:initComponents
7.224 -
7.225 - private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okButtonActionPerformed
7.226 - EmailSettingsUITools.processOkButton();//GEN-LAST:event_okButtonActionPerformed
7.227 - }
7.228 -
7.229 - private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed
7.230 - EmailSettingsUITools.processCancelButton();//GEN-LAST:event_cancelButtonActionPerformed
7.231 - }
7.232 -
7.233 - /**
7.234 - * Returns filled in SMTP server
7.235 - * @return SMTP server
7.236 - */
7.237 - public String getSmtpServer() {
7.238 - return smtpServerField.getText();
7.239 - }
7.240 -
7.241 - /**
7.242 - * Returns filled in SMTP username
7.243 - * @return SMTP username
7.244 - */
7.245 - public String getSmtpUsername() {
7.246 - return smtpUsernameField.getText();
7.247 - }
7.248 -
7.249 - /**
7.250 - * Returns filled in SMTP password
7.251 - * @return SMTP password
7.252 - */
7.253 - public String getSmtpPassword() {
7.254 - return new String(smtpPasswordField.getPassword());
7.255 - }
7.256 -
7.257 - /**
7.258 - * Returns filled in Use SSL
7.259 - * @return Use SSL
7.260 - */
7.261 - public boolean getSmtpUseSSL() {
7.262 - return useSSL.isSelected();
7.263 - }
7.264 -
7.265 - public String getMailFrom() {
7.266 - return mailFromField.getText();
7.267 - }
7.268 - public String getMailSubject() {
7.269 - return mailSubjectField.getText();
7.270 - }
7.271 - public String getMailBody() {
7.272 - return mailBodyField.getText();
7.273 - }
7.274 -
7.275 - // Variables declaration - do not modify//GEN-BEGIN:variables
7.276 - private javax.swing.JButton cancelButton;
7.277 - private javax.swing.JLabel jLabel3;
7.278 - private javax.swing.JLabel jLabel6;
7.279 - private javax.swing.JScrollPane jScrollPane1;
7.280 - private javax.swing.JTextArea jTextArea1;
7.281 - private javax.swing.JTextField mailBodyField;
7.282 - private javax.swing.JLabel mailBodyLabel;
7.283 - private javax.swing.JTextField mailFromField;
7.284 - private javax.swing.JLabel mailFromLabel;
7.285 - private javax.swing.JTextField mailSubjectField;
7.286 - private javax.swing.JLabel mailSubjectLabel;
7.287 - private javax.swing.JButton okButton;
7.288 - private javax.swing.JLabel smtpPassword;
7.289 - private javax.swing.JPasswordField smtpPasswordField;
7.290 - private javax.swing.JLabel smtpServer;
7.291 - private javax.swing.JTextField smtpServerField;
7.292 - private javax.swing.JLabel smtpUsername;
7.293 - private javax.swing.JTextField smtpUsernameField;
7.294 - private javax.swing.JCheckBox useSSL;
7.295 - // End of variables declaration//GEN-END:variables
7.296 -
7.297 -}
8.1 --- a/projectpackager/src/org/netbeans/modules/projectpackager/exporter/EmailSettingsUITools.java Fri Dec 09 12:45:32 2011 -0500
8.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
8.3 @@ -1,91 +0,0 @@
8.4 -/*
8.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
8.6 - *
8.7 - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
8.8 - *
8.9 - * The contents of this file are subject to the terms of either the GNU
8.10 - * General Public License Version 2 only ("GPL") or the Common
8.11 - * Development and Distribution License("CDDL") (collectively, the
8.12 - * "License"). You may not use this file except in compliance with the
8.13 - * License. You can obtain a copy of the License at
8.14 - * http://www.netbeans.org/cddl-gplv2.html
8.15 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
8.16 - * specific language governing permissions and limitations under the
8.17 - * License. When distributing the software, include this License Header
8.18 - * Notice in each file and include the License file at
8.19 - * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
8.20 - * particular file as subject to the "Classpath" exception as provided
8.21 - * by Sun in the GPL Version 2 section of the License file that
8.22 - * accompanied this code. If applicable, add the following below the
8.23 - * License Header, with the fields enclosed by brackets [] replaced by
8.24 - * your own identifying information:
8.25 - * "Portions Copyrighted [year] [name of copyright owner]"
8.26 - *
8.27 - * Contributor(s):
8.28 - *
8.29 - * The Original Software is NetBeans. The Initial Developer of the Original
8.30 - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
8.31 - * Microsystems, Inc. All Rights Reserved.
8.32 - *
8.33 - * If you wish your version of this file to be governed by only the CDDL
8.34 - * or only the GPL Version 2, indicate your decision by adding
8.35 - * "[Contributor] elects to include this software in this distribution
8.36 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
8.37 - * single choice of license, a recipient has the option to distribute
8.38 - * your version of this file under either the CDDL, the GPL Version 2 or
8.39 - * to extend the choice of license to its licensees as provided above.
8.40 - * However, if you add GPL Version 2 code and therefore, elected the GPL
8.41 - * Version 2 license, then the option applies only if the new code is
8.42 - * made subject to such option by the copyright holder.
8.43 - */
8.44 -
8.45 -package org.netbeans.modules.projectpackager.exporter;
8.46 -
8.47 -import org.netbeans.modules.projectpackager.tools.ProjectPackagerSettings;
8.48 -
8.49 -/**
8.50 - * Tools used together with the E-mail settings dialog
8.51 - * @author Roman "Roumen" Strobl
8.52 - */
8.53 -public class EmailSettingsUITools {
8.54 - private static EmailSettingsDialog esd;
8.55 -
8.56 - private EmailSettingsUITools() {
8.57 - }
8.58 -
8.59 - /**
8.60 - * To send a reference to E-mail settings dialog
8.61 - * @param aesd e-mail settings dialog
8.62 - */
8.63 - public static void setEmailSettingsDialog(EmailSettingsDialog aesd) {
8.64 -esd = aesd;
8.65 - }
8.66 -
8.67 - /**
8.68 - * Processes the Cancel button - calls dispose
8.69 - */
8.70 - public static void processCancelButton() {
8.71 - esd.dispose();
8.72 - }
8.73 -
8.74 - /**
8.75 - * Processes the Ok button - saves the settings
8.76 - */
8.77 - public static void processOkButton() {
8.78 - ExportPackageInfo.setSmtpServer(esd.getSmtpServer());
8.79 - ExportPackageInfo.setSmtpUsername(esd.getSmtpUsername());
8.80 - ExportPackageInfo.setSmtpPassword(esd.getSmtpPassword());
8.81 - ExportPackageInfo.setSmtpUseSSL(esd.getSmtpUseSSL());
8.82 - ExportPackageInfo.mailFrom = esd.getMailFrom();
8.83 - ExportPackageInfo.mailSubject = esd.getMailSubject();
8.84 - ExportPackageInfo.mailBody = esd.getMailBody();
8.85 - ProjectPackagerSettings.setSmtpServer(esd.getSmtpServer());
8.86 - ProjectPackagerSettings.setSmtpUsername(esd.getSmtpUsername());
8.87 - ProjectPackagerSettings.setSmtpPassword(esd.getSmtpPassword());
8.88 - ProjectPackagerSettings.setSmtpUseSSL(esd.getSmtpUseSSL());
8.89 - ProjectPackagerSettings.setMailFrom(esd.getMailFrom());
8.90 - ProjectPackagerSettings.setMailSubject(esd.getMailSubject());
8.91 - ProjectPackagerSettings.setMailBody(esd.getMailBody());
8.92 - esd.dispose();
8.93 - }
8.94 -}
9.1 --- a/projectpackager/src/org/netbeans/modules/projectpackager/exporter/ExportExecutorThread.java Fri Dec 09 12:45:32 2011 -0500
9.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
9.3 @@ -1,195 +0,0 @@
9.4 -/*
9.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
9.6 - *
9.7 - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
9.8 - *
9.9 - * The contents of this file are subject to the terms of either the GNU
9.10 - * General Public License Version 2 only ("GPL") or the Common
9.11 - * Development and Distribution License("CDDL") (collectively, the
9.12 - * "License"). You may not use this file except in compliance with the
9.13 - * License. You can obtain a copy of the License at
9.14 - * http://www.netbeans.org/cddl-gplv2.html
9.15 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
9.16 - * specific language governing permissions and limitations under the
9.17 - * License. When distributing the software, include this License Header
9.18 - * Notice in each file and include the License file at
9.19 - * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
9.20 - * particular file as subject to the "Classpath" exception as provided
9.21 - * by Sun in the GPL Version 2 section of the License file that
9.22 - * accompanied this code. If applicable, add the following below the
9.23 - * License Header, with the fields enclosed by brackets [] replaced by
9.24 - * your own identifying information:
9.25 - * "Portions Copyrighted [year] [name of copyright owner]"
9.26 - *
9.27 - * Contributor(s):
9.28 - *
9.29 - * The Original Software is NetBeans. The Initial Developer of the Original
9.30 - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
9.31 - * Microsystems, Inc. All Rights Reserved.
9.32 - *
9.33 - * If you wish your version of this file to be governed by only the CDDL
9.34 - * or only the GPL Version 2, indicate your decision by adding
9.35 - * "[Contributor] elects to include this software in this distribution
9.36 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
9.37 - * single choice of license, a recipient has the option to distribute
9.38 - * your version of this file under either the CDDL, the GPL Version 2 or
9.39 - * to extend the choice of license to its licensees as provided above.
9.40 - * However, if you add GPL Version 2 code and therefore, elected the GPL
9.41 - * Version 2 license, then the option applies only if the new code is
9.42 - * made subject to such option by the copyright holder.
9.43 - */
9.44 -
9.45 -package org.netbeans.modules.projectpackager.exporter;
9.46 -
9.47 -import java.io.IOException;
9.48 -import java.util.HashMap;
9.49 -import java.util.Properties;
9.50 -import java.util.Vector;
9.51 -import org.apache.tools.ant.module.api.support.ActionUtils;
9.52 -import org.netbeans.api.progress.ProgressHandle;
9.53 -import org.netbeans.api.progress.ProgressHandleFactory;
9.54 -import org.netbeans.modules.projectpackager.tools.Constants;
9.55 -import org.openide.DialogDisplayer;
9.56 -import org.openide.NotifyDescriptor;
9.57 -import org.openide.execution.ExecutorTask;
9.58 -import org.openide.filesystems.FileObject;
9.59 -import org.openide.util.NbBundle;
9.60 -
9.61 -/**
9.62 - * A thread which executes ant targets and shows result of the actions to user.
9.63 - * @author Roman "Roumen" Strobl
9.64 - */
9.65 -public class ExportExecutorThread extends Thread {
9.66 - private Vector scripts;
9.67 - private Vector targets;
9.68 - private Vector properties;
9.69 - private int count;
9.70 - private int scheduledCount;
9.71 - private boolean silent = false;
9.72 -
9.73 - private HashMap status;
9.74 - private HashMap scheduledTasks;
9.75 -
9.76 - private ProgressHandle handle;
9.77 -
9.78 - /**
9.79 - * Creates a new instance of ExecutorThread
9.80 - */
9.81 - public ExportExecutorThread() {
9.82 - scripts = new Vector();
9.83 - targets = new Vector();
9.84 - properties = new Vector();
9.85 - status = new HashMap();
9.86 - scheduledTasks = new HashMap();
9.87 - count = 0;
9.88 - scheduledCount = 0;
9.89 - }
9.90 -
9.91 - /**
9.92 - * Run method overriding run from Thread
9.93 - */
9.94 - public void run() {
9.95 - if (!isSilent()) {
9.96 - handle = ProgressHandleFactory.createHandle(NbBundle.getBundle(Constants.BUNDLE).getString("Processing_zips"));
9.97 - handle.start();
9.98 - }
9.99 - while (count<scheduledCount) {
9.100 - FileObject script = (FileObject) scripts.get(count);
9.101 - String[] target = (String[]) targets.get(count);
9.102 - Properties props = (Properties) properties.get(count);
9.103 - try {
9.104 - ExecutorTask et = ActionUtils.runTarget(script, target, props);
9.105 - if (et.result()!=0) {
9.106 - // XXX incorrect I18N; should use getMessage with a format
9.107 - // (and should use Bundle.properties in same package as class, not in resources subfolder)
9.108 - System.err.println(NbBundle.getBundle(Constants.BUNDLE).getString("Task_execution_error_during_")+target[0]+".");
9.109 - status.put(target[0], new Boolean(false));
9.110 - } else {
9.111 - if (status.get(target[0])==null) {
9.112 - status.put(target[0], new Boolean(true));
9.113 - }
9.114 - }
9.115 - } catch (IOException e) {
9.116 - System.err.println(NbBundle.getBundle(Constants.BUNDLE).getString("IO_error:_")+e);
9.117 - }
9.118 - count++;
9.119 - }
9.120 -
9.121 - // we're done
9.122 - ExportPackageInfo.setProcessed(false);
9.123 -
9.124 - if (!isSilent()) {
9.125 - handle.finish();
9.126 - } else {
9.127 - return;
9.128 - }
9.129 -
9.130 - String errorMsg = "";
9.131 - if (scheduledTasks.get("zip-project")!=null && !((Boolean) status.get("zip-project")).booleanValue()) {
9.132 - errorMsg+=NbBundle.getBundle(Constants.BUNDLE).getString("Could_not_zip_projects._Disk_not_writable?");
9.133 - }
9.134 - if (scheduledTasks.get("mail-zips")!=null && !((Boolean) status.get("mail-zips")).booleanValue()) {
9.135 - errorMsg+=NbBundle.getBundle(Constants.BUNDLE).getString("Could_not_send_e-mail._Check_SMTP_server_settings.");
9.136 - ExportPackageInfo.setSmtpServer("");
9.137 - ExportPackageInfo.setSmtpUsername("");
9.138 - ExportPackageInfo.setSmtpPassword("");
9.139 - }
9.140 - if (scheduledTasks.get("delete-zip")!=null && !((Boolean) status.get("delete-zip")).booleanValue()) {
9.141 - errorMsg+=NbBundle.getBundle(Constants.BUNDLE).getString("Could_not_delete_projects._Disk_not_writable?");
9.142 - }
9.143 - if (!errorMsg.equals("")) {
9.144 - NotifyDescriptor d = new NotifyDescriptor.Message(errorMsg, NotifyDescriptor.ERROR_MESSAGE);
9.145 - d.setTitle(NbBundle.getBundle(Constants.BUNDLE).getString("Error_during_processing_zips"));
9.146 - DialogDisplayer.getDefault().notify(d);
9.147 - } else {
9.148 - if (scheduledTasks.get("mail-zips")==null && ((Boolean) scheduledTasks.get("zip-project")).booleanValue()) {
9.149 - NotifyDescriptor d = new NotifyDescriptor.Message(NbBundle.getBundle(Constants.BUNDLE).getString("Zip(s)_created_successfully."), NotifyDescriptor.INFORMATION_MESSAGE);
9.150 - d.setTitle(NbBundle.getBundle(Constants.BUNDLE).getString("Zip_exporter_finished"));
9.151 - DialogDisplayer.getDefault().notify(d);
9.152 - return;
9.153 - }
9.154 - if (scheduledTasks.get("delete-zip")==null && ((Boolean) scheduledTasks.get("mail-zips")).booleanValue()) {
9.155 - NotifyDescriptor d = new NotifyDescriptor.Message(NbBundle.getBundle(Constants.BUNDLE).getString("Zip(s)_created_and_sent_successfully."), NotifyDescriptor.INFORMATION_MESSAGE);
9.156 - d.setTitle(NbBundle.getBundle(Constants.BUNDLE).getString("Zip_exporter_finished"));
9.157 - DialogDisplayer.getDefault().notify(d);
9.158 - return;
9.159 - }
9.160 - if (((Boolean) scheduledTasks.get("delete-zip")).booleanValue()) {
9.161 - NotifyDescriptor d = new NotifyDescriptor.Message(NbBundle.getBundle(Constants.BUNDLE).getString("Zip(s)_created,_sent_and_deleted_successfully."), NotifyDescriptor.INFORMATION_MESSAGE);
9.162 - d.setTitle(NbBundle.getBundle(Constants.BUNDLE).getString("Zip_exporter_finished"));
9.163 - DialogDisplayer.getDefault().notify(d);
9.164 - }
9.165 - }
9.166 - }
9.167 -
9.168 - /**
9.169 - * Schedules an ant task
9.170 - * @param script ant script
9.171 - * @param target targets of ant script
9.172 - * @param props properties of ant script
9.173 - */
9.174 - public void schedule(FileObject script, String[] target, Properties props) {
9.175 - scripts.add(script);
9.176 - targets.add(target);
9.177 - properties.add(props);
9.178 - scheduledCount++;
9.179 - scheduledTasks.put(target[0], new Boolean(true));
9.180 - }
9.181 -
9.182 - /**
9.183 - * Should executor thread display results?
9.184 - * @return true if should display results
9.185 - */
9.186 - public boolean isSilent() {
9.187 - return silent;
9.188 - }
9.189 -
9.190 - /**
9.191 - * Set if executor thread should display results
9.192 - * @param silent true if results should be shown
9.193 - */
9.194 - public void setSilent(boolean silent) {
9.195 - this.silent = silent;
9.196 - }
9.197 -
9.198 -}
9.199 \ No newline at end of file
10.1 --- a/projectpackager/src/org/netbeans/modules/projectpackager/exporter/ExportPackageInfo.java Fri Dec 09 12:45:32 2011 -0500
10.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
10.3 @@ -1,212 +0,0 @@
10.4 -/*
10.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
10.6 - *
10.7 - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
10.8 - *
10.9 - * The contents of this file are subject to the terms of either the GNU
10.10 - * General Public License Version 2 only ("GPL") or the Common
10.11 - * Development and Distribution License("CDDL") (collectively, the
10.12 - * "License"). You may not use this file except in compliance with the
10.13 - * License. You can obtain a copy of the License at
10.14 - * http://www.netbeans.org/cddl-gplv2.html
10.15 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
10.16 - * specific language governing permissions and limitations under the
10.17 - * License. When distributing the software, include this License Header
10.18 - * Notice in each file and include the License file at
10.19 - * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
10.20 - * particular file as subject to the "Classpath" exception as provided
10.21 - * by Sun in the GPL Version 2 section of the License file that
10.22 - * accompanied this code. If applicable, add the following below the
10.23 - * License Header, with the fields enclosed by brackets [] replaced by
10.24 - * your own identifying information:
10.25 - * "Portions Copyrighted [year] [name of copyright owner]"
10.26 - *
10.27 - * Contributor(s):
10.28 - *
10.29 - * The Original Software is NetBeans. The Initial Developer of the Original
10.30 - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
10.31 - * Microsystems, Inc. All Rights Reserved.
10.32 - *
10.33 - * If you wish your version of this file to be governed by only the CDDL
10.34 - * or only the GPL Version 2, indicate your decision by adding
10.35 - * "[Contributor] elects to include this software in this distribution
10.36 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
10.37 - * single choice of license, a recipient has the option to distribute
10.38 - * your version of this file under either the CDDL, the GPL Version 2 or
10.39 - * to extend the choice of license to its licensees as provided above.
10.40 - * However, if you add GPL Version 2 code and therefore, elected the GPL
10.41 - * Version 2 license, then the option applies only if the new code is
10.42 - * made subject to such option by the copyright holder.
10.43 - */
10.44 -
10.45 -package org.netbeans.modules.projectpackager.exporter;
10.46 -
10.47 -/**
10.48 - * Data storage for information about export
10.49 - * @author Roman "Roumen" Strobl
10.50 - */
10.51 -public class ExportPackageInfo {
10.52 -
10.53 - // following properties remain static so that they are remembered during session
10.54 - private static String targetDir = "";
10.55 - private static boolean sendMail = false;
10.56 - private static String email = "";
10.57 - private static boolean deleteZip = false;
10.58 - private static String smtpServer = "";
10.59 - private static String smtpUsername = "";
10.60 - private static String smtpPassword = "";
10.61 - private static boolean smtpUseSSL = false;
10.62 - static String mailFrom = "";
10.63 - static String mailSubject = "";
10.64 - static String mailBody = "";
10.65 - private static boolean processed = false;
10.66 -
10.67 - /** Creates a new instance of PackageInfo */
10.68 - private ExportPackageInfo() {
10.69 - }
10.70 -
10.71 - /**
10.72 - * Is another export running?
10.73 - * @return true if running
10.74 - */
10.75 - public static boolean isProcessed() {
10.76 - return processed;
10.77 - }
10.78 -
10.79 - /**
10.80 - * Set if another export is processed
10.81 - * @param aProcessed true if processing started, false if it ends
10.82 - */
10.83 - public static void setProcessed(boolean aProcessed) {
10.84 - processed = aProcessed;
10.85 - }
10.86 -
10.87 - /**
10.88 - * Returns target directory
10.89 - * @return Target directory
10.90 - */
10.91 - public static String getTargetDir() {
10.92 - return targetDir;
10.93 - }
10.94 -
10.95 - /**
10.96 - * Sets target directory
10.97 - * @param aTargetDir target directory
10.98 - */
10.99 - public static void setTargetDir(String aTargetDir) {
10.100 - targetDir = aTargetDir;
10.101 - }
10.102 -
10.103 - /**
10.104 - * Is send mail checked?
10.105 - * @return true if checked
10.106 - */
10.107 - public static boolean isSendMail() {
10.108 - return sendMail;
10.109 - }
10.110 -
10.111 - /**
10.112 - * Set send mail checked
10.113 - * @param aSendMail true if checked
10.114 - */
10.115 - public static void setSendMail(boolean aSendMail) {
10.116 - sendMail = aSendMail;
10.117 - }
10.118 -
10.119 - /**
10.120 - * Return e-mail address(es)
10.121 - * @return e-mail address(es)
10.122 - */
10.123 - public static String getEmail() {
10.124 - return email;
10.125 - }
10.126 -
10.127 - /**
10.128 - * Set e-mail address(es)
10.129 - * @param aEmail e-mail address(es)
10.130 - */
10.131 - public static void setEmail(String aEmail) {
10.132 - email = aEmail;
10.133 - }
10.134 -
10.135 - /**
10.136 - * Is delete zip checked?
10.137 - * @return true if checked
10.138 - */
10.139 - public static boolean isDeleteZip() {
10.140 - return deleteZip;
10.141 - }
10.142 -
10.143 - /**
10.144 - * Set delete zip checked
10.145 - * @param aDeleteZip true if checked
10.146 - */
10.147 - public static void setDeleteZip(boolean aDeleteZip) {
10.148 - deleteZip = aDeleteZip;
10.149 - }
10.150 -
10.151 - /**
10.152 - * Return SMTP server
10.153 - * @return SMTP server
10.154 - */
10.155 - public static String getSmtpServer() {
10.156 - return smtpServer;
10.157 - }
10.158 -
10.159 - /**
10.160 - * Set SMTP server
10.161 - * @param aSmtpServer SMTP server
10.162 - */
10.163 - public static void setSmtpServer(String aSmtpServer) {
10.164 - smtpServer = aSmtpServer;
10.165 - }
10.166 -
10.167 - /**
10.168 - * Return SMTP username
10.169 - * @return SMTP username
10.170 - */
10.171 - public static String getSmtpUsername() {
10.172 - return smtpUsername;
10.173 - }
10.174 -
10.175 - /**
10.176 - * Set SMTP username
10.177 - * @param aSmtpUsername SMTP username
10.178 - */
10.179 - public static void setSmtpUsername(String aSmtpUsername) {
10.180 - smtpUsername = aSmtpUsername;
10.181 - }
10.182 -
10.183 - /**
10.184 - * Return SMTP password
10.185 - * @return SMTP password
10.186 - */
10.187 - public static String getSmtpPassword() {
10.188 - return smtpPassword;
10.189 - }
10.190 -
10.191 - /**
10.192 - * Set SMTP password
10.193 - * @param aSmtpPassword SMTP password
10.194 - */
10.195 - public static void setSmtpPassword(String aSmtpPassword) {
10.196 - smtpPassword = aSmtpPassword;
10.197 - }
10.198 -
10.199 - /**
10.200 - * Use SSL?
10.201 - * @return true if checked
10.202 - */
10.203 - public static boolean getSmtpUseSSL() {
10.204 - return smtpUseSSL;
10.205 - }
10.206 -
10.207 - /**
10.208 - * Set use SSL
10.209 - * @param aSmtpUseSSL true if checked
10.210 - */
10.211 - public static void setSmtpUseSSL(boolean aSmtpUseSSL) {
10.212 - smtpUseSSL = aSmtpUseSSL;
10.213 - }
10.214 -
10.215 -}
11.1 --- a/projectpackager/src/org/netbeans/modules/projectpackager/exporter/ExportPackageScheduler.java Fri Dec 09 12:45:32 2011 -0500
11.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
11.3 @@ -1,218 +0,0 @@
11.4 -/*
11.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
11.6 - *
11.7 - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
11.8 - *
11.9 - * The contents of this file are subject to the terms of either the GNU
11.10 - * General Public License Version 2 only ("GPL") or the Common
11.11 - * Development and Distribution License("CDDL") (collectively, the
11.12 - * "License"). You may not use this file except in compliance with the
11.13 - * License. You can obtain a copy of the License at
11.14 - * http://www.netbeans.org/cddl-gplv2.html
11.15 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
11.16 - * specific language governing permissions and limitations under the
11.17 - * License. When distributing the software, include this License Header
11.18 - * Notice in each file and include the License file at
11.19 - * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
11.20 - * particular file as subject to the "Classpath" exception as provided
11.21 - * by Sun in the GPL Version 2 section of the License file that
11.22 - * accompanied this code. If applicable, add the following below the
11.23 - * License Header, with the fields enclosed by brackets [] replaced by
11.24 - * your own identifying information:
11.25 - * "Portions Copyrighted [year] [name of copyright owner]"
11.26 - *
11.27 - * Contributor(s):
11.28 - *
11.29 - * The Original Software is NetBeans. The Initial Developer of the Original
11.30 - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
11.31 - * Microsystems, Inc. All Rights Reserved.
11.32 - *
11.33 - * If you wish your version of this file to be governed by only the CDDL
11.34 - * or only the GPL Version 2, indicate your decision by adding
11.35 - * "[Contributor] elects to include this software in this distribution
11.36 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
11.37 - * single choice of license, a recipient has the option to distribute
11.38 - * your version of this file under either the CDDL, the GPL Version 2 or
11.39 - * to extend the choice of license to its licensees as provided above.
11.40 - * However, if you add GPL Version 2 code and therefore, elected the GPL
11.41 - * Version 2 license, then the option applies only if the new code is
11.42 - * made subject to such option by the copyright holder.
11.43 - */
11.44 -
11.45 -package org.netbeans.modules.projectpackager.exporter;
11.46 -import java.io.File;
11.47 -import java.io.IOException;
11.48 -import java.text.Format;
11.49 -import java.text.SimpleDateFormat;
11.50 -import java.util.ArrayList;
11.51 -import java.util.Date;
11.52 -import java.util.Properties;
11.53 -import java.util.Vector;
11.54 -import org.netbeans.api.queries.SharabilityQuery;
11.55 -import org.netbeans.modules.projectpackager.tools.Constants;
11.56 -import org.netbeans.modules.projectpackager.tools.ExecutionTools;
11.57 -import org.openide.filesystems.FileObject;
11.58 -import org.openide.filesystems.FileUtil;
11.59 -import org.openide.util.NbBundle;
11.60 -
11.61 -/**
11.62 - * Schedules an export package
11.63 - * @author Roman "Roumen" Strobl
11.64 - */
11.65 -public class ExportPackageScheduler {
11.66 -
11.67 - private static FileObject script;
11.68 - private static ArrayList fileList;
11.69 - private static ExportExecutorThread et;
11.70 - private static Vector unsharableFiles;
11.71 - private static String timeStamp;
11.72 -
11.73 - private static boolean initialized = false;
11.74 -
11.75 - private ExportPackageScheduler() {
11.76 - }
11.77 -
11.78 - /**
11.79 - * Initializes scheduler by creating an executor thread
11.80 - * @return executor thread
11.81 - */
11.82 - public static ExportExecutorThread init() {
11.83 - try {
11.84 - script = ExecutionTools.initScript("Services/ProjectPackager/export_script.xml");
11.85 - et = new ExportExecutorThread();
11.86 - initialized = true;
11.87 - } catch (IOException e) {
11.88 - // XXX should use ErrorManager, or at least e.dumpStack(); and strings printed to console should never be internationalized
11.89 - System.err.println(NbBundle.getBundle(Constants.BUNDLE).getString("IO_error:_")+e);
11.90 - }
11.91 - return et;
11.92 - }
11.93 -
11.94 - /**
11.95 - * Schedules packing of zips
11.96 - * @param et executor thread
11.97 - */
11.98 - public static void packZips(ExportExecutorThread et) {
11.99 - if (!initialized) return;
11.100 -
11.101 - FileObject[] paths = null;
11.102 - Boolean[] isExternal = null;
11.103 - Format formatter = new SimpleDateFormat("yyMMdd-HHmmss");
11.104 - timeStamp = formatter.format(new Date());
11.105 -
11.106 - fileList = new ArrayList();
11.107 -
11.108 - for (int i = 0; i<ProjectInfo.getProjectCount(); i++) {
11.109 - if (!ProjectInfo.isSelected(i)) continue;
11.110 - paths = ProjectInfo.getSourceRootPaths(i);
11.111 - isExternal = ProjectInfo.getIsExternal(i);
11.112 - int external = 0;
11.113 - for (int j = 0; j<paths.length; j++) {
11.114 - Properties props = new Properties();
11.115 - props.setProperty("target_dir", ExportPackageInfo.getTargetDir());
11.116 -
11.117 - // create extra zips for external source roots
11.118 - if (isExternal[j].booleanValue()) {
11.119 - external++;
11.120 - String fileName = ProjectInfo.getName(i)+"_"+NbBundle.getBundle(Constants.BUNDLE).getString("external")+external+"_"+timeStamp;
11.121 - props.setProperty("zip_name", fileName);
11.122 - fileList.add(ExportPackageInfo.getTargetDir()+File.separator+fileName+".zip");
11.123 - } else {
11.124 - String fileName = ProjectInfo.getName(i)+"_"+timeStamp;
11.125 - props.setProperty("zip_name", fileName);
11.126 - fileList.add(ExportPackageInfo.getTargetDir()+File.separator+fileName+".zip");
11.127 - }
11.128 - props.setProperty("src_dir", FileUtil.toFile(paths[j].getParent()).getAbsolutePath());
11.129 - props.setProperty("dir_name", paths[j].getName());
11.130 - if (unsharableFiles==null) {
11.131 - unsharableFiles = new Vector();
11.132 - } else {
11.133 - unsharableFiles.clear();
11.134 - }
11.135 -
11.136 - // set which files should not be included
11.137 - traverseDirForSharability(FileUtil.toFile(paths[j].getParent()).getAbsolutePath(),
11.138 - FileUtil.toFile(paths[j]));
11.139 - String excludes = "";
11.140 - for (int k = 0; k<unsharableFiles.size(); k++) {
11.141 - excludes+=(String)unsharableFiles.get(k);
11.142 - if (k<unsharableFiles.size()-1) excludes+=",";
11.143 - }
11.144 - props.setProperty("exclude_list", excludes);
11.145 -
11.146 - // schedule creation of zip
11.147 - et.schedule(script, new String[] {"zip-project"}, props);
11.148 - }
11.149 - }
11.150 - // XXX this results in one Ant process and ZIP per project; should not use Ant for this
11.151 - }
11.152 -
11.153 - /**
11.154 - * Creates a list of files for exclude in zip target.
11.155 - */
11.156 - private static void traverseDirForSharability(String topDir, File f) {
11.157 - if (SharabilityQuery.getSharability(f)==SharabilityQuery.NOT_SHARABLE) {
11.158 - String path = f.getAbsolutePath();
11.159 - String projectDir = topDir + File.separator;
11.160 - if (f.isDirectory()) {
11.161 - // ignore NOT_SHARABLE directory, add "/" to ignore subdirectories as well
11.162 - if (path.indexOf(projectDir)>-1) {
11.163 - unsharableFiles.add(f.getAbsolutePath().substring(projectDir.length())+File.separator);
11.164 - } else {
11.165 - assert false : "Incorrect project path: "+projectDir;
11.166 - }
11.167 - } else {
11.168 - // ignore NOT_SHARABLE file
11.169 - unsharableFiles.add(f.getAbsolutePath().substring(projectDir.length()));
11.170 - }
11.171 - } else if (SharabilityQuery.getSharability(f)==SharabilityQuery.MIXED) {
11.172 - // MIXED means directory contains some NOT_SHARABLEs, traverse it
11.173 - for (int i=0; i<f.listFiles().length; i++) {
11.174 - traverseDirForSharability(topDir, f.listFiles()[i]);
11.175 - }
11.176 - }
11.177 - // files or directories with status SHARABLE or UNKNOWN are accepted
11.178 - }
11.179 -
11.180 - /**
11.181 - * Schedules sending of e-mail
11.182 - * @param et executor thread
11.183 - */
11.184 - public static void sendMail(ExportExecutorThread et) {
11.185 - if (!initialized || fileList==null) return;
11.186 -
11.187 - Properties props = new Properties();
11.188 - props.setProperty("to_addr", ExportPackageInfo.getEmail());
11.189 - props.setProperty("target_dir", ExportPackageInfo.getTargetDir());
11.190 - props.setProperty("file_list", "*_"+timeStamp+".zip");
11.191 - props.setProperty("smtp_server", ExportPackageInfo.getSmtpServer());
11.192 - props.setProperty("smtp_username", ExportPackageInfo.getSmtpUsername());
11.193 - props.setProperty("smtp_password", ExportPackageInfo.getSmtpPassword());
11.194 - if (ExportPackageInfo.getSmtpUseSSL()) {
11.195 - props.setProperty("smtp_use_ssl", "true");
11.196 - props.setProperty("smtp_mailport", "465");
11.197 - } else {
11.198 - props.setProperty("smtp_use_ssl", "false");
11.199 - props.setProperty("smtp_mailport", "25");
11.200 - }
11.201 - props.setProperty("mail_from", ExportPackageInfo.mailFrom);
11.202 - props.setProperty("mail_subject", ExportPackageInfo.mailSubject);
11.203 - props.setProperty("mail_body", ExportPackageInfo.mailBody);
11.204 - et.schedule(script, new String[] {"mail-zips"}, props);
11.205 - }
11.206 -
11.207 - /**
11.208 - * Schedules deleting of zips
11.209 - * @param et executor thread
11.210 - */
11.211 - public static void deleteZips(ExportExecutorThread et) {
11.212 - if (!initialized || fileList==null) return;
11.213 -
11.214 - for (int i = 0; i<fileList.size(); i++) {
11.215 - Properties props = new Properties();
11.216 - props.setProperty("file_to_delete", (String) fileList.get(i));
11.217 - et.schedule(script, new String[] {"delete-zip"}, props);
11.218 - }
11.219 - }
11.220 -
11.221 -}
12.1 --- a/projectpackager/src/org/netbeans/modules/projectpackager/exporter/ExportPackageValidator.java Fri Dec 09 12:45:32 2011 -0500
12.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
12.3 @@ -1,139 +0,0 @@
12.4 -/*
12.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
12.6 - *
12.7 - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
12.8 - *
12.9 - * The contents of this file are subject to the terms of either the GNU
12.10 - * General Public License Version 2 only ("GPL") or the Common
12.11 - * Development and Distribution License("CDDL") (collectively, the
12.12 - * "License"). You may not use this file except in compliance with the
12.13 - * License. You can obtain a copy of the License at
12.14 - * http://www.netbeans.org/cddl-gplv2.html
12.15 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
12.16 - * specific language governing permissions and limitations under the
12.17 - * License. When distributing the software, include this License Header
12.18 - * Notice in each file and include the License file at
12.19 - * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
12.20 - * particular file as subject to the "Classpath" exception as provided
12.21 - * by Sun in the GPL Version 2 section of the License file that
12.22 - * accompanied this code. If applicable, add the following below the
12.23 - * License Header, with the fields enclosed by brackets [] replaced by
12.24 - * your own identifying information:
12.25 - * "Portions Copyrighted [year] [name of copyright owner]"
12.26 - *
12.27 - * Contributor(s):
12.28 - *
12.29 - * The Original Software is NetBeans. The Initial Developer of the Original
12.30 - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
12.31 - * Microsystems, Inc. All Rights Reserved.
12.32 - *
12.33 - * If you wish your version of this file to be governed by only the CDDL
12.34 - * or only the GPL Version 2, indicate your decision by adding
12.35 - * "[Contributor] elects to include this software in this distribution
12.36 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
12.37 - * single choice of license, a recipient has the option to distribute
12.38 - * your version of this file under either the CDDL, the GPL Version 2 or
12.39 - * to extend the choice of license to its licensees as provided above.
12.40 - * However, if you add GPL Version 2 code and therefore, elected the GPL
12.41 - * Version 2 license, then the option applies only if the new code is
12.42 - * made subject to such option by the copyright holder.
12.43 - */
12.44 -
12.45 -package org.netbeans.modules.projectpackager.exporter;
12.46 -
12.47 -import java.io.File;
12.48 -import org.netbeans.modules.projectpackager.tools.Constants;
12.49 -import org.netbeans.modules.projectpackager.tools.NotifyDescriptorInputPassword;
12.50 -import org.netbeans.modules.projectpackager.tools.ProjectPackagerSettings;
12.51 -import org.openide.DialogDisplayer;
12.52 -import org.openide.NotifyDescriptor;
12.53 -import org.openide.util.NbBundle;
12.54 -
12.55 -/**
12.56 - * Validator of export package
12.57 - * @author Roman "Roumen" Strobl
12.58 - */
12.59 -public class ExportPackageValidator {
12.60 -
12.61 - /** Creates a new instance of PackageValidator */
12.62 - private ExportPackageValidator() {
12.63 - }
12.64 -
12.65 - /**
12.66 - * Validates the whole package which will be exported
12.67 - * @return true if all ok
12.68 - */
12.69 - public static boolean validate() {
12.70 - boolean selected = false;
12.71 - for (int i = 0; i<ProjectInfo.getProjectCount(); i++) {
12.72 - if (ProjectInfo.isSelected(i)) selected = true;
12.73 - }
12.74 - if (!selected) {
12.75 - NotifyDescriptor d = new NotifyDescriptor.Message(NbBundle.getBundle(Constants.BUNDLE).getString("No_projects_were_chosen._Please_choose_at_least_one_project_in_the_dialog."), NotifyDescriptor.ERROR_MESSAGE);
12.76 - d.setTitle(NbBundle.getBundle(Constants.BUNDLE).getString("Error:_no_project_selected"));
12.77 - DialogDisplayer.getDefault().notify(d);
12.78 - return false;
12.79 - }
12.80 -
12.81 - if (ExportPackageInfo.getTargetDir().equals("")) {
12.82 - NotifyDescriptor d = new NotifyDescriptor.Message(NbBundle.getBundle(Constants.BUNDLE).getString("Please_specify_a_directory_where_to_store_zip_files."), NotifyDescriptor.ERROR_MESSAGE);
12.83 - d.setTitle(NbBundle.getBundle(Constants.BUNDLE).getString("Error:_target_directory_not_specified"));
12.84 - DialogDisplayer.getDefault().notify(d);
12.85 - return false;
12.86 - }
12.87 -
12.88 - File target = new File(ExportPackageInfo.getTargetDir());
12.89 - if (!target.canWrite()) {
12.90 - NotifyDescriptor d = new NotifyDescriptor.Message(NbBundle.getBundle(Constants.BUNDLE).getString("Target_directory_is_not_writable._Please_choose_a_different_directory."), NotifyDescriptor.ERROR_MESSAGE);
12.91 - d.setTitle(NbBundle.getBundle(Constants.BUNDLE).getString("Error:_target_directory_not_writable"));
12.92 - DialogDisplayer.getDefault().notify(d);
12.93 - return false;
12.94 - }
12.95 -
12.96 - if (ExportPackageInfo.isSendMail() && ExportPackageInfo.getEmail().equals("")) {
12.97 - NotifyDescriptor d = new NotifyDescriptor.Message(NbBundle.getBundle(Constants.BUNDLE).getString("No_e-mail_address_specified._Please_fill_in_your_e-mail_address_in_the_dialog."), NotifyDescriptor.ERROR_MESSAGE);
12.98 - d.setTitle(NbBundle.getBundle(Constants.BUNDLE).getString("Error:_no_e-mail_address"));
12.99 - DialogDisplayer.getDefault().notify(d);
12.100 - return false;
12.101 - }
12.102 -
12.103 - if (ExportPackageInfo.isSendMail()) {
12.104 - if (ExportPackageInfo.getSmtpServer().equals("")) {
12.105 - NotifyDescriptor.InputLine d = new NotifyDescriptor.InputLine(NbBundle.getBundle(Constants.BUNDLE).getString("SMTP_server:"), NbBundle.getBundle(Constants.BUNDLE).getString("Please_specify_a_SMTP_server"));
12.106 - DialogDisplayer.getDefault().notify(d);
12.107 - if (d.getInputText().equals("")) {
12.108 - return false;
12.109 - } else {
12.110 - ProjectPackagerSettings.setSmtpServer(d.getInputText());
12.111 - }
12.112 - ExportPackageInfo.setSmtpServer(d.getInputText());
12.113 - NotifyDescriptor.InputLine d2 = new NotifyDescriptor.InputLine(NbBundle.getBundle(Constants.BUNDLE).getString("Username_(optional):"), NbBundle.getBundle(Constants.BUNDLE).getString("Please_enter_username_for_SMTP_server"));
12.114 - DialogDisplayer.getDefault().notify(d2);
12.115 - ExportPackageInfo.setSmtpUsername(d2.getInputText());
12.116 - ProjectPackagerSettings.setSmtpUsername(d2.getInputText());
12.117 - NotifyDescriptorInputPassword d3 = new NotifyDescriptorInputPassword(NbBundle.getBundle(Constants.BUNDLE).getString("Password_(optional):"), NbBundle.getBundle(Constants.BUNDLE).getString("Please_enter_password_for_SMTP_server"));
12.118 - DialogDisplayer.getDefault().notify(d3);
12.119 - ExportPackageInfo.setSmtpPassword(d3.getInputText());
12.120 - // do not save password to settings from security reasons
12.121 - }
12.122 -
12.123 - if (ExportPackageInfo.getSmtpUsername().equals("") && ExportPackageInfo.getSmtpPassword().equals("")) {
12.124 - NotifyDescriptor.InputLine d2 = new NotifyDescriptor.InputLine(NbBundle.getBundle(Constants.BUNDLE).getString("Username_(optional):"), NbBundle.getBundle(Constants.BUNDLE).getString("Please_enter_username_for_SMTP_server"));
12.125 - DialogDisplayer.getDefault().notify(d2);
12.126 - ExportPackageInfo.setSmtpUsername(d2.getInputText());
12.127 - ProjectPackagerSettings.setSmtpUsername(d2.getInputText());
12.128 - NotifyDescriptorInputPassword d = new NotifyDescriptorInputPassword(NbBundle.getBundle(Constants.BUNDLE).getString("SMTP_password:"), NbBundle.getBundle(Constants.BUNDLE).getString("Please_enter_password_for_SMTP_server"));
12.129 - DialogDisplayer.getDefault().notify(d);
12.130 - ExportPackageInfo.setSmtpPassword(d.getInputText());
12.131 - // do not save password to settings from security reasons
12.132 - } else if (!ExportPackageInfo.getSmtpUsername().equals("") && ExportPackageInfo.getSmtpPassword().equals("")) {
12.133 - NotifyDescriptorInputPassword d = new NotifyDescriptorInputPassword(NbBundle.getBundle(Constants.BUNDLE).getString("SMTP_password:"), NbBundle.getBundle(Constants.BUNDLE).getString("Please_enter_password_for_SMTP_server"));
12.134 - DialogDisplayer.getDefault().notify(d);
12.135 - ExportPackageInfo.setSmtpPassword(d.getInputText());
12.136 - }
12.137 - }
12.138 -
12.139 - return true;
12.140 - }
12.141 -
12.142 -}
13.1 --- a/projectpackager/src/org/netbeans/modules/projectpackager/exporter/ExportZip.java Fri Dec 09 12:45:32 2011 -0500
13.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
13.3 @@ -1,87 +0,0 @@
13.4 -/*
13.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
13.6 - *
13.7 - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
13.8 - *
13.9 - * The contents of this file are subject to the terms of either the GNU
13.10 - * General Public License Version 2 only ("GPL") or the Common
13.11 - * Development and Distribution License("CDDL") (collectively, the
13.12 - * "License"). You may not use this file except in compliance with the
13.13 - * License. You can obtain a copy of the License at
13.14 - * http://www.netbeans.org/cddl-gplv2.html
13.15 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
13.16 - * specific language governing permissions and limitations under the
13.17 - * License. When distributing the software, include this License Header
13.18 - * Notice in each file and include the License file at
13.19 - * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
13.20 - * particular file as subject to the "Classpath" exception as provided
13.21 - * by Sun in the GPL Version 2 section of the License file that
13.22 - * accompanied this code. If applicable, add the following below the
13.23 - * License Header, with the fields enclosed by brackets [] replaced by
13.24 - * your own identifying information:
13.25 - * "Portions Copyrighted [year] [name of copyright owner]"
13.26 - *
13.27 - * Contributor(s):
13.28 - *
13.29 - * The Original Software is NetBeans. The Initial Developer of the Original
13.30 - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
13.31 - * Microsystems, Inc. All Rights Reserved.
13.32 - *
13.33 - * If you wish your version of this file to be governed by only the CDDL
13.34 - * or only the GPL Version 2, indicate your decision by adding
13.35 - * "[Contributor] elects to include this software in this distribution
13.36 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
13.37 - * single choice of license, a recipient has the option to distribute
13.38 - * your version of this file under either the CDDL, the GPL Version 2 or
13.39 - * to extend the choice of license to its licensees as provided above.
13.40 - * However, if you add GPL Version 2 code and therefore, elected the GPL
13.41 - * Version 2 license, then the option applies only if the new code is
13.42 - * made subject to such option by the copyright holder.
13.43 - */
13.44 -
13.45 -package org.netbeans.modules.projectpackager.exporter;
13.46 -import java.awt.event.ActionEvent;
13.47 -import java.awt.event.ActionListener;
13.48 -import org.netbeans.modules.projectpackager.tools.Constants;
13.49 -import org.openide.DialogDisplayer;
13.50 -import org.openide.NotifyDescriptor;
13.51 -import org.openide.awt.ActionID;
13.52 -import org.openide.awt.ActionReference;
13.53 -import org.openide.awt.ActionRegistration;
13.54 -import org.openide.util.NbBundle;
13.55 -
13.56 -/**
13.57 - * Export zip - main class called by the action from layer.xml
13.58 - * @author Roman "Roumen" Strobl
13.59 - */
13.60 -@ActionID(id = "org.netbeans.modules.projectpackager.exporter.ExportZip", category = "Tools")
13.61 -@ActionRegistration(displayName = "org.netbeans.modules.projectpackager.resources.Bundle#NetBeans_Project(s)_as_Zip...", iconInMenu=false)
13.62 -@ActionReference(path = "Menu/File/Export", position = 1000)
13.63 -public class ExportZip implements ActionListener {
13.64 - private static ExportZipDialog zpd;
13.65 -
13.66 - public @Override void actionPerformed(ActionEvent evt) {
13.67 - if (ExportPackageInfo.isProcessed()) {
13.68 - if (zpd.isShowing()) {
13.69 - zpd.requestFocus();
13.70 - return;
13.71 - } else {
13.72 - NotifyDescriptor d = new NotifyDescriptor.Message(NbBundle.getBundle(Constants.BUNDLE).getString("Another_instance_of_this_action_is_already_running._Please_wait_untill_it_finishes."), NotifyDescriptor.ERROR_MESSAGE);
13.73 - d.setTitle(NbBundle.getBundle(Constants.BUNDLE).getString("Error:_another_instance_is_running"));
13.74 - DialogDisplayer.getDefault().notify(d);
13.75 - return;
13.76 - }
13.77 - }
13.78 -
13.79 - ExportPackageInfo.setProcessed(true);
13.80 -
13.81 - if (ExportZipUITools.getListData()!=null) {
13.82 - // XXX should rather delete OK/Cancel buttons from frame, and use NotifyDescriptor on a JPanel instead
13.83 - zpd = new ExportZipDialog();
13.84 - zpd.setVisible(true);
13.85 - } else {
13.86 - ExportPackageInfo.setProcessed(false);
13.87 - }
13.88 - }
13.89 -
13.90 -}
14.1 --- a/projectpackager/src/org/netbeans/modules/projectpackager/exporter/ExportZipDialog.form Fri Dec 09 12:45:32 2011 -0500
14.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
14.3 @@ -1,189 +0,0 @@
14.4 -<?xml version="1.0" encoding="UTF-8" ?>
14.5 -
14.6 -<Form version="1.3" maxVersion="1.3" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
14.7 - <Properties>
14.8 - <Property name="defaultCloseOperation" type="int" value="2"/>
14.9 - <Property name="title" type="java.lang.String" value="Export Project(s) as Zip"/>
14.10 - <Property name="resizable" type="boolean" value="false"/>
14.11 - </Properties>
14.12 - <SyntheticProperties>
14.13 - <SyntheticProperty name="formSizePolicy" type="int" value="1"/>
14.14 - </SyntheticProperties>
14.15 - <AuxValues>
14.16 - <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
14.17 - <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
14.18 - <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
14.19 - <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
14.20 - <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
14.21 - <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="2"/>
14.22 - <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
14.23 - <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
14.24 - <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
14.25 - </AuxValues>
14.26 -
14.27 - <Layout>
14.28 - <DimensionLayout dim="0">
14.29 - <Group type="103" groupAlignment="0" attributes="0">
14.30 - <Group type="102" alignment="0" attributes="0">
14.31 - <EmptySpace max="-2" attributes="0"/>
14.32 - <Group type="103" groupAlignment="0" attributes="0">
14.33 - <Component id="mailCheckBox" alignment="0" min="-2" max="-2" attributes="0"/>
14.34 - <Component id="deleteCheckBox" alignment="0" min="-2" max="-2" attributes="0"/>
14.35 - <Component id="emailSettings" alignment="1" min="-2" max="-2" attributes="0"/>
14.36 - <Group type="102" alignment="1" attributes="0">
14.37 - <Component id="okButton" min="-2" pref="68" max="-2" attributes="0"/>
14.38 - <EmptySpace max="-2" attributes="0"/>
14.39 - <Component id="cancelButton" min="-2" max="-2" attributes="0"/>
14.40 - </Group>
14.41 - <Group type="102" alignment="0" attributes="0">
14.42 - <Component id="jLabel1" min="-2" max="-2" attributes="0"/>
14.43 - <EmptySpace pref="34" max="32767" attributes="0"/>
14.44 - <Component id="jScrollPane1" min="-2" pref="256" max="-2" attributes="0"/>
14.45 - </Group>
14.46 - <Component id="targetDirectory" alignment="0" min="-2" max="-2" attributes="0"/>
14.47 - <Group type="102" alignment="0" attributes="0">
14.48 - <Group type="103" groupAlignment="1" attributes="0">
14.49 - <Group type="102" alignment="1" attributes="0">
14.50 - <EmptySpace max="-2" attributes="0"/>
14.51 - <Component id="mailAddress" min="-2" pref="290" max="-2" attributes="0"/>
14.52 - </Group>
14.53 - <Group type="102" alignment="0" attributes="0">
14.54 - <EmptySpace min="-2" pref="18" max="-2" attributes="0"/>
14.55 - <Component id="targetDirectoryField" min="-2" pref="289" max="-2" attributes="0"/>
14.56 - </Group>
14.57 - </Group>
14.58 - <EmptySpace pref="41" max="32767" attributes="0"/>
14.59 - <Component id="chooseButton" min="-2" max="-2" attributes="0"/>
14.60 - </Group>
14.61 - </Group>
14.62 - <EmptySpace max="-2" attributes="0"/>
14.63 - </Group>
14.64 - </Group>
14.65 - </DimensionLayout>
14.66 - <DimensionLayout dim="1">
14.67 - <Group type="103" groupAlignment="0" attributes="0">
14.68 - <Group type="102" alignment="0" attributes="0">
14.69 - <EmptySpace max="-2" attributes="0"/>
14.70 - <Group type="103" groupAlignment="0" attributes="0">
14.71 - <Component id="jLabel1" min="-2" max="-2" attributes="0"/>
14.72 - <Component id="jScrollPane1" min="-2" pref="108" max="-2" attributes="0"/>
14.73 - </Group>
14.74 - <EmptySpace min="-2" pref="15" max="-2" attributes="0"/>
14.75 - <Component id="targetDirectory" min="-2" max="-2" attributes="0"/>
14.76 - <EmptySpace max="-2" attributes="0"/>
14.77 - <Group type="103" groupAlignment="3" attributes="0">
14.78 - <Component id="targetDirectoryField" alignment="3" min="-2" max="-2" attributes="0"/>
14.79 - <Component id="chooseButton" alignment="3" min="-2" max="-2" attributes="0"/>
14.80 - </Group>
14.81 - <EmptySpace max="-2" attributes="0"/>
14.82 - <Component id="mailCheckBox" min="-2" max="-2" attributes="0"/>
14.83 - <EmptySpace max="-2" attributes="0"/>
14.84 - <Component id="mailAddress" min="-2" max="-2" attributes="0"/>
14.85 - <EmptySpace max="-2" attributes="0"/>
14.86 - <Component id="deleteCheckBox" min="-2" max="-2" attributes="0"/>
14.87 - <EmptySpace min="-2" pref="9" max="-2" attributes="0"/>
14.88 - <Component id="emailSettings" min="-2" max="-2" attributes="0"/>
14.89 - <EmptySpace pref="10" max="32767" attributes="0"/>
14.90 - <Group type="103" groupAlignment="3" attributes="0">
14.91 - <Component id="cancelButton" alignment="3" min="-2" max="-2" attributes="0"/>
14.92 - <Component id="okButton" alignment="3" min="-2" max="-2" attributes="0"/>
14.93 - </Group>
14.94 - <EmptySpace max="-2" attributes="0"/>
14.95 - </Group>
14.96 - </Group>
14.97 - </DimensionLayout>
14.98 - </Layout>
14.99 - <SubComponents>
14.100 - <Component class="javax.swing.JLabel" name="jLabel1">
14.101 - <Properties>
14.102 - <Property name="text" type="java.lang.String" value="Project(s) to Zip:"/>
14.103 - </Properties>
14.104 - </Component>
14.105 - <Component class="javax.swing.JLabel" name="targetDirectory">
14.106 - <Properties>
14.107 - <Property name="text" type="java.lang.String" value="Target Directory:"/>
14.108 - </Properties>
14.109 - </Component>
14.110 - <Component class="javax.swing.JTextField" name="targetDirectoryField">
14.111 - </Component>
14.112 - <Component class="javax.swing.JButton" name="chooseButton">
14.113 - <Properties>
14.114 - <Property name="text" type="java.lang.String" value="..."/>
14.115 - </Properties>
14.116 - <Events>
14.117 - <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="chooseButtonActionPerformed"/>
14.118 - </Events>
14.119 - </Component>
14.120 - <Component class="javax.swing.JCheckBox" name="mailCheckBox">
14.121 - <Properties>
14.122 - <Property name="text" type="java.lang.String" value="Send Zip(s) to E-mail Address:"/>
14.123 - <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
14.124 - <Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
14.125 - <EmptyBorder bottom="0" left="0" right="0" top="0"/>
14.126 - </Border>
14.127 - </Property>
14.128 - <Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
14.129 - <Insets value="[0, 0, 0, 0]"/>
14.130 - </Property>
14.131 - </Properties>
14.132 - <Events>
14.133 - <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="mailCheckBoxActionPerformed"/>
14.134 - </Events>
14.135 - </Component>
14.136 - <Component class="javax.swing.JTextField" name="mailAddress">
14.137 - </Component>
14.138 - <Component class="javax.swing.JCheckBox" name="deleteCheckBox">
14.139 - <Properties>
14.140 - <Property name="text" type="java.lang.String" value="Delete Zip(s) After Sending"/>
14.141 - <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
14.142 - <Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
14.143 - <EmptyBorder bottom="0" left="0" right="0" top="0"/>
14.144 - </Border>
14.145 - </Property>
14.146 - <Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
14.147 - <Insets value="[0, 0, 0, 0]"/>
14.148 - </Property>
14.149 - </Properties>
14.150 - </Component>
14.151 - <Component class="javax.swing.JButton" name="emailSettings">
14.152 - <Properties>
14.153 - <Property name="text" type="java.lang.String" value="E-mail Settings..."/>
14.154 - </Properties>
14.155 - <Events>
14.156 - <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="emailSettingsActionPerformed"/>
14.157 - </Events>
14.158 - </Component>
14.159 - <Component class="javax.swing.JButton" name="cancelButton">
14.160 - <Properties>
14.161 - <Property name="text" type="java.lang.String" value="Cancel"/>
14.162 - </Properties>
14.163 - <Events>
14.164 - <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cancelButtonActionPerformed"/>
14.165 - </Events>
14.166 - </Component>
14.167 - <Component class="javax.swing.JButton" name="okButton">
14.168 - <Properties>
14.169 - <Property name="text" type="java.lang.String" value="Ok"/>
14.170 - </Properties>
14.171 - <Events>
14.172 - <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="okButtonActionPerformed"/>
14.173 - </Events>
14.174 - </Component>
14.175 - <Container class="javax.swing.JScrollPane" name="jScrollPane1">
14.176 - <AuxValues>
14.177 - <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
14.178 - </AuxValues>
14.179 -
14.180 - <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
14.181 - <SubComponents>
14.182 - <Component class="javax.swing.JList" name="projectList">
14.183 - <Properties>
14.184 - <Property name="model" type="javax.swing.ListModel" editor="org.netbeans.modules.form.editors2.ListModelEditor">
14.185 - <StringArray count="0"/>
14.186 - </Property>
14.187 - </Properties>
14.188 - </Component>
14.189 - </SubComponents>
14.190 - </Container>
14.191 - </SubComponents>
14.192 -</Form>
15.1 --- a/projectpackager/src/org/netbeans/modules/projectpackager/exporter/ExportZipDialog.java Fri Dec 09 12:45:32 2011 -0500
15.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
15.3 @@ -1,316 +0,0 @@
15.4 -/*
15.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
15.6 - *
15.7 - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
15.8 - *
15.9 - * The contents of this file are subject to the terms of either the GNU
15.10 - * General Public License Version 2 only ("GPL") or the Common
15.11 - * Development and Distribution License("CDDL") (collectively, the
15.12 - * "License"). You may not use this file except in compliance with the
15.13 - * License. You can obtain a copy of the License at
15.14 - * http://www.netbeans.org/cddl-gplv2.html
15.15 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
15.16 - * specific language governing permissions and limitations under the
15.17 - * License. When distributing the software, include this License Header
15.18 - * Notice in each file and include the License file at
15.19 - * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
15.20 - * particular file as subject to the "Classpath" exception as provided
15.21 - * by Sun in the GPL Version 2 section of the License file that
15.22 - * accompanied this code. If applicable, add the following below the
15.23 - * License Header, with the fields enclosed by brackets [] replaced by
15.24 - * your own identifying information:
15.25 - * "Portions Copyrighted [year] [name of copyright owner]"
15.26 - *
15.27 - * Contributor(s):
15.28 - *
15.29 - * The Original Software is NetBeans. The Initial Developer of the Original
15.30 - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
15.31 - * Microsystems, Inc. All Rights Reserved.
15.32 - *
15.33 - * If you wish your version of this file to be governed by only the CDDL
15.34 - * or only the GPL Version 2, indicate your decision by adding
15.35 - * "[Contributor] elects to include this software in this distribution
15.36 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
15.37 - * single choice of license, a recipient has the option to distribute
15.38 - * your version of this file under either the CDDL, the GPL Version 2 or
15.39 - * to extend the choice of license to its licensees as provided above.
15.40 - * However, if you add GPL Version 2 code and therefore, elected the GPL
15.41 - * Version 2 license, then the option applies only if the new code is
15.42 - * made subject to such option by the copyright holder.
15.43 - */
15.44 -
15.45 -package org.netbeans.modules.projectpackager.exporter;
15.46 -
15.47 -import java.util.Vector;
15.48 -
15.49 -/**
15.50 - * Export zip dialog
15.51 - * @author Roman "Roumen" Strobl
15.52 - */
15.53 -public class ExportZipDialog extends javax.swing.JFrame {
15.54 - private Vector listData;
15.55 -
15.56 - /**
15.57 - * Creates new ZipProjectDialog
15.58 - */
15.59 -
15.60 - public ExportZipDialog() {
15.61 - listData = ExportZipUITools.getListData();
15.62 - initComponents();
15.63 - targetDirectoryField.setText(System.getProperty("java.io.tmpdir")); // NOI18N
15.64 - // XXX forgot I18N on forms!
15.65 - projectList.setListData(listData);
15.66 - setLocationRelativeTo(null);
15.67 - if (listData.size()==1) {
15.68 - projectList.setSelectedIndex(0);
15.69 - }
15.70 - if (ExportPackageInfo.getTargetDir()!=null && !ExportPackageInfo.getTargetDir().equals("")) {
15.71 - targetDirectoryField.setText(ExportPackageInfo.getTargetDir());
15.72 - }
15.73 - if (ExportPackageInfo.isSendMail()) {
15.74 - mailCheckBox.setSelected(true);
15.75 - mailAddress.setText(ExportPackageInfo.getEmail());
15.76 - mailAddress.setEnabled(true);
15.77 - deleteCheckBox.setEnabled(true);
15.78 - } else {
15.79 - mailAddress.setEnabled(false);
15.80 - deleteCheckBox.setEnabled(false);
15.81 - }
15.82 - if (ExportPackageInfo.isDeleteZip()) {
15.83 - deleteCheckBox.setSelected(true);
15.84 - }
15.85 - ExportZipUITools.setZipProjectDialog(this);
15.86 - }
15.87 -
15.88 - /** This method is called from within the constructor to
15.89 - * initialize the form.
15.90 - * WARNING: Do NOT modify this code. The content of this method is
15.91 - * always regenerated by the Form Editor.
15.92 - */
15.93 - // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
15.94 - private void initComponents() {
15.95 -
15.96 - jLabel1 = new javax.swing.JLabel();
15.97 - targetDirectory = new javax.swing.JLabel();
15.98 - targetDirectoryField = new javax.swing.JTextField();
15.99 - chooseButton = new javax.swing.JButton();
15.100 - mailCheckBox = new javax.swing.JCheckBox();
15.101 - mailAddress = new javax.swing.JTextField();
15.102 - deleteCheckBox = new javax.swing.JCheckBox();
15.103 - emailSettings = new javax.swing.JButton();
15.104 - cancelButton = new javax.swing.JButton();
15.105 - okButton = new javax.swing.JButton();
15.106 - jScrollPane1 = new javax.swing.JScrollPane();
15.107 - projectList = new javax.swing.JList();
15.108 -
15.109 - setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
15.110 - setTitle("Export Project(s) as Zip");
15.111 - setResizable(false);
15.112 -
15.113 - jLabel1.setText("Project(s) to Zip:");
15.114 -
15.115 - targetDirectory.setText("Target Directory:");
15.116 -
15.117 - chooseButton.setText("...");
15.118 - chooseButton.addActionListener(new java.awt.event.ActionListener() {
15.119 - public void actionPerformed(java.awt.event.ActionEvent evt) {
15.120 - chooseButtonActionPerformed(evt);
15.121 - }
15.122 - });
15.123 -
15.124 - mailCheckBox.setText("Send Zip(s) to E-mail Address:");
15.125 - mailCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
15.126 - mailCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
15.127 - mailCheckBox.addActionListener(new java.awt.event.ActionListener() {
15.128 - public void actionPerformed(java.awt.event.ActionEvent evt) {
15.129 - mailCheckBoxActionPerformed(evt);
15.130 - }
15.131 - });
15.132 -
15.133 - deleteCheckBox.setText("Delete Zip(s) After Sending");
15.134 - deleteCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
15.135 - deleteCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
15.136 -
15.137 - emailSettings.setText("E-mail Settings...");
15.138 - emailSettings.addActionListener(new java.awt.event.ActionListener() {
15.139 - public void actionPerformed(java.awt.event.ActionEvent evt) {
15.140 - emailSettingsActionPerformed(evt);
15.141 - }
15.142 - });
15.143 -
15.144 - cancelButton.setText("Cancel");
15.145 - cancelButton.addActionListener(new java.awt.event.ActionListener() {
15.146 - public void actionPerformed(java.awt.event.ActionEvent evt) {
15.147 - cancelButtonActionPerformed(evt);
15.148 - }
15.149 - });
15.150 -
15.151 - okButton.setText("Ok");
15.152 - okButton.addActionListener(new java.awt.event.ActionListener() {
15.153 - public void actionPerformed(java.awt.event.ActionEvent evt) {
15.154 - okButtonActionPerformed(evt);
15.155 - }
15.156 - });
15.157 -
15.158 - jScrollPane1.setViewportView(projectList);
15.159 -
15.160 - org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
15.161 - getContentPane().setLayout(layout);
15.162 - layout.setHorizontalGroup(
15.163 - layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
15.164 - .add(layout.createSequentialGroup()
15.165 - .addContainerGap()
15.166 - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
15.167 - .add(mailCheckBox)
15.168 - .add(deleteCheckBox)
15.169 - .add(org.jdesktop.layout.GroupLayout.TRAILING, emailSettings)
15.170 - .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
15.171 - .add(okButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 68, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
15.172 - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
15.173 - .add(cancelButton))
15.174 - .add(layout.createSequentialGroup()
15.175 - .add(jLabel1)
15.176 - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 34, Short.MAX_VALUE)
15.177 - .add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 256, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
15.178 - .add(targetDirectory)
15.179 - .add(layout.createSequentialGroup()
15.180 - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
15.181 - .add(layout.createSequentialGroup()
15.182 - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
15.183 - .add(mailAddress, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 290, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
15.184 - .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup()
15.185 - .add(18, 18, 18)
15.186 - .add(targetDirectoryField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 289, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
15.187 - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 41, Short.MAX_VALUE)
15.188 - .add(chooseButton)))
15.189 - .addContainerGap())
15.190 - );
15.191 - layout.setVerticalGroup(
15.192 - layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
15.193 - .add(layout.createSequentialGroup()
15.194 - .addContainerGap()
15.195 - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
15.196 - .add(jLabel1)
15.197 - .add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 108, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
15.198 - .add(15, 15, 15)
15.199 - .add(targetDirectory)
15.200 - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
15.201 - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
15.202 - .add(targetDirectoryField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
15.203 - .add(chooseButton))
15.204 - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
15.205 - .add(mailCheckBox)
15.206 - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
15.207 - .add(mailAddress, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
15.208 - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
15.209 - .add(deleteCheckBox)
15.210 - .add(9, 9, 9)
15.211 - .add(emailSettings)
15.212 - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 10, Short.MAX_VALUE)
15.213 - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
15.214 - .add(cancelButton)
15.215 - .add(okButton))
15.216 - .addContainerGap())
15.217 - );
15.218 -
15.219 - pack();
15.220 - }// </editor-fold>//GEN-END:initComponents
15.221 -
15.222 - private void mailCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mailCheckBoxActionPerformed
15.223 - processMailCheckbox();
15.224 - }
15.225 -
15.226 - private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {
15.227 - ExportZipUITools.processOkButton();//GEN-HEADEREND:event_mailCheckBoxActionPerformed
15.228 - }//GEN-LAST:event_mailCheckBoxActionPerformed
15.229 -//GEN-FIRST:event_okButtonActionPerformed
15.230 - private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {
15.231 - ExportZipUITools.processCancelButton();//GEN-HEADEREND:event_okButtonActionPerformed
15.232 - }//GEN-LAST:event_okButtonActionPerformed
15.233 -
15.234 - private void emailSettingsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-HEADEREND:event_cancelButtonActionPerformed
15.235 - ExportZipUITools.showEmailSettings();//GEN-LAST:event_cancelButtonActionPerformed
15.236 - }//GEN-FIRST:event_emailSettingsActionPerformed
15.237 -
15.238 - private void chooseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-HEADEREND:event_emailSettingsActionPerformed
15.239 - ExportZipUITools.showFileChooser();//GEN-LAST:event_emailSettingsActionPerformed
15.240 - }//GEN-FIRST:event_chooseButtonActionPerformed
15.241 -
15.242 -
15.243 - /**
15.244 - * Set target directory
15.245 - * @param targetDir target directory
15.246 - */
15.247 - public void setTargetDir(String targetDir) {//GEN-HEADEREND:event_chooseButtonActionPerformed
15.248 - targetDirectoryField.setText(targetDir);//GEN-LAST:event_chooseButtonActionPerformed
15.249 - }
15.250 -
15.251 - /**
15.252 - * Return target directory
15.253 - * @return target directory
15.254 - */
15.255 - public String getTargetDir() {
15.256 - return targetDirectoryField.getText();
15.257 - }
15.258 -
15.259 - /**
15.260 - * Return selection indices of projects
15.261 - * @return selected projects
15.262 - */
15.263 - public int[] getSelectedIndices() {
15.264 - return projectList.getSelectedIndices();
15.265 - }
15.266 -
15.267 - /**
15.268 - * Is mail selected?
15.269 - * @return true if selected
15.270 - */
15.271 - public boolean isMailSelected() {
15.272 - return mailCheckBox.isSelected();
15.273 - }
15.274 -
15.275 - /**
15.276 - * Return mail
15.277 - * @return mail
15.278 - */
15.279 - public String getMail() {
15.280 - return mailAddress.getText();
15.281 - }
15.282 -
15.283 - /**
15.284 - * Is delete selected?
15.285 - * @return true if selected
15.286 - */
15.287 - public boolean isDeleteSelected() {
15.288 - return deleteCheckBox.isSelected();
15.289 - }
15.290 -
15.291 - /**
15.292 - * Process mail checkbox according to user's actions
15.293 - */
15.294 - public void processMailCheckbox() {
15.295 - if (mailCheckBox.isSelected()) {
15.296 - mailAddress.setEnabled(true);
15.297 - deleteCheckBox.setEnabled(true);
15.298 - } else {
15.299 - mailAddress.setEnabled(false);
15.300 - deleteCheckBox.setEnabled(false);
15.301 - }
15.302 - }
15.303 -
15.304 - // Variables declaration - do not modify//GEN-BEGIN:variables
15.305 - private javax.swing.JButton cancelButton;
15.306 - private javax.swing.JButton chooseButton;
15.307 - private javax.swing.JCheckBox deleteCheckBox;
15.308 - private javax.swing.JButton emailSettings;
15.309 - private javax.swing.JLabel jLabel1;
15.310 - private javax.swing.JScrollPane jScrollPane1;
15.311 - private javax.swing.JTextField mailAddress;
15.312 - private javax.swing.JCheckBox mailCheckBox;
15.313 - private javax.swing.JButton okButton;
15.314 - private javax.swing.JList projectList;
15.315 - private javax.swing.JLabel targetDirectory;
15.316 - private javax.swing.JTextField targetDirectoryField;
15.317 - // End of variables declaration//GEN-END:variables
15.318 -
15.319 -}
16.1 --- a/projectpackager/src/org/netbeans/modules/projectpackager/exporter/ExportZipUITools.java Fri Dec 09 12:45:32 2011 -0500
16.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
16.3 @@ -1,207 +0,0 @@
16.4 -/*
16.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
16.6 - *
16.7 - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
16.8 - *
16.9 - * The contents of this file are subject to the terms of either the GNU
16.10 - * General Public License Version 2 only ("GPL") or the Common
16.11 - * Development and Distribution License("CDDL") (collectively, the
16.12 - * "License"). You may not use this file except in compliance with the
16.13 - * License. You can obtain a copy of the License at
16.14 - * http://www.netbeans.org/cddl-gplv2.html
16.15 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
16.16 - * specific language governing permissions and limitations under the
16.17 - * License. When distributing the software, include this License Header
16.18 - * Notice in each file and include the License file at
16.19 - * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
16.20 - * particular file as subject to the "Classpath" exception as provided
16.21 - * by Sun in the GPL Version 2 section of the License file that
16.22 - * accompanied this code. If applicable, add the following below the
16.23 - * License Header, with the fields enclosed by brackets [] replaced by
16.24 - * your own identifying information:
16.25 - * "Portions Copyrighted [year] [name of copyright owner]"
16.26 - *
16.27 - * Contributor(s):
16.28 - *
16.29 - * The Original Software is NetBeans. The Initial Developer of the Original
16.30 - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
16.31 - * Microsystems, Inc. All Rights Reserved.
16.32 - *
16.33 - * If you wish your version of this file to be governed by only the CDDL
16.34 - * or only the GPL Version 2, indicate your decision by adding
16.35 - * "[Contributor] elects to include this software in this distribution
16.36 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
16.37 - * single choice of license, a recipient has the option to distribute
16.38 - * your version of this file under either the CDDL, the GPL Version 2 or
16.39 - * to extend the choice of license to its licensees as provided above.
16.40 - * However, if you add GPL Version 2 code and therefore, elected the GPL
16.41 - * Version 2 license, then the option applies only if the new code is
16.42 - * made subject to such option by the copyright holder.
16.43 - */
16.44 -
16.45 -package org.netbeans.modules.projectpackager.exporter;
16.46 -
16.47 -import java.util.Vector;
16.48 -import javax.swing.JFileChooser;
16.49 -import org.netbeans.modules.projectpackager.tools.Constants;
16.50 -import org.netbeans.modules.projectpackager.tools.DirectoryFilter;
16.51 -import org.netbeans.modules.projectpackager.tools.ProjectPackagerSettings;
16.52 -import org.openide.DialogDisplayer;
16.53 -import org.openide.NotifyDescriptor;
16.54 -import org.openide.util.NbBundle;
16.55 -
16.56 -/**
16.57 - * Tools for Export zip dialog
16.58 - * @author Roman "Roumen" Strobl
16.59 - */
16.60 -public class ExportZipUITools {
16.61 - private static ExportZipDialog zpd;
16.62 - private static String targetDir;
16.63 - private static Vector listData;
16.64 - private static EmailSettingsDialog esd;
16.65 -
16.66 - private ExportZipUITools() {
16.67 - }
16.68 -
16.69 - /**
16.70 - * Set reference to zip project dialog
16.71 - * @param azpd zip project dialog
16.72 - */
16.73 - public static void setZipProjectDialog(ExportZipDialog azpd) {
16.74 - zpd = azpd;
16.75 - }
16.76 -
16.77 - /**
16.78 - * Shows chooser for directory
16.79 - */
16.80 - public static void showFileChooser() {
16.81 - JFileChooser fc = new JFileChooser();
16.82 - String aTargetDir = "";
16.83 -
16.84 - fc.addChoosableFileFilter(new DirectoryFilter());
16.85 - fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
16.86 -
16.87 - int returnVal = fc.showOpenDialog(zpd);
16.88 - if(returnVal == JFileChooser.APPROVE_OPTION) {
16.89 - aTargetDir = fc.getSelectedFile().getAbsolutePath();
16.90 - }
16.91 - targetDir = aTargetDir;
16.92 - zpd.setTargetDir(aTargetDir);
16.93 - }
16.94 -
16.95 - /**
16.96 - * Processes Ok button - verifies pack, schedules tasks and executes them
16.97 - */
16.98 - public static void processOkButton() {
16.99 - for (int i = 0; i<ProjectInfo.getProjectCount(); i++) {
16.100 - ProjectInfo.setSelected(i, false);
16.101 - }
16.102 - int[] selected = zpd.getSelectedIndices();
16.103 - for (int i = 0; i<selected.length; i++) {
16.104 - ProjectInfo.setSelected(selected[i], true);
16.105 - }
16.106 - ExportPackageInfo.setTargetDir(zpd.getTargetDir());
16.107 - ExportPackageInfo.setSendMail(zpd.isMailSelected());
16.108 - ExportPackageInfo.setEmail(zpd.getMail());
16.109 - ExportPackageInfo.setDeleteZip(zpd.isDeleteSelected());
16.110 - String smtpServer = ProjectPackagerSettings.getSmtpServer();
16.111 - if (smtpServer!=null && !smtpServer.equals("")) {
16.112 - ExportPackageInfo.setSmtpServer(smtpServer);
16.113 - } else {
16.114 - smtpServer = System.getProperty("smtp_server");
16.115 - if (smtpServer!=null && !smtpServer.equals("")) ExportPackageInfo.setSmtpServer(smtpServer);
16.116 - }
16.117 - String smtpUsername = ProjectPackagerSettings.getSmtpUsername();
16.118 - if (smtpUsername!=null && !smtpUsername.equals("")) {
16.119 - ExportPackageInfo.setSmtpUsername(smtpUsername);
16.120 - } else {
16.121 - smtpUsername = System.getProperty("smtp_username");
16.122 - if (smtpUsername!=null && !smtpUsername.equals("")) ExportPackageInfo.setSmtpUsername(smtpUsername);
16.123 - }
16.124 - String smtpPassword = ProjectPackagerSettings.getSmtpPassword();
16.125 - if (smtpPassword!=null && !smtpPassword.equals("")) {
16.126 - ExportPackageInfo.setSmtpPassword(smtpPassword);
16.127 - } else {
16.128 - smtpPassword = System.getProperty("smtp_password");
16.129 - if (smtpPassword!=null && !smtpPassword.equals("")) ExportPackageInfo.setSmtpPassword(smtpPassword);
16.130 - }
16.131 - boolean smtpUseSSL = ProjectPackagerSettings.getSmtpUseSSL();
16.132 - ExportPackageInfo.setSmtpUseSSL(smtpUseSSL);
16.133 - String mailFrom = ProjectPackagerSettings.getMailFrom();
16.134 - if (mailFrom != null && mailFrom.length() > 0) {
16.135 - ExportPackageInfo.mailFrom = mailFrom;
16.136 - }
16.137 - String mailSubject = ProjectPackagerSettings.getMailSubject();
16.138 - if (mailSubject != null && mailSubject.length() > 0) {
16.139 - ExportPackageInfo.mailSubject = mailSubject;
16.140 - }
16.141 - String mailBody = ProjectPackagerSettings.getMailBody();
16.142 - if (mailBody != null && mailBody.length() > 0) {
16.143 - ExportPackageInfo.mailBody = mailBody;
16.144 - }
16.145 - if (!ExportPackageValidator.validate()) {
16.146 - zpd.requestFocus();
16.147 - return;
16.148 - }
16.149 -
16.150 - zpd.dispose();
16.151 -
16.152 - ExportExecutorThread et = ExportPackageScheduler.init();
16.153 - ExportPackageScheduler.packZips(et);
16.154 - if (ExportPackageInfo.isSendMail()) {
16.155 - ExportPackageScheduler.sendMail(et);
16.156 - }
16.157 - if (ExportPackageInfo.isSendMail() && ExportPackageInfo.isDeleteZip()) {
16.158 - ExportPackageScheduler.deleteZips(et);
16.159 - }
16.160 - et.start();
16.161 - }
16.162 -
16.163 - /**
16.164 - * Processes cancel button - just dispose
16.165 - */
16.166 - public static void processCancelButton() {
16.167 - // we're done
16.168 - ExportPackageInfo.setProcessed(false);
16.169 - zpd.dispose();
16.170 - }
16.171 -
16.172 - /**
16.173 - * Shows the E-mail settings dialog
16.174 - */
16.175 - public static void showEmailSettings() {
16.176 - if (esd!=null && esd.isShowing()) {
16.177 - esd.requestFocus();
16.178 - } else {
16.179 - esd = new EmailSettingsDialog();
16.180 - esd.setVisible(true);
16.181 - }
16.182 - }
16.183 -
16.184 -
16.185 - /**
16.186 - * Returns names of project for the JList
16.187 - * @return project names
16.188 - */
16.189 - public static Vector getListData() {
16.190 - if (listData==null) {
16.191 - listData = new Vector();
16.192 - } else {
16.193 - listData.clear();
16.194 - }
16.195 - ProjectInfo.initProjects();
16.196 - ProjectTools.readProjectInfo();
16.197 - if (ProjectInfo.getProjectCount()==0) {
16.198 - NotifyDescriptor d = new NotifyDescriptor.Message(NbBundle.getBundle(Constants.BUNDLE).getString("No_projects_are_currently_opened._Please_open_at_least_one_project_and_re-run_exporter."), NotifyDescriptor.ERROR_MESSAGE);
16.199 - d.setTitle(NbBundle.getBundle(Constants.BUNDLE).getString("Error:_no_project_opened"));
16.200 - DialogDisplayer.getDefault().notify(d);
16.201 - return null;
16.202 - }
16.203 - for (int i = 0; i<ProjectInfo.getProjectCount(); i++) {
16.204 - listData.addElement(ProjectInfo.getName(i));
16.205 - }
16.206 - return listData;
16.207 - }
16.208 -
16.209 -
16.210 -}
17.1 --- a/projectpackager/src/org/netbeans/modules/projectpackager/exporter/ProjectInfo.java Fri Dec 09 12:45:32 2011 -0500
17.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
17.3 @@ -1,155 +0,0 @@
17.4 -/*
17.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
17.6 - *
17.7 - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
17.8 - *
17.9 - * The contents of this file are subject to the terms of either the GNU
17.10 - * General Public License Version 2 only ("GPL") or the Common
17.11 - * Development and Distribution License("CDDL") (collectively, the
17.12 - * "License"). You may not use this file except in compliance with the
17.13 - * License. You can obtain a copy of the License at
17.14 - * http://www.netbeans.org/cddl-gplv2.html
17.15 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
17.16 - * specific language governing permissions and limitations under the
17.17 - * License. When distributing the software, include this License Header
17.18 - * Notice in each file and include the License file at
17.19 - * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
17.20 - * particular file as subject to the "Classpath" exception as provided
17.21 - * by Sun in the GPL Version 2 section of the License file that
17.22 - * accompanied this code. If applicable, add the following below the
17.23 - * License Header, with the fields enclosed by brackets [] replaced by
17.24 - * your own identifying information:
17.25 - * "Portions Copyrighted [year] [name of copyright owner]"
17.26 - *
17.27 - * Contributor(s):
17.28 - *
17.29 - * The Original Software is NetBeans. The Initial Developer of the Original
17.30 - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17.31 - * Microsystems, Inc. All Rights Reserved.
17.32 - *
17.33 - * If you wish your version of this file to be governed by only the CDDL
17.34 - * or only the GPL Version 2, indicate your decision by adding
17.35 - * "[Contributor] elects to include this software in this distribution
17.36 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
17.37 - * single choice of license, a recipient has the option to distribute
17.38 - * your version of this file under either the CDDL, the GPL Version 2 or
17.39 - * to extend the choice of license to its licensees as provided above.
17.40 - * However, if you add GPL Version 2 code and therefore, elected the GPL
17.41 - * Version 2 license, then the option applies only if the new code is
17.42 - * made subject to such option by the copyright holder.
17.43 - */
17.44 -
17.45 -package org.netbeans.modules.projectpackager.exporter;
17.46 -
17.47 -import java.util.Vector;
17.48 -import org.openide.filesystems.FileObject;
17.49 -
17.50 -/**
17.51 - * Serves as storage of data related to projects
17.52 - * @author Roman "Roumen" Strobl
17.53 - */
17.54 -public class ProjectInfo {
17.55 -
17.56 - private static Vector names;
17.57 - private static Vector sourceRootPaths;
17.58 - private static Vector isExternal;
17.59 - private static Vector selected;
17.60 -
17.61 - /** Creates a new instance of ProjectInfo */
17.62 - private ProjectInfo() {
17.63 - }
17.64 -
17.65 - /**
17.66 - * Return project name
17.67 - * @param index index of project
17.68 - * @return project name
17.69 - */
17.70 - public static String getName(int index) {
17.71 - return (String) names.get(index);
17.72 - }
17.73 -
17.74 - /**
17.75 - * Set project name
17.76 - * @param index index of project
17.77 - * @param name project name
17.78 - */
17.79 - public static void setName(int index, String name) {
17.80 - names.add(index, name);
17.81 - }
17.82 -
17.83 - /**
17.84 - * Returns source root paths for a project
17.85 - * @param index index of project
17.86 - * @return source roots
17.87 - */
17.88 - public static FileObject[] getSourceRootPaths(int index) {
17.89 - return (FileObject[]) sourceRootPaths.get(index);
17.90 - }
17.91 -
17.92 - /**
17.93 - * Set source roots of a project
17.94 - * @param index index of project
17.95 - * @param aSourceRootPaths source roots
17.96 - */
17.97 - public static void setSourceRootPaths(int index, FileObject[] aSourceRootPaths) {
17.98 - sourceRootPaths.add(index, aSourceRootPaths);
17.99 - }
17.100 -
17.101 - /**
17.102 - * Is a project selected?
17.103 - * @param index index of project
17.104 - * @return true if selected
17.105 - */
17.106 - public static boolean isSelected(int index) {
17.107 - return ((Boolean) selected.get(index)).booleanValue();
17.108 - }
17.109 -
17.110 - /**
17.111 - * Set a project to be selected
17.112 - * @param index index of project
17.113 - * @param aSelected true if selected
17.114 - */
17.115 - public static void setSelected(int index, boolean aSelected) {
17.116 - selected.add(index, Boolean.valueOf(aSelected));
17.117 - }
17.118 -
17.119 - /**
17.120 - * Return number of projects shown in dialog
17.121 - * @return project count
17.122 - */
17.123 - public static int getProjectCount() {
17.124 - return names.size();
17.125 - }
17.126 -
17.127 - /**
17.128 - * Initialize projects - create new Vectors with data or empty them if they exist
17.129 - */
17.130 - public static void initProjects() {
17.131 - if (names==null) {
17.132 - names = new Vector();
17.133 - } else {
17.134 - names.clear();
17.135 - }
17.136 - if (sourceRootPaths==null) {
17.137 - sourceRootPaths = new Vector();
17.138 - isExternal = new Vector();
17.139 - } else {
17.140 - sourceRootPaths.clear();
17.141 - isExternal.clear();
17.142 - }
17.143 - if (selected==null) {
17.144 - selected = new Vector();
17.145 - } else {
17.146 - selected.clear();
17.147 - }
17.148 - }
17.149 -
17.150 - public static Boolean[] getIsExternal(int index) {
17.151 - return (Boolean[]) isExternal.get(index);
17.152 - }
17.153 -
17.154 - public static void setIsExternal(int index, Boolean[] aIsExternal) {
17.155 - isExternal.add(index, aIsExternal);
17.156 - }
17.157 -
17.158 -}
18.1 --- a/projectpackager/src/org/netbeans/modules/projectpackager/exporter/ProjectTools.java Fri Dec 09 12:45:32 2011 -0500
18.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
18.3 @@ -1,88 +0,0 @@
18.4 -/*
18.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
18.6 - *
18.7 - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
18.8 - *
18.9 - * The contents of this file are subject to the terms of either the GNU
18.10 - * General Public License Version 2 only ("GPL") or the Common
18.11 - * Development and Distribution License("CDDL") (collectively, the
18.12 - * "License"). You may not use this file except in compliance with the
18.13 - * License. You can obtain a copy of the License at
18.14 - * http://www.netbeans.org/cddl-gplv2.html
18.15 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
18.16 - * specific language governing permissions and limitations under the
18.17 - * License. When distributing the software, include this License Header
18.18 - * Notice in each file and include the License file at
18.19 - * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
18.20 - * particular file as subject to the "Classpath" exception as provided
18.21 - * by Sun in the GPL Version 2 section of the License file that
18.22 - * accompanied this code. If applicable, add the following below the
18.23 - * License Header, with the fields enclosed by brackets [] replaced by
18.24 - * your own identifying information:
18.25 - * "Portions Copyrighted [year] [name of copyright owner]"
18.26 - *
18.27 - * Contributor(s):
18.28 - *
18.29 - * The Original Software is NetBeans. The Initial Developer of the Original
18.30 - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
18.31 - * Microsystems, Inc. All Rights Reserved.
18.32 - *
18.33 - * If you wish your version of this file to be governed by only the CDDL
18.34 - * or only the GPL Version 2, indicate your decision by adding
18.35 - * "[Contributor] elects to include this software in this distribution
18.36 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
18.37 - * single choice of license, a recipient has the option to distribute
18.38 - * your version of this file under either the CDDL, the GPL Version 2 or
18.39 - * to extend the choice of license to its licensees as provided above.
18.40 - * However, if you add GPL Version 2 code and therefore, elected the GPL
18.41 - * Version 2 license, then the option applies only if the new code is
18.42 - * made subject to such option by the copyright holder.
18.43 - */
18.44 -
18.45 -package org.netbeans.modules.projectpackager.exporter;
18.46 -
18.47 -import org.netbeans.api.project.Project;
18.48 -import org.netbeans.api.project.ProjectUtils;
18.49 -import org.netbeans.api.project.SourceGroup;
18.50 -import org.netbeans.api.project.Sources;
18.51 -import org.netbeans.api.project.ui.OpenProjects;
18.52 -import org.openide.filesystems.FileObject;
18.53 -
18.54 -/**
18.55 - * Tools class for working with projects
18.56 - * @author Roman "Roumen" Strobl
18.57 - */
18.58 -public class ProjectTools {
18.59 -
18.60 - /** No constructor */
18.61 - private ProjectTools() {
18.62 - }
18.63 -
18.64 - /**
18.65 - * Read project info from Projects API and set the ExportPackageInfo according to it
18.66 - */
18.67 - public static void readProjectInfo() {
18.68 - Project[] openProjects = OpenProjects.getDefault().getOpenProjects();
18.69 -
18.70 - for (int i = 0; i < openProjects.length; i++) {
18.71 - Sources sources = ProjectUtils.getSources(openProjects[i]);
18.72 - SourceGroup[] sourceGroups
18.73 - = sources.getSourceGroups(Sources.TYPE_GENERIC);
18.74 - ProjectInfo.setName(i, ProjectUtils.getInformation(openProjects[i]).getName());
18.75 - FileObject[] sourceDirs = new FileObject[sourceGroups.length];
18.76 - Boolean[] isExternal = new Boolean[sourceGroups.length];
18.77 - for (int j = 0; j < sourceGroups.length; j++) {
18.78 - sourceDirs[j] = sourceGroups[j].getRootFolder();
18.79 - String projectPath = openProjects[i].getProjectDirectory().getPath();
18.80 - if (projectPath.indexOf(sourceGroups[j].getRootFolder().getPath()) == -1) {
18.81 - isExternal[j] = Boolean.TRUE;
18.82 - } else {
18.83 - isExternal[j] = Boolean.FALSE;
18.84 - }
18.85 - }
18.86 - ProjectInfo.setSourceRootPaths(i, sourceDirs);
18.87 - ProjectInfo.setIsExternal(i, isExternal);
18.88 - }
18.89 - }
18.90 -
18.91 -}
19.1 --- a/projectpackager/src/org/netbeans/modules/projectpackager/importer/ImportExecutorThread.java Fri Dec 09 12:45:32 2011 -0500
19.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
19.3 @@ -1,213 +0,0 @@
19.4 -/*
19.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
19.6 - *
19.7 - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
19.8 - *
19.9 - * The contents of this file are subject to the terms of either the GNU
19.10 - * General Public License Version 2 only ("GPL") or the Common
19.11 - * Development and Distribution License("CDDL") (collectively, the
19.12 - * "License"). You may not use this file except in compliance with the
19.13 - * License. You can obtain a copy of the License at
19.14 - * http://www.netbeans.org/cddl-gplv2.html
19.15 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
19.16 - * specific language governing permissions and limitations under the
19.17 - * License. When distributing the software, include this License Header
19.18 - * Notice in each file and include the License file at
19.19 - * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
19.20 - * particular file as subject to the "Classpath" exception as provided
19.21 - * by Sun in the GPL Version 2 section of the License file that
19.22 - * accompanied this code. If applicable, add the following below the
19.23 - * License Header, with the fields enclosed by brackets [] replaced by
19.24 - * your own identifying information:
19.25 - * "Portions Copyrighted [year] [name of copyright owner]"
19.26 - *
19.27 - * Contributor(s):
19.28 - *
19.29 - * The Original Software is NetBeans. The Initial Developer of the Original
19.30 - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
19.31 - * Microsystems, Inc. All Rights Reserved.
19.32 - *
19.33 - * If you wish your version of this file to be governed by only the CDDL
19.34 - * or only the GPL Version 2, indicate your decision by adding
19.35 - * "[Contributor] elects to include this software in this distribution
19.36 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
19.37 - * single choice of license, a recipient has the option to distribute
19.38 - * your version of this file under either the CDDL, the GPL Version 2 or
19.39 - * to extend the choice of license to its licensees as provided above.
19.40 - * However, if you add GPL Version 2 code and therefore, elected the GPL
19.41 - * Version 2 license, then the option applies only if the new code is
19.42 - * made subject to such option by the copyright holder.
19.43 - */
19.44 -
19.45 -package org.netbeans.modules.projectpackager.importer;
19.46 -
19.47 -import java.io.File;
19.48 -import java.io.IOException;
19.49 -import java.util.HashMap;
19.50 -import java.util.Properties;
19.51 -import java.util.Vector;
19.52 -import javax.swing.SwingUtilities;
19.53 -import org.apache.tools.ant.module.api.support.ActionUtils;
19.54 -import org.netbeans.api.progress.ProgressHandle;
19.55 -import org.netbeans.api.progress.ProgressHandleFactory;
19.56 -import org.netbeans.api.project.Project;
19.57 -import org.netbeans.api.project.ProjectManager;
19.58 -import org.netbeans.api.project.ui.OpenProjects;
19.59 -import org.netbeans.modules.projectpackager.tools.Constants;
19.60 -import org.openide.DialogDisplayer;
19.61 -import org.openide.NotifyDescriptor;
19.62 -import org.openide.execution.ExecutorTask;
19.63 -import org.openide.filesystems.FileObject;
19.64 -import org.openide.filesystems.FileUtil;
19.65 -import org.openide.util.NbBundle;
19.66 -
19.67 -/**
19.68 - * A thread which executes ant targets and shows result of the actions to user.
19.69 - * @author Roman "Roumen" Strobl
19.70 - */
19.71 -public class ImportExecutorThread extends Thread {
19.72 - private Vector scripts;
19.73 - private Vector targets;
19.74 - private Vector properties;
19.75 - private int count;
19.76 - private int scheduledCount;
19.77 - private boolean silent = false;
19.78 -
19.79 - private HashMap status;
19.80 - private HashMap scheduledTasks;
19.81 -
19.82 - private ProgressHandle handle;
19.83 -
19.84 - /**
19.85 - * Creates a new instance of ImportExecutorThread
19.86 - */
19.87 - public ImportExecutorThread() {
19.88 - scripts = new Vector();
19.89 - targets = new Vector();
19.90 - properties = new Vector();
19.91 - status = new HashMap();
19.92 - scheduledTasks = new HashMap();
19.93 - count = 0;
19.94 - scheduledCount = 0;
19.95 - }
19.96 -
19.97 - /**
19.98 - * Run method, overrides run() from Thread
19.99 - */
19.100 - public void run() {
19.101 - if (!isSilent()) {
19.102 - handle = ProgressHandleFactory.createHandle(NbBundle.getBundle(Constants.BUNDLE).getString("Processing_zips"));
19.103 - handle.start();
19.104 - }
19.105 - while (count<scheduledCount) {
19.106 - FileObject script = (FileObject) scripts.get(count);
19.107 - String[] target = (String[]) targets.get(count);
19.108 - Properties props = (Properties) properties.get(count);
19.109 - try {
19.110 - ExecutorTask et = ActionUtils.runTarget(script, target, props);
19.111 - if (et.result()!=0) {
19.112 - System.err.println(NbBundle.getBundle(Constants.BUNDLE).getString("Task_execution_error_during_")+target[0]+".");
19.113 - status.put(target[0], new Boolean(false));
19.114 - } else {
19.115 - if (status.get(target[0])==null) {
19.116 - status.put(target[0], new Boolean(true));
19.117 - }
19.118 - }
19.119 - } catch (IOException e) {
19.120 - System.err.println(NbBundle.getBundle(Constants.BUNDLE).getString("IO_error:_")+e);
19.121 - }
19.122 - count++;
19.123 - }
19.124 -
19.125 - // we're done
19.126 - ImportPackageInfo.setProcessed(false);
19.127 -
19.128 - // open imported project, has to be done in AWT thread
19.129 - SwingUtilities.invokeLater(new Runnable() {
19.130 - public void run() {
19.131 - File projectDir = new File(ImportPackageInfo.getUnzipDir() + File.separator + ImportPackageInfo.getProjectName());
19.132 - try {
19.133 - Project project = (Project) ProjectManager.getDefault().findProject(FileUtil.toFileObject(FileUtil.normalizeFile(projectDir)));
19.134 -
19.135 - // project is null for external source roots
19.136 - if (project!=null) {
19.137 - OpenProjects.getDefault().open(new Project[] { project },false);
19.138 - }
19.139 - } catch (IOException e) {
19.140 - System.err.println(NbBundle.getBundle(Constants.BUNDLE).getString("IO_error:_")+e);
19.141 - }
19.142 - }
19.143 - });
19.144 -
19.145 - if (!isSilent()) {
19.146 - handle.finish();
19.147 - } else {
19.148 - return;
19.149 - }
19.150 -
19.151 - String errorMsg = "";
19.152 - if (scheduledTasks.get("unzip-project")!=null && !((Boolean) status.get("unzip-project")).booleanValue()) {
19.153 - errorMsg+=NbBundle.getBundle(Constants.BUNDLE).getString("Could_not_unzip_project._Disk_error?");
19.154 - }
19.155 - if (scheduledTasks.get("delete-zip")!=null && !((Boolean) status.get("delete-zip")).booleanValue()) {
19.156 - errorMsg+=NbBundle.getBundle(Constants.BUNDLE).getString("Could_not_delete_zip.__Disk_not_writable?");
19.157 - }
19.158 - if (!errorMsg.equals("")) {
19.159 - NotifyDescriptor d = new NotifyDescriptor.Message(errorMsg, NotifyDescriptor.ERROR_MESSAGE);
19.160 - d.setTitle(NbBundle.getBundle(Constants.BUNDLE).getString("Error_during_processing_zips"));
19.161 - DialogDisplayer.getDefault().notify(d);
19.162 - } else {
19.163 - if (scheduledTasks.get("delete-zip")==null && scheduledTasks.get("unzip-project")!=null &&
19.164 - ((Boolean) scheduledTasks.get("unzip-project")).booleanValue()) {
19.165 - NotifyDescriptor d = new NotifyDescriptor.Message(NbBundle.getBundle(Constants.BUNDLE).getString("Project_imported_successfully."), NotifyDescriptor.INFORMATION_MESSAGE);
19.166 - d.setTitle(NbBundle.getBundle(Constants.BUNDLE).getString("Zip_importer_finished"));
19.167 - DialogDisplayer.getDefault().notify(d);
19.168 - return;
19.169 - }
19.170 - if (scheduledTasks.get("delete-zip")==null && scheduledTasks.get("unzip-renamed-project")!=null &&
19.171 - ((Boolean) scheduledTasks.get("unzip-renamed-project")).booleanValue()) {
19.172 - NotifyDescriptor d = new NotifyDescriptor.Message(NbBundle.getBundle(Constants.BUNDLE).getString("Project_imported_successfully."), NotifyDescriptor.INFORMATION_MESSAGE);
19.173 - d.setTitle(NbBundle.getBundle(Constants.BUNDLE).getString("Zip_importer_finished"));
19.174 - DialogDisplayer.getDefault().notify(d);
19.175 - return;
19.176 - }
19.177 - if (((Boolean) scheduledTasks.get("delete-zip")).booleanValue()) {
19.178 - NotifyDescriptor d = new NotifyDescriptor.Message(NbBundle.getBundle(Constants.BUNDLE).getString("Project_imported_successfully,_original_zip_deleted."), NotifyDescriptor.INFORMATION_MESSAGE);
19.179 - d.setTitle(NbBundle.getBundle(Constants.BUNDLE).getString("Zip_importer_finished"));
19.180 - DialogDisplayer.getDefault().notify(d);
19.181 - }
19.182 - }
19.183 - }
19.184 -
19.185 - /**
19.186 - * Schedules a task for import
19.187 - * @param script ant script
19.188 - * @param target targets for ant script
19.189 - * @param props ant script properties
19.190 - */
19.191 - public void schedule(FileObject script, String[] target, Properties props) {
19.192 - scripts.add(script);
19.193 - targets.add(target);
19.194 - properties.add(props);
19.195 - scheduledCount++;
19.196 - scheduledTasks.put(target[0], new Boolean(true));
19.197 - }
19.198 -
19.199 - /**
19.200 - * Show messages to user?
19.201 - * @return true if yes
19.202 - */
19.203 - public boolean isSilent() {
19.204 - return silent;
19.205 - }
19.206 -
19.207 - /**
19.208 - * Set showing messages to user
19.209 - * @param silent true if yes
19.210 - */
19.211 - public void setSilent(boolean silent) {
19.212 - this.silent = silent;
19.213 - }
19.214 -
19.215 -
19.216 -}
20.1 --- a/projectpackager/src/org/netbeans/modules/projectpackager/importer/ImportPackageInfo.java Fri Dec 09 12:45:32 2011 -0500
20.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
20.3 @@ -1,158 +0,0 @@
20.4 -/*
20.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
20.6 - *
20.7 - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
20.8 - *
20.9 - * The contents of this file are subject to the terms of either the GNU
20.10 - * General Public License Version 2 only ("GPL") or the Common
20.11 - * Development and Distribution License("CDDL") (collectively, the
20.12 - * "License"). You may not use this file except in compliance with the
20.13 - * License. You can obtain a copy of the License at
20.14 - * http://www.netbeans.org/cddl-gplv2.html
20.15 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
20.16 - * specific language governing permissions and limitations under the
20.17 - * License. When distributing the software, include this License Header
20.18 - * Notice in each file and include the License file at
20.19 - * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
20.20 - * particular file as subject to the "Classpath" exception as provided
20.21 - * by Sun in the GPL Version 2 section of the License file that
20.22 - * accompanied this code. If applicable, add the following below the
20.23 - * License Header, with the fields enclosed by brackets [] replaced by
20.24 - * your own identifying information:
20.25 - * "Portions Copyrighted [year] [name of copyright owner]"
20.26 - *
20.27 - * Contributor(s):
20.28 - *
20.29 - * The Original Software is NetBeans. The Initial Developer of the Original
20.30 - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
20.31 - * Microsystems, Inc. All Rights Reserved.
20.32 - *
20.33 - * If you wish your version of this file to be governed by only the CDDL
20.34 - * or only the GPL Version 2, indicate your decision by adding
20.35 - * "[Contributor] elects to include this software in this distribution
20.36 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
20.37 - * single choice of license, a recipient has the option to distribute
20.38 - * your version of this file under either the CDDL, the GPL Version 2 or
20.39 - * to extend the choice of license to its licensees as provided above.
20.40 - * However, if you add GPL Version 2 code and therefore, elected the GPL
20.41 - * Version 2 license, then the option applies only if the new code is
20.42 - * made subject to such option by the copyright holder.
20.43 - */
20.44 -
20.45 -package org.netbeans.modules.projectpackager.importer;
20.46 -
20.47 -/**
20.48 - * Data storage for information about import
20.49 - * @author Roman "Roumen" Strobl
20.50 - */
20.51 -public class ImportPackageInfo {
20.52 -
20.53 - // following properties remain static so that they are remembered during session
20.54 - private static String zip = "";
20.55 - private static String unzipDir = "";
20.56 - private static String projectName = "";
20.57 - private static boolean deleteZip = false;
20.58 - private static String originalName = "";
20.59 - private static boolean processed = false;
20.60 -
20.61 - /** Creates a new instance of PackageInfo */
20.62 - private ImportPackageInfo() {
20.63 - }
20.64 -
20.65 - /**
20.66 - * Is another import being processed?
20.67 - * @return true if processed
20.68 - */
20.69 - public static boolean isProcessed() {
20.70 - return processed;
20.71 - }
20.72 -
20.73 - /**
20.74 - * Set processing
20.75 - * @param aProcessed true for start, end for finish
20.76 - */
20.77 - public static void setProcessed(boolean aProcessed) {
20.78 - processed = aProcessed;
20.79 - }
20.80 -
20.81 - /**
20.82 - * Return path to zip
20.83 - * @return zip
20.84 - */
20.85 - public static String getZip() {
20.86 - return zip;
20.87 - }
20.88 -
20.89 - /**
20.90 - * Set path to zip
20.91 - * @param aZip path to zip
20.92 - */
20.93 - public static void setZip(String aZip) {
20.94 - zip = aZip;
20.95 - }
20.96 -
20.97 - /**
20.98 - * Return directory where to unzip
20.99 - * @return directory
20.100 - */
20.101 - public static String getUnzipDir() {
20.102 - return unzipDir;
20.103 - }
20.104 -
20.105 - /**
20.106 - * Set directory where to unzip
20.107 - * @param aUnzipDir directory
20.108 - */
20.109 - public static void setUnzipDir(String aUnzipDir) {
20.110 - unzipDir = aUnzipDir;
20.111 - }
20.112 -
20.113 - /**
20.114 - * Return project name
20.115 - * @return project name
20.116 - */
20.117 - public static String getProjectName() {
20.118 - return projectName;
20.119 - }
20.120 -
20.121 - /**
20.122 - * Set project name
20.123 - * @param aProjectName project name
20.124 - */
20.125 - public static void setProjectName(String aProjectName) {
20.126 - projectName = aProjectName;
20.127 - }
20.128 -
20.129 - /**
20.130 - * Is delete zip checked?
20.131 - * @return true if checked
20.132 - */
20.133 - public static boolean isDeleteZip() {
20.134 - return deleteZip;
20.135 - }
20.136 -
20.137 - /**
20.138 - * Set delete zip
20.139 - * @param aDeleteZip true if checked
20.140 - */
20.141 - public static void setDeleteZip(boolean aDeleteZip) {
20.142 - deleteZip = aDeleteZip;
20.143 - }
20.144 -
20.145 - /**
20.146 - * Get original name
20.147 - * @return original name
20.148 - */
20.149 - public static String getOriginalName() {
20.150 - return originalName;
20.151 - }
20.152 -
20.153 - /**
20.154 - * Set the original folder name for comparison
20.155 - * @param aOriginalName original name
20.156 - */
20.157 - public static void setOriginalName(String aOriginalName) {
20.158 - originalName = aOriginalName;
20.159 - }
20.160 -
20.161 -}
20.162 \ No newline at end of file
21.1 --- a/projectpackager/src/org/netbeans/modules/projectpackager/importer/ImportPackageScheduler.java Fri Dec 09 12:45:32 2011 -0500
21.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
21.3 @@ -1,113 +0,0 @@
21.4 -/*
21.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
21.6 - *
21.7 - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
21.8 - *
21.9 - * The contents of this file are subject to the terms of either the GNU
21.10 - * General Public License Version 2 only ("GPL") or the Common
21.11 - * Development and Distribution License("CDDL") (collectively, the
21.12 - * "License"). You may not use this file except in compliance with the
21.13 - * License. You can obtain a copy of the License at
21.14 - * http://www.netbeans.org/cddl-gplv2.html
21.15 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
21.16 - * specific language governing permissions and limitations under the
21.17 - * License. When distributing the software, include this License Header
21.18 - * Notice in each file and include the License file at
21.19 - * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
21.20 - * particular file as subject to the "Classpath" exception as provided
21.21 - * by Sun in the GPL Version 2 section of the License file that
21.22 - * accompanied this code. If applicable, add the following below the
21.23 - * License Header, with the fields enclosed by brackets [] replaced by
21.24 - * your own identifying information:
21.25 - * "Portions Copyrighted [year] [name of copyright owner]"
21.26 - *
21.27 - * Contributor(s):
21.28 - *
21.29 - * The Original Software is NetBeans. The Initial Developer of the Original
21.30 - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
21.31 - * Microsystems, Inc. All Rights Reserved.
21.32 - *
21.33 - * If you wish your version of this file to be governed by only the CDDL
21.34 - * or only the GPL Version 2, indicate your decision by adding
21.35 - * "[Contributor] elects to include this software in this distribution
21.36 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
21.37 - * single choice of license, a recipient has the option to distribute
21.38 - * your version of this file under either the CDDL, the GPL Version 2 or
21.39 - * to extend the choice of license to its licensees as provided above.
21.40 - * However, if you add GPL Version 2 code and therefore, elected the GPL
21.41 - * Version 2 license, then the option applies only if the new code is
21.42 - * made subject to such option by the copyright holder.
21.43 - */
21.44 -
21.45 -package org.netbeans.modules.projectpackager.importer;
21.46 -import java.io.IOException;
21.47 -import java.util.ArrayList;
21.48 -import java.util.Properties;
21.49 -import org.netbeans.modules.projectpackager.tools.Constants;
21.50 -import org.netbeans.modules.projectpackager.tools.ExecutionTools;
21.51 -import org.openide.filesystems.FileObject;
21.52 -import org.openide.util.NbBundle;
21.53 -
21.54 -/**
21.55 - * Scheduler of import tasks
21.56 - * @author Roman "Roumen" Strobl
21.57 - */
21.58 -public class ImportPackageScheduler {
21.59 -
21.60 - private static FileObject script;
21.61 - private static ArrayList fileList;
21.62 - private static ImportExecutorThread et;
21.63 -
21.64 - private static boolean initialized = false;
21.65 -
21.66 - private ImportPackageScheduler() {
21.67 - }
21.68 -
21.69 - /**
21.70 - * Initialize scheduler by creating an executor thread
21.71 - * @return executor thread
21.72 - */
21.73 - public static ImportExecutorThread init() {
21.74 - try {
21.75 - script = ExecutionTools.initScript("Services/ProjectPackager/import_script.xml");
21.76 - et = new ImportExecutorThread();
21.77 - initialized = true;
21.78 - } catch (IOException e) {
21.79 - System.err.println(NbBundle.getBundle(Constants.BUNDLE).getString("IO_error:_")+e);
21.80 - }
21.81 - return et;
21.82 - }
21.83 -
21.84 - /**
21.85 - * Schedule unzipping of project
21.86 - * @param et executor thread
21.87 - */
21.88 - public static void unZipProject(ImportExecutorThread et) {
21.89 - if (!initialized) return;
21.90 -
21.91 - if (ImportPackageInfo.getOriginalName().equals(ImportPackageInfo.getProjectName())) {
21.92 - Properties props = new Properties();
21.93 - props.setProperty("zip_file", ImportPackageInfo.getZip());
21.94 - props.setProperty("unzip_dir", ImportPackageInfo.getUnzipDir());
21.95 - et.schedule(script, new String[] {"unzip-project"}, props);
21.96 - } else {
21.97 - Properties props = new Properties();
21.98 - props.setProperty("zip_file", ImportPackageInfo.getZip());
21.99 - props.setProperty("unzip_dir", ImportPackageInfo.getUnzipDir());
21.100 - props.setProperty("orig_project_name", ImportPackageInfo.getOriginalName());
21.101 - props.setProperty("project_name", ImportPackageInfo.getProjectName());
21.102 - et.schedule(script, new String[] {"unzip-renamed-project"}, props);
21.103 - }
21.104 - }
21.105 -
21.106 - /**
21.107 - * Schedule deleting of zip
21.108 - * @param et executor thread
21.109 - */
21.110 - public static void deleteZip(ImportExecutorThread et) {
21.111 - if (!initialized) return;
21.112 - Properties props = new Properties();
21.113 - props.setProperty("file_to_delete", ImportPackageInfo.getZip());
21.114 - et.schedule(script, new String[] {"delete-zip"}, props);
21.115 - }
21.116 -}
22.1 --- a/projectpackager/src/org/netbeans/modules/projectpackager/importer/ImportPackageValidator.java Fri Dec 09 12:45:32 2011 -0500
22.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
22.3 @@ -1,112 +0,0 @@
22.4 -/*
22.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
22.6 - *
22.7 - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
22.8 - *
22.9 - * The contents of this file are subject to the terms of either the GNU
22.10 - * General Public License Version 2 only ("GPL") or the Common
22.11 - * Development and Distribution License("CDDL") (collectively, the
22.12 - * "License"). You may not use this file except in compliance with the
22.13 - * License. You can obtain a copy of the License at
22.14 - * http://www.netbeans.org/cddl-gplv2.html
22.15 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
22.16 - * specific language governing permissions and limitations under the
22.17 - * License. When distributing the software, include this License Header
22.18 - * Notice in each file and include the License file at
22.19 - * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
22.20 - * particular file as subject to the "Classpath" exception as provided
22.21 - * by Sun in the GPL Version 2 section of the License file that
22.22 - * accompanied this code. If applicable, add the following below the
22.23 - * License Header, with the fields enclosed by brackets [] replaced by
22.24 - * your own identifying information:
22.25 - * "Portions Copyrighted [year] [name of copyright owner]"
22.26 - *
22.27 - * Contributor(s):
22.28 - *
22.29 - * The Original Software is NetBeans. The Initial Developer of the Original
22.30 - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
22.31 - * Microsystems, Inc. All Rights Reserved.
22.32 - *
22.33 - * If you wish your version of this file to be governed by only the CDDL
22.34 - * or only the GPL Version 2, indicate your decision by adding
22.35 - * "[Contributor] elects to include this software in this distribution
22.36 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
22.37 - * single choice of license, a recipient has the option to distribute
22.38 - * your version of this file under either the CDDL, the GPL Version 2 or
22.39 - * to extend the choice of license to its licensees as provided above.
22.40 - * However, if you add GPL Version 2 code and therefore, elected the GPL
22.41 - * Version 2 license, then the option applies only if the new code is
22.42 - * made subject to such option by the copyright holder.
22.43 - */
22.44 -
22.45 -package org.netbeans.modules.projectpackager.importer;
22.46 -
22.47 -import java.io.File;
22.48 -import org.netbeans.modules.projectpackager.tools.Constants;
22.49 -import org.openide.DialogDisplayer;
22.50 -import org.openide.NotifyDescriptor;
22.51 -import org.openide.util.NbBundle;
22.52 -
22.53 -/**
22.54 - * Validator of import package
22.55 - * @author Roman "Roumen" Strobl
22.56 - */
22.57 -public class ImportPackageValidator {
22.58 -
22.59 - /** Creates a new instance of PackageValidator */
22.60 - private ImportPackageValidator() {
22.61 - }
22.62 -
22.63 - /**
22.64 - * Validates the import package
22.65 - * @return true if ok
22.66 - */
22.67 - public static boolean validate() {
22.68 - if (ImportPackageInfo.getZip().equals("")) {
22.69 - NotifyDescriptor d = new NotifyDescriptor.Message(NbBundle.getBundle(Constants.BUNDLE).getString("Please_choose_a_zip_file_with_project_to_import."), NotifyDescriptor.ERROR_MESSAGE);
22.70 - d.setTitle(NbBundle.getBundle(Constants.BUNDLE).getString("Error:_no_zip_selected"));
22.71 - DialogDisplayer.getDefault().notify(d);
22.72 - return false;
22.73 - }
22.74 -
22.75 - if (ImportPackageInfo.getUnzipDir().equals("")) {
22.76 - NotifyDescriptor d = new NotifyDescriptor.Message(NbBundle.getBundle(Constants.BUNDLE).getString("Please_specify_a_directory_where_to_unzip_project."), NotifyDescriptor.ERROR_MESSAGE);
22.77 - d.setTitle(NbBundle.getBundle(Constants.BUNDLE).getString("Error:_project_directory_not_specified"));
22.78 - DialogDisplayer.getDefault().notify(d);
22.79 - return false;
22.80 - }
22.81 -
22.82 - File projectDir = new File(ImportPackageInfo.getUnzipDir()+File.separator+ImportPackageInfo.getProjectName());
22.83 - if (projectDir.exists()) {
22.84 - NotifyDescriptor.InputLine d = new NotifyDescriptor.InputLine(NbBundle.getBundle(Constants.BUNDLE).getString("Project_directory_already_exists._Please_choose_a_different_directory."),
22.85 - NbBundle.getBundle(Constants.BUNDLE).getString("Error:_project_directory_exists"));
22.86 - d.setInputText(ImportPackageInfo.getOriginalName());
22.87 - DialogDisplayer.getDefault().notify(d);
22.88 - // new project folder name
22.89 - if (!d.getInputText().equals("")) {
22.90 - ImportPackageInfo.setProjectName(d.getInputText());
22.91 - // revalidate
22.92 - if (validate()) return true;
22.93 - }
22.94 - return false;
22.95 - }
22.96 -
22.97 - File target = new File(ImportPackageInfo.getUnzipDir());
22.98 - if (!target.canWrite()) {
22.99 - NotifyDescriptor d = new NotifyDescriptor.Message(NbBundle.getBundle(Constants.BUNDLE).getString("Project_directory_is_not_writable._Please_choose_a_different_directory."), NotifyDescriptor.ERROR_MESSAGE);
22.100 - d.setTitle(NbBundle.getBundle(Constants.BUNDLE).getString("Error:_project_directory_not_writable"));
22.101 - DialogDisplayer.getDefault().notify(d);
22.102 - return false;
22.103 - }
22.104 -
22.105 - if (ImportPackageInfo.getProjectName().equals("")) {
22.106 - NotifyDescriptor d = new NotifyDescriptor.Message(NbBundle.getBundle(Constants.BUNDLE).getString("Please_specify_a_non-empty_project_name."), NotifyDescriptor.ERROR_MESSAGE);
22.107 - d.setTitle(NbBundle.getBundle(Constants.BUNDLE).getString("Error:_empty_project_name"));
22.108 - DialogDisplayer.getDefault().notify(d);
22.109 - return false;
22.110 - }
22.111 -
22.112 - return true;
22.113 - }
22.114 -
22.115 -}
23.1 --- a/projectpackager/src/org/netbeans/modules/projectpackager/importer/ImportZip.java Fri Dec 09 12:45:32 2011 -0500
23.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
23.3 @@ -1,83 +0,0 @@
23.4 -/*
23.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
23.6 - *
23.7 - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
23.8 - *
23.9 - * The contents of this file are subject to the terms of either the GNU
23.10 - * General Public License Version 2 only ("GPL") or the Common
23.11 - * Development and Distribution License("CDDL") (collectively, the
23.12 - * "License"). You may not use this file except in compliance with the
23.13 - * License. You can obtain a copy of the License at
23.14 - * http://www.netbeans.org/cddl-gplv2.html
23.15 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
23.16 - * specific language governing permissions and limitations under the
23.17 - * License. When distributing the software, include this License Header
23.18 - * Notice in each file and include the License file at
23.19 - * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
23.20 - * particular file as subject to the "Classpath" exception as provided
23.21 - * by Sun in the GPL Version 2 section of the License file that
23.22 - * accompanied this code. If applicable, add the following below the
23.23 - * License Header, with the fields enclosed by brackets [] replaced by
23.24 - * your own identifying information:
23.25 - * "Portions Copyrighted [year] [name of copyright owner]"
23.26 - *
23.27 - * Contributor(s):
23.28 - *
23.29 - * The Original Software is NetBeans. The Initial Developer of the Original
23.30 - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
23.31 - * Microsystems, Inc. All Rights Reserved.
23.32 - *
23.33 - * If you wish your version of this file to be governed by only the CDDL
23.34 - * or only the GPL Version 2, indicate your decision by adding
23.35 - * "[Contributor] elects to include this software in this distribution
23.36 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
23.37 - * single choice of license, a recipient has the option to distribute
23.38 - * your version of this file under either the CDDL, the GPL Version 2 or
23.39 - * to extend the choice of license to its licensees as provided above.
23.40 - * However, if you add GPL Version 2 code and therefore, elected the GPL
23.41 - * Version 2 license, then the option applies only if the new code is
23.42 - * made subject to such option by the copyright holder.
23.43 - */
23.44 -
23.45 -package org.netbeans.modules.projectpackager.importer;
23.46 -
23.47 -import java.awt.event.ActionEvent;
23.48 -import java.awt.event.ActionListener;
23.49 -import org.netbeans.modules.projectpackager.tools.Constants;
23.50 -import org.openide.DialogDisplayer;
23.51 -import org.openide.NotifyDescriptor;
23.52 -import org.openide.awt.ActionID;
23.53 -import org.openide.awt.ActionReference;
23.54 -import org.openide.awt.ActionRegistration;
23.55 -import org.openide.util.NbBundle;
23.56 -
23.57 -/**
23.58 - * Main class of the import zip part, executed by an action registered in layer.xml
23.59 - * @author roman
23.60 - */
23.61 -@ActionID(id = "org.netbeans.modules.projectpackager.importer.ImportZip", category = "Tools")
23.62 -@ActionRegistration(displayName = "org.netbeans.modules.projectpackager.resources.Bundle#NetBeans_Project_from_Zip...", iconInMenu=false)
23.63 -@ActionReference(path = "Menu/File/Import", position = 1000)
23.64 -public class ImportZip implements ActionListener {
23.65 - private static ImportZipDialog izd;
23.66 -
23.67 - public @Override void actionPerformed(ActionEvent evt) {
23.68 - if (ImportPackageInfo.isProcessed()) {
23.69 - if (izd.isShowing()) {
23.70 - izd.requestFocus();
23.71 - return;
23.72 - } else {
23.73 - NotifyDescriptor d = new NotifyDescriptor.Message(NbBundle.getBundle(Constants.BUNDLE).getString("Another_instance_of_this_action_is_already_running._Please_wait_untill_it_finishes."), NotifyDescriptor.ERROR_MESSAGE);
23.74 - d.setTitle(NbBundle.getBundle(Constants.BUNDLE).getString("Error:_another_instance_is_running"));
23.75 - DialogDisplayer.getDefault().notify(d);
23.76 - return;
23.77 - }
23.78 - }
23.79 -
23.80 - ImportPackageInfo.setProcessed(true);
23.81 -
23.82 - izd = new ImportZipDialog();
23.83 - izd.setVisible(true);
23.84 - }
23.85 -
23.86 -}
24.1 --- a/projectpackager/src/org/netbeans/modules/projectpackager/importer/ImportZipDialog.form Fri Dec 09 12:45:32 2011 -0500
24.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
24.3 @@ -1,173 +0,0 @@
24.4 -<?xml version="1.0" encoding="UTF-8" ?>
24.5 -
24.6 -<Form version="1.3" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
24.7 - <Properties>
24.8 - <Property name="defaultCloseOperation" type="int" value="2"/>
24.9 - <Property name="title" type="java.lang.String" value="Import Project from Zip"/>
24.10 - <Property name="resizable" type="boolean" value="false"/>
24.11 - </Properties>
24.12 - <SyntheticProperties>
24.13 - <SyntheticProperty name="formSizePolicy" type="int" value="1"/>
24.14 - </SyntheticProperties>
24.15 - <AuxValues>
24.16 - <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
24.17 - <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
24.18 - <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
24.19 - <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
24.20 - </AuxValues>
24.21 -
24.22 - <Layout>
24.23 - <DimensionLayout dim="0">
24.24 - <Group type="103" groupAlignment="0" attributes="0">
24.25 - <Group type="102" attributes="0">
24.26 - <Group type="103" groupAlignment="0" attributes="0">
24.27 - <Group type="102" attributes="0">
24.28 - <EmptySpace max="-2" attributes="0"/>
24.29 - <Component id="projectZip" min="-2" max="-2" attributes="0"/>
24.30 - </Group>
24.31 - <Group type="102" alignment="0" attributes="0">
24.32 - <EmptySpace max="-2" attributes="0"/>
24.33 - <Component id="unzipToDirectory" min="-2" max="-2" attributes="0"/>
24.34 - </Group>
24.35 - <Group type="102" alignment="0" attributes="0">
24.36 - <Group type="103" groupAlignment="1" attributes="0">
24.37 - <Group type="102" alignment="1" attributes="0">
24.38 - <EmptySpace max="-2" attributes="0"/>
24.39 - <Component id="unzipToDirectoryField" min="-2" pref="225" max="-2" attributes="0"/>
24.40 - </Group>
24.41 - <Group type="102" alignment="0" attributes="0">
24.42 - <EmptySpace min="-2" pref="24" max="-2" attributes="0"/>
24.43 - <Component id="projectZipField" min="-2" pref="225" max="-2" attributes="0"/>
24.44 - </Group>
24.45 - </Group>
24.46 - <EmptySpace pref="17" max="32767" attributes="0"/>
24.47 - <Group type="103" groupAlignment="1" attributes="0">
24.48 - <Component id="zipChooseButton" min="-2" max="-2" attributes="0"/>
24.49 - <Component id="dirChooseButton" alignment="1" min="-2" max="-2" attributes="0"/>
24.50 - </Group>
24.51 - </Group>
24.52 - <Group type="102" alignment="0" attributes="0">
24.53 - <EmptySpace max="-2" attributes="0"/>
24.54 - <Component id="projectName" min="-2" max="-2" attributes="0"/>
24.55 - </Group>
24.56 - <Group type="102" alignment="0" attributes="0">
24.57 - <EmptySpace min="-2" pref="24" max="-2" attributes="0"/>
24.58 - <Component id="projectNameField" min="-2" pref="174" max="-2" attributes="0"/>
24.59 - </Group>
24.60 - <Group type="102" alignment="0" attributes="0">
24.61 - <EmptySpace max="-2" attributes="0"/>
24.62 - <Component id="deleteCheckBox" min="-2" max="-2" attributes="0"/>
24.63 - </Group>
24.64 - <Group type="102" alignment="1" attributes="0">
24.65 - <EmptySpace max="-2" attributes="0"/>
24.66 - <Component id="okButton" min="-2" pref="65" max="-2" attributes="0"/>
24.67 - <EmptySpace max="-2" attributes="0"/>
24.68 - <Component id="cancelButton" min="-2" max="-2" attributes="0"/>
24.69 - </Group>
24.70 - </Group>
24.71 - <EmptySpace max="-2" attributes="0"/>
24.72 - </Group>
24.73 - </Group>
24.74 - </DimensionLayout>
24.75 - <DimensionLayout dim="1">
24.76 - <Group type="103" groupAlignment="0" attributes="0">
24.77 - <Group type="102" alignment="0" attributes="0">
24.78 - <EmptySpace max="-2" attributes="0"/>
24.79 - <Component id="projectZip" min="-2" max="-2" attributes="0"/>
24.80 - <EmptySpace max="-2" attributes="0"/>
24.81 - <Group type="103" groupAlignment="3" attributes="0">
24.82 - <Component id="zipChooseButton" alignment="3" min="-2" max="-2" attributes="0"/>
24.83 - <Component id="projectZipField" alignment="3" min="-2" max="-2" attributes="0"/>
24.84 - </Group>
24.85 - <EmptySpace max="-2" attributes="0"/>
24.86 - <Component id="unzipToDirectory" min="-2" max="-2" attributes="0"/>
24.87 - <EmptySpace max="-2" attributes="0"/>
24.88 - <Group type="103" groupAlignment="3" attributes="0">
24.89 - <Component id="unzipToDirectoryField" alignment="3" min="-2" max="-2" attributes="0"/>
24.90 - <Component id="dirChooseButton" alignment="3" min="-2" max="-2" attributes="0"/>
24.91 - </Group>
24.92 - <EmptySpace max="-2" attributes="0"/>
24.93 - <Component id="projectName" min="-2" max="-2" attributes="0"/>
24.94 - <EmptySpace max="-2" attributes="0"/>
24.95 - <Component id="projectNameField" min="-2" max="-2" attributes="0"/>
24.96 - <EmptySpace max="-2" attributes="0"/>
24.97 - <Component id="deleteCheckBox" min="-2" max="-2" attributes="0"/>
24.98 - <EmptySpace pref="23" max="32767" attributes="0"/>
24.99 - <Group type="103" groupAlignment="3" attributes="0">
24.100 - <Component id="cancelButton" alignment="3" min="-2" max="-2" attributes="0"/>
24.101 - <Component id="okButton" alignment="3" min="-2" max="-2" attributes="0"/>
24.102 - </Group>
24.103 - <EmptySpace max="-2" attributes="0"/>
24.104 - </Group>
24.105 - </Group>
24.106 - </DimensionLayout>
24.107 - </Layout>
24.108 - <SubComponents>
24.109 - <Component class="javax.swing.JLabel" name="projectZip">
24.110 - <Properties>
24.111 - <Property name="text" type="java.lang.String" value="Project Zip:"/>
24.112 - </Properties>
24.113 - </Component>
24.114 - <Component class="javax.swing.JTextField" name="projectZipField">
24.115 - </Component>
24.116 - <Component class="javax.swing.JButton" name="zipChooseButton">
24.117 - <Properties>
24.118 - <Property name="text" type="java.lang.String" value="..."/>
24.119 - </Properties>
24.120 - <Events>
24.121 - <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="zipChooseButtonActionPerformed"/>
24.122 - </Events>
24.123 - </Component>
24.124 - <Component class="javax.swing.JLabel" name="unzipToDirectory">
24.125 - <Properties>
24.126 - <Property name="text" type="java.lang.String" value="Unzip to Directory:"/>
24.127 - </Properties>
24.128 - </Component>
24.129 - <Component class="javax.swing.JTextField" name="unzipToDirectoryField">
24.130 - </Component>
24.131 - <Component class="javax.swing.JButton" name="dirChooseButton">
24.132 - <Properties>
24.133 - <Property name="text" type="java.lang.String" value="..."/>
24.134 - </Properties>
24.135 - <Events>
24.136 - <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="dirChooseButtonActionPerformed"/>
24.137 - </Events>
24.138 - </Component>
24.139 - <Component class="javax.swing.JLabel" name="projectName">
24.140 - <Properties>
24.141 - <Property name="text" type="java.lang.String" value="Project Folder Name:"/>
24.142 - </Properties>
24.143 - </Component>
24.144 - <Component class="javax.swing.JTextField" name="projectNameField">
24.145 - </Component>
24.146 - <Component class="javax.swing.JCheckBox" name="deleteCheckBox">
24.147 - <Properties>
24.148 - <Property name="text" type="java.lang.String" value="Delete Zip After Import"/>
24.149 - <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
24.150 - <Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
24.151 - <EmptyBorder bottom="0" left="0" right="0" top="0"/>
24.152 - </Border>
24.153 - </Property>
24.154 - <Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
24.155 - <Insets value="[0, 0, 0, 0]"/>
24.156 - </Property>
24.157 - </Properties>
24.158 - </Component>
24.159 - <Component class="javax.swing.JButton" name="cancelButton">
24.160 - <Properties>
24.161 - <Property name="text" type="java.lang.String" value="Cancel"/>
24.162 - </Properties>
24.163 - <Events>
24.164 - <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cancelButtonActionPerformed"/>
24.165 - </Events>
24.166 - </Component>
24.167 - <Component class="javax.swing.JButton" name="okButton">
24.168 - <Properties>
24.169 - <Property name="text" type="java.lang.String" value="Ok"/>
24.170 - </Properties>
24.171 - <Events>
24.172 - <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="okButtonActionPerformed"/>
24.173 - </Events>
24.174 - </Component>
24.175 - </SubComponents>
24.176 -</Form>
25.1 --- a/projectpackager/src/org/netbeans/modules/projectpackager/importer/ImportZipDialog.java Fri Dec 09 12:45:32 2011 -0500
25.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
25.3 @@ -1,284 +0,0 @@
25.4 -/*
25.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
25.6 - *
25.7 - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
25.8 - *
25.9 - * The contents of this file are subject to the terms of either the GNU
25.10 - * General Public License Version 2 only ("GPL") or the Common
25.11 - * Development and Distribution License("CDDL") (collectively, the
25.12 - * "License"). You may not use this file except in compliance with the
25.13 - * License. You can obtain a copy of the License at
25.14 - * http://www.netbeans.org/cddl-gplv2.html
25.15 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
25.16 - * specific language governing permissions and limitations under the
25.17 - * License. When distributing the software, include this License Header
25.18 - * Notice in each file and include the License file at
25.19 - * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
25.20 - * particular file as subject to the "Classpath" exception as provided
25.21 - * by Sun in the GPL Version 2 section of the License file that
25.22 - * accompanied this code. If applicable, add the following below the
25.23 - * License Header, with the fields enclosed by brackets [] replaced by
25.24 - * your own identifying information:
25.25 - * "Portions Copyrighted [year] [name of copyright owner]"
25.26 - *
25.27 - * Contributor(s):
25.28 - *
25.29 - * The Original Software is NetBeans. The Initial Developer of the Original
25.30 - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
25.31 - * Microsystems, Inc. All Rights Reserved.
25.32 - *
25.33 - * If you wish your version of this file to be governed by only the CDDL
25.34 - * or only the GPL Version 2, indicate your decision by adding
25.35 - * "[Contributor] elects to include this software in this distribution
25.36 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
25.37 - * single choice of license, a recipient has the option to distribute
25.38 - * your version of this file under either the CDDL, the GPL Version 2 or
25.39 - * to extend the choice of license to its licensees as provided above.
25.40 - * However, if you add GPL Version 2 code and therefore, elected the GPL
25.41 - * Version 2 license, then the option applies only if the new code is
25.42 - * made subject to such option by the copyright holder.
25.43 - */
25.44 -
25.45 -package org.netbeans.modules.projectpackager.importer;
25.46 -
25.47 -import java.util.Vector;
25.48 -
25.49 -/**
25.50 - * Import zip dialog
25.51 - * @author Roman "Roumen" Strobl
25.52 - */
25.53 -public class ImportZipDialog extends javax.swing.JFrame {
25.54 - private Vector listData;
25.55 -
25.56 - /** Creates new form ZipProjectDialog */
25.57 - public ImportZipDialog() {
25.58 - initComponents();
25.59 - setLocationRelativeTo(null);
25.60 - ImportZipUITools.setZipProjectDialog(this);
25.61 - }
25.62 -
25.63 - /** This method is called from within the constructor to
25.64 - * initialize the form.
25.65 - * WARNING: Do NOT modify this code. The content of this method is
25.66 - * always regenerated by the Form Editor.
25.67 - */
25.68 - // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
25.69 - private void initComponents() {
25.70 - projectZip = new javax.swing.JLabel();
25.71 - projectZipField = new javax.swing.JTextField();
25.72 - zipChooseButton = new javax.swing.JButton();
25.73 - unzipToDirectory = new javax.swing.JLabel();
25.74 - unzipToDirectoryField = new javax.swing.JTextField();
25.75 - dirChooseButton = new javax.swing.JButton();
25.76 - projectName = new javax.swing.JLabel();
25.77 - projectNameField = new javax.swing.JTextField();
25.78 - deleteCheckBox = new javax.swing.JCheckBox();
25.79 - cancelButton = new javax.swing.JButton();
25.80 - okButton = new javax.swing.JButton();
25.81 -
25.82 - setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
25.83 - setTitle("Import Project from Zip");
25.84 - setResizable(false);
25.85 - projectZip.setText("Project Zip:");
25.86 -
25.87 - zipChooseButton.setText("...");
25.88 - zipChooseButton.addActionListener(new java.awt.event.ActionListener() {
25.89 - public void actionPerformed(java.awt.event.ActionEvent evt) {
25.90 - zipChooseButtonActionPerformed(evt);
25.91 - }
25.92 - });
25.93 -
25.94 - unzipToDirectory.setText("Unzip to Directory:");
25.95 -
25.96 - dirChooseButton.setText("...");
25.97 - dirChooseButton.addActionListener(new java.awt.event.ActionListener() {
25.98 - public void actionPerformed(java.awt.event.ActionEvent evt) {
25.99 - dirChooseButtonActionPerformed(evt);
25.100 - }
25.101 - });
25.102 -
25.103 - projectName.setText("Project Folder Name:");
25.104 -
25.105 - deleteCheckBox.setText("Delete Zip After Import");
25.106 - deleteCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
25.107 - deleteCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
25.108 -
25.109 - cancelButton.setText("Cancel");
25.110 - cancelButton.addActionListener(new java.awt.event.ActionListener() {
25.111 - public void actionPerformed(java.awt.event.ActionEvent evt) {
25.112 - cancelButtonActionPerformed(evt);
25.113 - }
25.114 - });
25.115 -
25.116 - okButton.setText("Ok");
25.117 - okButton.addActionListener(new java.awt.event.ActionListener() {
25.118 - public void actionPerformed(java.awt.event.ActionEvent evt) {
25.119 - okButtonActionPerformed(evt);
25.120 - }
25.121 - });
25.122 -
25.123 - org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
25.124 - getContentPane().setLayout(layout);
25.125 - layout.setHorizontalGroup(
25.126 - layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
25.127 - .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup()
25.128 - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
25.129 - .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup()
25.130 - .addContainerGap()
25.131 - .add(projectZip))
25.132 - .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup()
25.133 - .addContainerGap()
25.134 - .add(unzipToDirectory))
25.135 - .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup()
25.136 - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
25.137 - .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
25.138 - .addContainerGap()
25.139 - .add(unzipToDirectoryField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 225, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
25.140 - .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup()
25.141 - .add(24, 24, 24)
25.142 - .add(projectZipField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 225, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
25.143 - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 17, Short.MAX_VALUE)
25.144 - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
25.145 - .add(zipChooseButton)
25.146 - .add(dirChooseButton)))
25.147 - .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup()
25.148 - .addContainerGap()
25.149 - .add(projectName))
25.150 - .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup()
25.151 - .add(24, 24, 24)
25.152 - .add(projectNameField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 174, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
25.153 - .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup()
25.154 - .addContainerGap()
25.155 - .add(deleteCheckBox))
25.156 - .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
25.157 - .addContainerGap()
25.158 - .add(okButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 65, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
25.159 - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
25.160 - .add(cancelButton)))
25.161 - .addContainerGap())
25.162 - );
25.163 - layout.setVerticalGroup(
25.164 - layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
25.165 - .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup()
25.166 - .addContainerGap()
25.167 - .add(projectZip)
25.168 - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
25.169 - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
25.170 - .add(zipChooseButton)
25.171 - .add(projectZipField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
25.172 - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
25.173 - .add(unzipToDirectory)
25.174 - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
25.175 - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
25.176 - .add(unzipToDirectoryField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
25.177 - .add(dirChooseButton))
25.178 - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
25.179 - .add(projectName)
25.180 - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
25.181 - .add(projectNameField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
25.182 - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
25.183 - .add(deleteCheckBox)
25.184 - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 23, Short.MAX_VALUE)
25.185 - .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
25.186 - .add(cancelButton)
25.187 - .add(okButton))
25.188 - .addContainerGap())
25.189 - );
25.190 - pack();
25.191 - }
25.192 - // </editor-fold>//GEN-END:initComponents
25.193 -
25.194 - private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okButtonActionPerformed
25.195 - ImportZipUITools.processOkButton();
25.196 - }//GEN-LAST:event_okButtonActionPerformed
25.197 -
25.198 - private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed
25.199 - ImportZipUITools.processCancelButton();
25.200 - }//GEN-LAST:event_cancelButtonActionPerformed
25.201 -
25.202 - private void dirChooseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_dirChooseButtonActionPerformed
25.203 - ImportZipUITools.showDirectoryChooser();
25.204 - }//GEN-LAST:event_dirChooseButtonActionPerformed
25.205 -
25.206 - private void zipChooseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_zipChooseButtonActionPerformed
25.207 - ImportZipUITools.showFileChooser();
25.208 - }//GEN-LAST:event_zipChooseButtonActionPerformed
25.209 -
25.210 - /**
25.211 - * Set zip file
25.212 - * @param zip zip file
25.213 - */
25.214 - public void setZip(String zip) {
25.215 - projectZipField.setText(zip);
25.216 - }
25.217 -
25.218 - /**
25.219 - * Set unzip directory
25.220 - * @param zipDirectory directory
25.221 - */
25.222 - public void setUnZipDir(String zipDirectory) {
25.223 - unzipToDirectoryField.setText(zipDirectory);
25.224 - }
25.225 -
25.226 - /**
25.227 - * Set project name
25.228 - * @param name project name
25.229 - */
25.230 - public void setProjectName(String name) {
25.231 - projectNameField.setText(name);
25.232 - }
25.233 -
25.234 - /**
25.235 - * Return zip file
25.236 - * @return zip file
25.237 - */
25.238 - public String getZipFile() {
25.239 - return projectZipField.getText();
25.240 - }
25.241 -
25.242 - /**
25.243 - * Return unzip directory
25.244 - * @return directory
25.245 - */
25.246 - public String getUnzipDir() {
25.247 - return unzipToDirectoryField.getText();
25.248 - }
25.249 -
25.250 - /**
25.251 - * Is delete selected?
25.252 - * @return true if selected
25.253 - */
25.254 - public boolean isDeleteSelected() {
25.255 - return deleteCheckBox.isSelected();
25.256 - }
25.257 -
25.258 - /**
25.259 - * Return project name
25.260 - * @return project name
25.261 - */
25.262 - public String getProjectName() {
25.263 - return projectNameField.getText();
25.264 - }
25.265 -
25.266 - /**
25.267 - * Set project name label (used if it's a source root)
25.268 - */
25.269 - public void setProjectNameLabel(String label) {
25.270 - projectName.setText(label);
25.271 - }
25.272 -
25.273 - // Variables declaration - do not modify//GEN-BEGIN:variables
25.274 - private javax.swing.JButton cancelButton;
25.275 - private javax.swing.JCheckBox deleteCheckBox;
25.276 - private javax.swing.JButton dirChooseButton;
25.277 - private javax.swing.JButton okButton;
25.278 - private javax.swing.JLabel projectName;
25.279 - private javax.swing.JTextField projectNameField;
25.280 - private javax.swing.JLabel projectZip;
25.281 - private javax.swing.JTextField projectZipField;
25.282 - private javax.swing.JLabel unzipToDirectory;
25.283 - private javax.swing.JTextField unzipToDirectoryField;
25.284 - private javax.swing.JButton zipChooseButton;
25.285 - // End of variables declaration//GEN-END:variables
25.286 -
25.287 -}
26.1 --- a/projectpackager/src/org/netbeans/modules/projectpackager/importer/ImportZipUITools.java Fri Dec 09 12:45:32 2011 -0500
26.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
26.3 @@ -1,157 +0,0 @@
26.4 -/*
26.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
26.6 - *
26.7 - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
26.8 - *
26.9 - * The contents of this file are subject to the terms of either the GNU
26.10 - * General Public License Version 2 only ("GPL") or the Common
26.11 - * Development and Distribution License("CDDL") (collectively, the
26.12 - * "License"). You may not use this file except in compliance with the
26.13 - * License. You can obtain a copy of the License at
26.14 - * http://www.netbeans.org/cddl-gplv2.html
26.15 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
26.16 - * specific language governing permissions and limitations under the
26.17 - * License. When distributing the software, include this License Header
26.18 - * Notice in each file and include the License file at
26.19 - * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
26.20 - * particular file as subject to the "Classpath" exception as provided
26.21 - * by Sun in the GPL Version 2 section of the License file that
26.22 - * accompanied this code. If applicable, add the following below the
26.23 - * License Header, with the fields enclosed by brackets [] replaced by
26.24 - * your own identifying information:
26.25 - * "Portions Copyrighted [year] [name of copyright owner]"
26.26 - *
26.27 - * Contributor(s):
26.28 - *
26.29 - * The Original Software is NetBeans. The Initial Developer of the Original
26.30 - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
26.31 - * Microsystems, Inc. All Rights Reserved.
26.32 - *
26.33 - * If you wish your version of this file to be governed by only the CDDL
26.34 - * or only the GPL Version 2, indicate your decision by adding
26.35 - * "[Contributor] elects to include this software in this distribution
26.36 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
26.37 - * single choice of license, a recipient has the option to distribute
26.38 - * your version of this file under either the CDDL, the GPL Version 2 or
26.39 - * to extend the choice of license to its licensees as provided above.
26.40 - * However, if you add GPL Version 2 code and therefore, elected the GPL
26.41 - * Version 2 license, then the option applies only if the new code is
26.42 - * made subject to such option by the copyright holder.
26.43 - */
26.44 -
26.45 -package org.netbeans.modules.projectpackager.importer;
26.46 -
26.47 -import java.util.Enumeration;
26.48 -import java.util.Vector;
26.49 -import java.util.zip.ZipEntry;
26.50 -import java.util.zip.ZipFile;
26.51 -import javax.swing.JFileChooser;
26.52 -import org.netbeans.modules.projectpackager.tools.Constants;
26.53 -import org.netbeans.modules.projectpackager.tools.DirectoryFilter;
26.54 -import org.netbeans.modules.projectpackager.tools.ZipFilter;
26.55 -import org.openide.util.NbBundle;
26.56 -
26.57 -/**
26.58 - * Tools for Import Zip dialog
26.59 - * @author Roman "Roumen" Strobl
26.60 - */
26.61 -public class ImportZipUITools {
26.62 - private static ImportZipDialog izd;
26.63 - private static Vector listData;
26.64 -
26.65 - private ImportZipUITools() {
26.66 - }
26.67 -
26.68 - /**
26.69 - * Sets the reference to the Import zip project dialog
26.70 - * @param aizd import zip project dialog
26.71 - */
26.72 - public static void setZipProjectDialog(ImportZipDialog aizd) {
26.73 - izd = aizd;
26.74 - }
26.75 -
26.76 - /**
26.77 - * Shows file chooser for zip
26.78 - */
26.79 - public static void showFileChooser() {
26.80 - JFileChooser fc = new JFileChooser();
26.81 - String zip = "";
26.82 -
26.83 - fc.addChoosableFileFilter(new ZipFilter());
26.84 - fc.setFileSelectionMode(JFileChooser.FILES_ONLY);
26.85 -
26.86 - int returnVal = fc.showOpenDialog(izd);
26.87 - if(returnVal == JFileChooser.APPROVE_OPTION) {
26.88 - zip = fc.getSelectedFile().getAbsolutePath();
26.89 - }
26.90 - izd.setZip(zip);
26.91 - boolean isProject = false;
26.92 - if (fc.getSelectedFile()!=null) {
26.93 - String name = "";
26.94 - try {
26.95 - ZipFile zf = new ZipFile(fc.getSelectedFile());
26.96 - Enumeration zipEntries = zf.entries();
26.97 - name = ((ZipEntry)zipEntries.nextElement()).getName().split("/")[0];
26.98 - if (zf.getEntry(name+"/nbproject")!=null) isProject = true;
26.99 - } catch (Exception e) {
26.100 - // something's wrong so we just won't show the name
26.101 - }
26.102 - if (!isProject) {
26.103 - // seems to be a source root, change projectName
26.104 - izd.setProjectNameLabel(NbBundle.getBundle(Constants.BUNDLE).getString("Source_Root_Folder_Name"));
26.105 - }
26.106 - ImportPackageInfo.setOriginalName(name);
26.107 - izd.setProjectName(name);
26.108 - }
26.109 - }
26.110 -
26.111 - /**
26.112 - * Show directory chooser
26.113 - */
26.114 - public static void showDirectoryChooser() {
26.115 - JFileChooser fc = new JFileChooser();
26.116 - String zipDir = "";
26.117 -
26.118 - fc.addChoosableFileFilter(new DirectoryFilter());
26.119 - fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
26.120 -
26.121 - int returnVal = fc.showOpenDialog(izd);
26.122 - if(returnVal == JFileChooser.APPROVE_OPTION) {
26.123 - zipDir = fc.getSelectedFile().getAbsolutePath();
26.124 - }
26.125 - izd.setUnZipDir(zipDir);
26.126 - }
26.127 -
26.128 - /**
26.129 - * Processes Ok button - validates package, schedules tasks and executes them
26.130 - */
26.131 - public static void processOkButton() {
26.132 - ImportPackageInfo.setZip(izd.getZipFile());
26.133 - ImportPackageInfo.setProjectName(izd.getProjectName());
26.134 - ImportPackageInfo.setUnzipDir(izd.getUnzipDir());
26.135 - ImportPackageInfo.setDeleteZip(izd.isDeleteSelected());
26.136 -
26.137 - if (!ImportPackageValidator.validate()) {
26.138 - izd.requestFocus();
26.139 - return;
26.140 - }
26.141 -
26.142 - izd.dispose();
26.143 -
26.144 - ImportExecutorThread et = ImportPackageScheduler.init();
26.145 - ImportPackageScheduler.unZipProject(et);
26.146 - if (izd.isDeleteSelected()) {
26.147 - ImportPackageScheduler.deleteZip(et);
26.148 - }
26.149 - et.start();
26.150 - }
26.151 -
26.152 - /**
26.153 - * Processes cancel button - just dispose
26.154 - */
26.155 - public static void processCancelButton() {
26.156 - // we're done
26.157 - ImportPackageInfo.setProcessed(false);
26.158 - izd.dispose();
26.159 - }
26.160 -}
27.1 --- a/projectpackager/src/org/netbeans/modules/projectpackager/resources/Bundle.properties Fri Dec 09 12:45:32 2011 -0500
27.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
27.3 @@ -1,67 +0,0 @@
27.4 -OpenIDE-Module-Display-Category=Tools
27.5 -OpenIDE-Module-Long-Description=\
27.6 - Provides packaging of projects into ZIP archives and sending these ZIPs by e-mail. \
27.7 - Import back into the IDE is supported as well.
27.8 -OpenIDE-Module-Name=Project Packager
27.9 -OpenIDE-Module-Short-Description=Project packaging utility.
27.10 -
27.11 -Menu/File/Import=&Import Project
27.12 -Menu/File/Export=&Export Project
27.13 -
27.14 -Zip_Files=ZIP Files
27.15 -Mail_From_Default=projectpackager@netbeans.org
27.16 -Mail_Subject_Default=Zipped NetBeans projects
27.17 -Mail_Body_Default=Your projects are attached. Thank you for using NetBeans.
27.18 -Directories=Directories
27.19 -Processing_zips=Processing ZIPs
27.20 -Error\:_no_project_opened=Error\: no project opened
27.21 -No_projects_are_currently_opened._Please_open_at_least_one_project_and_re-run_exporter.=No projects are currently opened. Please open at least one project and re-run exporter.
27.22 -Error\:_another_instance_is_running=Error\: another instance is running
27.23 -Another_instance_of_this_action_is_already_running._Please_wait_untill_it_finishes.=Another instance of this action is already running. Please wait till it finishes.
27.24 -NetBeans_Project(s)_as_Zip...=NetBeans Project(s) as ZIP...
27.25 -SMTP_password\:=SMTP password\:
27.26 -Please_enter_password_for_SMTP_server=Please enter password for SMTP server
27.27 -Password_(optional)\:=Password\:
27.28 -Please_enter_username_for_SMTP_server=Please enter username for SMTP server
27.29 -Username_(optional)\:=Username\:
27.30 -Please_specify_a_SMTP_server=Please specify a SMTP server
27.31 -SMTP_server\:=SMTP server\:
27.32 -Error\:_no_e-mail_address=Error\: no e-mail address
27.33 -No_e-mail_address_specified._Please_fill_in_your_e-mail_address_in_the_dialog.=No e-mail address specified. Please fill in your e-mail address in the dialog.
27.34 -Archive_=Archive
27.35 -Error\:_target_directory_not_writable=Error\: target directory not writable
27.36 -Target_directory_is_not_writable._Please_choose_a_different_directory.=Target directory is not writable. Please choose a different directory.
27.37 -Error\:_target_directory_not_specified=Error\: target directory not specified
27.38 -Please_specify_a_directory_where_to_store_zip_files.=Please specify a directory where to store ZIP files.
27.39 -Error\:_no_project_selected=Error\: no project selected
27.40 -No_projects_were_chosen._Please_choose_at_least_one_project_in_the_dialog.=No projects were chosen. Please choose at least one project in the dialog.
27.41 -Zip(s)_created,_sent_and_deleted_successfully.=ZIP(s) created, sent and deleted successfully.
27.42 -Zip(s)_created_and_sent_successfully.=ZIP(s) created and sent successfully.
27.43 -Zip_exporter_finished=ZIP exporter finished
27.44 -Zip(s)_created_successfully.=ZIP(s) created successfully.
27.45 -Error_during_processing_zips=Error during processing ZIPs
27.46 -Could_not_delete_projects._Disk_not_writable?=Could not delete projects. Disk not writable?
27.47 -Could_not_send_e-mail._Check_SMTP_server_settings.=Could not send e-mail. Check SMTP server settings.
27.48 -Could_not_zip_projects._Disk_not_writable?=Could not zip projects. Disk not writable?
27.49 -IO_error\:_=IO error\:
27.50 -Task_execution_error_during_=Task execution error during
27.51 -Could_not_unzip_project._Disk_error?=Could not unzip project. Disk error?
27.52 -NetBeans_Project_from_Zip...=NetBeans Project from ZIP...
27.53 -Error\:_empty_project_name=Error\: empty project name
27.54 -Please_specify_a_non-empty_project_name.=Please specify a non-empty project name.
27.55 -Error\:_project_directory_not_writable=Error\: project directory not writable
27.56 -Project_directory_is_not_writable._Please_choose_a_different_directory.=Project directory is not writable. Please choose a different directory.
27.57 -Error\:_project_directory_exists=Error\: project directory exists
27.58 -Project_directory_already_exists._Please_choose_a_different_directory.=Specified directory already exists. New directory:
27.59 -Error\:_project_directory_not_specified=Error\: project directory not specified
27.60 -Please_specify_a_directory_where_to_unzip_project.=Please specify a directory where to unzip project.
27.61 -Error\:_no_zip_selected=Error\: no ZIP selected
27.62 -Please_choose_a_zip_file_with_project_to_import.=Please choose a ZIP file with project to import.
27.63 -Project_imported_successfully,_original_zip_deleted.=Project imported successfully, original ZIP deleted.
27.64 -Zip_importer_finished=ZIP importer finished
27.65 -Project_imported_successfully.=Project imported successfully.
27.66 -Could_not_delete_zip.__Disk_not_writable?=Could not delete ZIP. Disk not writable?
27.67 -external=external
27.68 -NotifyDescriptorInputPassword.dialog=The password dialog.
27.69 -NotifyDescriptorInputPassword.passwordField=The text field for the password.
27.70 -Source_Root_Folder_Name=Source Root Folder Name:
28.1 Binary file projectpackager/src/org/netbeans/modules/projectpackager/resources/ProjectPackagerIcon16.gif has changed
29.1 --- a/projectpackager/src/org/netbeans/modules/projectpackager/resources/export_script.xml Fri Dec 09 12:45:32 2011 -0500
29.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
29.3 @@ -1,74 +0,0 @@
29.4 -<?xml version="1.0" encoding="UTF-8"?>
29.5 -<!--
29.6 -
29.7 -DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
29.8 -
29.9 -Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
29.10 -
29.11 -
29.12 -The contents of this file are subject to the terms of either the GNU
29.13 -General Public License Version 2 only ("GPL") or the Common
29.14 -Development and Distribution License("CDDL") (collectively, the
29.15 -"License"). You may not use this file except in compliance with the
29.16 -License. You can obtain a copy of the License at
29.17 -http://www.netbeans.org/cddl-gplv2.html
29.18 -or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
29.19 -specific language governing permissions and limitations under the
29.20 -License. When distributing the software, include this License Header
29.21 -Notice in each file and include the License file at
29.22 -nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
29.23 -particular file as subject to the "Classpath" exception as provided
29.24 -by Sun in the GPL Version 2 section of the License file that
29.25 -accompanied this code. If applicable, add the following below the
29.26 -License Header, with the fields enclosed by brackets [] replaced by
29.27 -your own identifying information:
29.28 -"Portions Copyrighted [year] [name of copyright owner]"
29.29 -
29.30 -Contributor(s):
29.31 -
29.32 - The Original Software is NetBeans. The Initial Developer of the Original
29.33 -Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
29.34 - Microsystems, Inc. All Rights Reserved.
29.35 -
29.36 -If you wish your version of this file to be governed by only the CDDL
29.37 -or only the GPL Version 2, indicate your decision by adding
29.38 -"[Contributor] elects to include this software in this distribution
29.39 -under the [CDDL or GPL Version 2] license." If you do not indicate a
29.40 -single choice of license, a recipient has the option to distribute
29.41 -your version of this file under either the CDDL, the GPL Version 2 or
29.42 -to extend the choice of license to its licensees as provided above.
29.43 -However, if you add GPL Version 2 code and therefore, elected the GPL
29.44 -Version 2 license, then the option applies only if the new code is
29.45 -made subject to such option by the copyright holder.
29.46 -
29.47 --->
29.48 -<project name="ZipExporter" default="" basedir=".">
29.49 - <target name="zip-project">
29.50 - <zip destfile="${target_dir}/${zip_name}.zip"
29.51 - basedir="${src_dir}"
29.52 - includes="${dir_name}/**"
29.53 - excludes="${exclude_list}" />
29.54 - </target>
29.55 -
29.56 - <target name="mail-zips">
29.57 - <echo>Sending mail from ${mail_from} to ${to_addr}...</echo>
29.58 - <mail from="${mail_from}"
29.59 - subject="${mail_subject}"
29.60 - message="${mail_body}"
29.61 - tolist="${to_addr}"
29.62 - mailhost="${smtp_server}"
29.63 - user="${smtp_username}"
29.64 - password="${smtp_password}"
29.65 - ssl="${smtp_use_ssl}"
29.66 - mailport="${smtp_mailport}"
29.67 - >
29.68 - <fileset dir="${target_dir}">
29.69 - <include name="${file_list}"/>
29.70 - </fileset>
29.71 - </mail>
29.72 - </target>
29.73 -
29.74 - <target name="delete-zip">
29.75 - <delete file="${file_to_delete}"/>
29.76 - </target>
29.77 -</project>
30.1 --- a/projectpackager/src/org/netbeans/modules/projectpackager/resources/import_script.xml Fri Dec 09 12:45:32 2011 -0500
30.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
30.3 @@ -1,60 +0,0 @@
30.4 -<?xml version="1.0" encoding="UTF-8"?>
30.5 -<!--
30.6 -
30.7 -DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
30.8 -
30.9 -Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
30.10 -
30.11 -
30.12 -The contents of this file are subject to the terms of either the GNU
30.13 -General Public License Version 2 only ("GPL") or the Common
30.14 -Development and Distribution License("CDDL") (collectively, the
30.15 -"License"). You may not use this file except in compliance with the
30.16 -License. You can obtain a copy of the License at
30.17 -http://www.netbeans.org/cddl-gplv2.html
30.18 -or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
30.19 -specific language governing permissions and limitations under the
30.20 -License. When distributing the software, include this License Header
30.21 -Notice in each file and include the License file at
30.22 -nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
30.23 -particular file as subject to the "Classpath" exception as provided
30.24 -by Sun in the GPL Version 2 section of the License file that
30.25 -accompanied this code. If applicable, add the following below the
30.26 -License Header, with the fields enclosed by brackets [] replaced by
30.27 -your own identifying information:
30.28 -"Portions Copyrighted [year] [name of copyright owner]"
30.29 -
30.30 -Contributor(s):
30.31 -
30.32 - The Original Software is NetBeans. The Initial Developer of the Original
30.33 -Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
30.34 - Microsystems, Inc. All Rights Reserved.
30.35 -
30.36 -If you wish your version of this file to be governed by only the CDDL
30.37 -or only the GPL Version 2, indicate your decision by adding
30.38 -"[Contributor] elects to include this software in this distribution
30.39 -under the [CDDL or GPL Version 2] license." If you do not indicate a
30.40 -single choice of license, a recipient has the option to distribute
30.41 -your version of this file under either the CDDL, the GPL Version 2 or
30.42 -to extend the choice of license to its licensees as provided above.
30.43 -However, if you add GPL Version 2 code and therefore, elected the GPL
30.44 -Version 2 license, then the option applies only if the new code is
30.45 -made subject to such option by the copyright holder.
30.46 -
30.47 --->
30.48 -<project name="ZipImporter" default="" basedir=".">
30.49 - <target name="unzip-project">
30.50 - <unzip src="${zip_file}" dest="${unzip_dir}" />
30.51 - </target>
30.52 -
30.53 - <target name="unzip-renamed-project">
30.54 - <unzip src="${zip_file}" dest="${unzip_dir}/${project_name}" />
30.55 - <move todir="${unzip_dir}/${project_name}">
30.56 - <fileset dir="${unzip_dir}/${project_name}/${orig_project_name}" />
30.57 - </move>
30.58 - </target>
30.59 -
30.60 - <target name="delete-zip">
30.61 - <delete file="${file_to_delete}"/>
30.62 - </target>
30.63 -</project>
31.1 --- a/projectpackager/src/org/netbeans/modules/projectpackager/resources/layer.xml Fri Dec 09 12:45:32 2011 -0500
31.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
31.3 @@ -1,71 +0,0 @@
31.4 -<?xml version="1.0" encoding="UTF-8"?>
31.5 -<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.1//EN" "http://www.netbeans.org/dtds/filesystem-1_1.dtd">
31.6 -<!--
31.7 -
31.8 -DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
31.9 -
31.10 -Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
31.11 -
31.12 -
31.13 -The contents of this file are subject to the terms of either the GNU
31.14 -General Public License Version 2 only ("GPL") or the Common
31.15 -Development and Distribution License("CDDL") (collectively, the
31.16 -"License"). You may not use this file except in compliance with the
31.17 -License. You can obtain a copy of the License at
31.18 -http://www.netbeans.org/cddl-gplv2.html
31.19 -or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
31.20 -specific language governing permissions and limitations under the
31.21 -License. When distributing the software, include this License Header
31.22 -Notice in each file and include the License file at
31.23 -nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
31.24 -particular file as subject to the "Classpath" exception as provided
31.25 -by Sun in the GPL Version 2 section of the License file that
31.26 -accompanied this code. If applicable, add the following below the
31.27 -License Header, with the fields enclosed by brackets [] replaced by
31.28 -your own identifying information:
31.29 -"Portions Copyrighted [year] [name of copyright owner]"
31.30 -
31.31 -Contributor(s):
31.32 -
31.33 - The Original Software is NetBeans. The Initial Developer of the Original
31.34 -Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
31.35 - Microsystems, Inc. All Rights Reserved.
31.36 -
31.37 -If you wish your version of this file to be governed by only the CDDL
31.38 -or only the GPL Version 2, indicate your decision by adding
31.39 -"[Contributor] elects to include this software in this distribution
31.40 -under the [CDDL or GPL Version 2] license." If you do not indicate a
31.41 -single choice of license, a recipient has the option to distribute
31.42 -your version of this file under either the CDDL, the GPL Version 2 or
31.43 -to extend the choice of license to its licensees as provided above.
31.44 -However, if you add GPL Version 2 code and therefore, elected the GPL
31.45 -Version 2 license, then the option applies only if the new code is
31.46 -made subject to such option by the copyright holder.
31.47 -
31.48 --->
31.49 -<filesystem>
31.50 - <folder name="Menu">
31.51 - <folder name="File">
31.52 - <folder name="Import">
31.53 - <attr name="position" intvalue="1426"/>
31.54 - <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.projectpackager.resources.Bundle"/>
31.55 - <attr name="SystemFileSystem.icon" urlvalue="nbresloc:/org/openide/resources/actions/empty.gif"/>
31.56 - </folder>
31.57 - <folder name="Export">
31.58 - <attr name="position" intvalue="1428"/>
31.59 - <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.projectpackager.resources.Bundle"/>
31.60 - <attr name="SystemFileSystem.icon" urlvalue="nbresloc:/org/openide/resources/actions/empty.gif"/>
31.61 - </folder>
31.62 - <file name="ImporterSeparator1.instance">
31.63 - <attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>
31.64 - <attr name="position" intvalue="1430"/>
31.65 - </file>
31.66 - </folder>
31.67 - </folder>
31.68 - <folder name="Services">
31.69 - <folder name="ProjectPackager">
31.70 - <file name="export_script.xml" url="export_script.xml"/>
31.71 - <file name="import_script.xml" url="import_script.xml"/>
31.72 - </folder>
31.73 - </folder>
31.74 -</filesystem>
32.1 --- a/projectpackager/src/org/netbeans/modules/projectpackager/tools/Constants.java Fri Dec 09 12:45:32 2011 -0500
32.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
32.3 @@ -1,58 +0,0 @@
32.4 -/*
32.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
32.6 - *
32.7 - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
32.8 - *
32.9 - * The contents of this file are subject to the terms of either the GNU
32.10 - * General Public License Version 2 only ("GPL") or the Common
32.11 - * Development and Distribution License("CDDL") (collectively, the
32.12 - * "License"). You may not use this file except in compliance with the
32.13 - * License. You can obtain a copy of the License at
32.14 - * http://www.netbeans.org/cddl-gplv2.html
32.15 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
32.16 - * specific language governing permissions and limitations under the
32.17 - * License. When distributing the software, include this License Header
32.18 - * Notice in each file and include the License file at
32.19 - * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
32.20 - * particular file as subject to the "Classpath" exception as provided
32.21 - * by Sun in the GPL Version 2 section of the License file that
32.22 - * accompanied this code. If applicable, add the following below the
32.23 - * License Header, with the fields enclosed by brackets [] replaced by
32.24 - * your own identifying information:
32.25 - * "Portions Copyrighted [year] [name of copyright owner]"
32.26 - *
32.27 - * Contributor(s):
32.28 - *
32.29 - * The Original Software is NetBeans. The Initial Developer of the Original
32.30 - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
32.31 - * Microsystems, Inc. All Rights Reserved.
32.32 - *
32.33 - * If you wish your version of this file to be governed by only the CDDL
32.34 - * or only the GPL Version 2, indicate your decision by adding
32.35 - * "[Contributor] elects to include this software in this distribution
32.36 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
32.37 - * single choice of license, a recipient has the option to distribute
32.38 - * your version of this file under either the CDDL, the GPL Version 2 or
32.39 - * to extend the choice of license to its licensees as provided above.
32.40 - * However, if you add GPL Version 2 code and therefore, elected the GPL
32.41 - * Version 2 license, then the option applies only if the new code is
32.42 - * made subject to such option by the copyright holder.
32.43 - */
32.44 -
32.45 -package org.netbeans.modules.projectpackager.tools;
32.46 -
32.47 -/**
32.48 - * Serves to store constants for Project Packager
32.49 - * @author Roman "Roumen" Strobl
32.50 - */
32.51 -public class Constants {
32.52 -
32.53 - /**
32.54 - * Bundle
32.55 - */
32.56 - public static final String BUNDLE = "org.netbeans.modules.projectpackager.resources.Bundle"; // NOI18N
32.57 -
32.58 - private Constants() {
32.59 - }
32.60 -
32.61 -}
33.1 --- a/projectpackager/src/org/netbeans/modules/projectpackager/tools/DirectoryFilter.java Fri Dec 09 12:45:32 2011 -0500
33.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
33.3 @@ -1,75 +0,0 @@
33.4 -/*
33.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
33.6 - *
33.7 - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
33.8 - *
33.9 - * The contents of this file are subject to the terms of either the GNU
33.10 - * General Public License Version 2 only ("GPL") or the Common
33.11 - * Development and Distribution License("CDDL") (collectively, the
33.12 - * "License"). You may not use this file except in compliance with the
33.13 - * License. You can obtain a copy of the License at
33.14 - * http://www.netbeans.org/cddl-gplv2.html
33.15 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
33.16 - * specific language governing permissions and limitations under the
33.17 - * License. When distributing the software, include this License Header
33.18 - * Notice in each file and include the License file at
33.19 - * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
33.20 - * particular file as subject to the "Classpath" exception as provided
33.21 - * by Sun in the GPL Version 2 section of the License file that
33.22 - * accompanied this code. If applicable, add the following below the
33.23 - * License Header, with the fields enclosed by brackets [] replaced by
33.24 - * your own identifying information:
33.25 - * "Portions Copyrighted [year] [name of copyright owner]"
33.26 - *
33.27 - * Contributor(s):
33.28 - *
33.29 - * The Original Software is NetBeans. The Initial Developer of the Original
33.30 - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
33.31 - * Microsystems, Inc. All Rights Reserved.
33.32 - *
33.33 - * If you wish your version of this file to be governed by only the CDDL
33.34 - * or only the GPL Version 2, indicate your decision by adding
33.35 - * "[Contributor] elects to include this software in this distribution
33.36 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
33.37 - * single choice of license, a recipient has the option to distribute
33.38 - * your version of this file under either the CDDL, the GPL Version 2 or
33.39 - * to extend the choice of license to its licensees as provided above.
33.40 - * However, if you add GPL Version 2 code and therefore, elected the GPL
33.41 - * Version 2 license, then the option applies only if the new code is
33.42 - * made subject to such option by the copyright holder.
33.43 - */
33.44 -
33.45 -package org.netbeans.modules.projectpackager.tools;
33.46 -
33.47 -import java.io.File;
33.48 -import javax.swing.filechooser.FileFilter;
33.49 -import org.openide.util.NbBundle;
33.50 -
33.51 -/**
33.52 - * Filter to show only directories and zips, allow only directories
33.53 - * @author Roman "Roumen" Strobl
33.54 - */
33.55 -public class DirectoryFilter extends FileFilter {
33.56 -
33.57 - /**
33.58 - * Accept filter
33.59 - * @param f file
33.60 - * @return true if accepted
33.61 - */
33.62 - public boolean accept(File f) {
33.63 - if (f.isDirectory() || f.getName().endsWith(".zip")) {
33.64 - return true;
33.65 - } else {
33.66 - return false;
33.67 - }
33.68 - }
33.69 -
33.70 - //The description of this filter
33.71 - /**
33.72 - * Return description shown in dialog
33.73 - * @return description
33.74 - */
33.75 - public String getDescription() {
33.76 - return NbBundle.getBundle(Constants.BUNDLE).getString("Directories");
33.77 - }
33.78 -}
34.1 --- a/projectpackager/src/org/netbeans/modules/projectpackager/tools/ExecutionTools.java Fri Dec 09 12:45:32 2011 -0500
34.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
34.3 @@ -1,84 +0,0 @@
34.4 -/*
34.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
34.6 - *
34.7 - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
34.8 - *
34.9 - * The contents of this file are subject to the terms of either the GNU
34.10 - * General Public License Version 2 only ("GPL") or the Common
34.11 - * Development and Distribution License("CDDL") (collectively, the
34.12 - * "License"). You may not use this file except in compliance with the
34.13 - * License. You can obtain a copy of the License at
34.14 - * http://www.netbeans.org/cddl-gplv2.html
34.15 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
34.16 - * specific language governing permissions and limitations under the
34.17 - * License. When distributing the software, include this License Header
34.18 - * Notice in each file and include the License file at
34.19 - * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
34.20 - * particular file as subject to the "Classpath" exception as provided
34.21 - * by Sun in the GPL Version 2 section of the License file that
34.22 - * accompanied this code. If applicable, add the following below the
34.23 - * License Header, with the fields enclosed by brackets [] replaced by
34.24 - * your own identifying information:
34.25 - * "Portions Copyrighted [year] [name of copyright owner]"
34.26 - *
34.27 - * Contributor(s):
34.28 - *
34.29 - * The Original Software is NetBeans. The Initial Developer of the Original
34.30 - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
34.31 - * Microsystems, Inc. All Rights Reserved.
34.32 - *
34.33 - * If you wish your version of this file to be governed by only the CDDL
34.34 - * or only the GPL Version 2, indicate your decision by adding
34.35 - * "[Contributor] elects to include this software in this distribution
34.36 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
34.37 - * single choice of license, a recipient has the option to distribute
34.38 - * your version of this file under either the CDDL, the GPL Version 2 or
34.39 - * to extend the choice of license to its licensees as provided above.
34.40 - * However, if you add GPL Version 2 code and therefore, elected the GPL
34.41 - * Version 2 license, then the option applies only if the new code is
34.42 - * made subject to such option by the copyright holder.
34.43 - */
34.44 -
34.45 -package org.netbeans.modules.projectpackager.tools;
34.46 -
34.47 -import java.io.File;
34.48 -import java.io.FileWriter;
34.49 -import java.io.IOException;
34.50 -import java.io.InputStream;
34.51 -import org.openide.filesystems.FileObject;
34.52 -import org.openide.filesystems.FileUtil;
34.53 -
34.54 -/**
34.55 - * Tools for executing of ant scripts
34.56 - * @author Roman "Roumen" Strobl
34.57 - */
34.58 -public class ExecutionTools {
34.59 -
34.60 - private ExecutionTools() {
34.61 - }
34.62 -
34.63 - /**
34.64 - * Initialize an ant script according to the resource
34.65 - * @param resource resource from layer.xml
34.66 - * @return created temporary script
34.67 - * @throws java.io.IOException thrown when could not create script
34.68 - */
34.69 - public static FileObject initScript(String resource) throws IOException {
34.70 - FileObject script;
34.71 - FileObject sfo = FileUtil.getConfigFile(resource);
34.72 - File sf = File.createTempFile("project-packager","xml");
34.73 - sf.deleteOnExit();
34.74 - InputStream in = sfo.getInputStream();
34.75 -
34.76 - FileWriter out = new FileWriter(sf);
34.77 - // XXX FileUtil.copy
34.78 - int c;
34.79 - while ((c = in.read()) != -1)
34.80 - out.write(c);
34.81 - in.close();
34.82 - out.close();
34.83 -
34.84 - return FileUtil.toFileObject(FileUtil.normalizeFile(sf));
34.85 - }
34.86 -
34.87 -}
35.1 --- a/projectpackager/src/org/netbeans/modules/projectpackager/tools/NotifyDescriptorInputPassword.java Fri Dec 09 12:45:32 2011 -0500
35.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
35.3 @@ -1,142 +0,0 @@
35.4 -/*
35.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
35.6 - *
35.7 - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
35.8 - *
35.9 - * The contents of this file are subject to the terms of either the GNU
35.10 - * General Public License Version 2 only ("GPL") or the Common
35.11 - * Development and Distribution License("CDDL") (collectively, the
35.12 - * "License"). You may not use this file except in compliance with the
35.13 - * License. You can obtain a copy of the License at
35.14 - * http://www.netbeans.org/cddl-gplv2.html
35.15 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
35.16 - * specific language governing permissions and limitations under the
35.17 - * License. When distributing the software, include this License Header
35.18 - * Notice in each file and include the License file at
35.19 - * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
35.20 - * particular file as subject to the "Classpath" exception as provided
35.21 - * by Sun in the GPL Version 2 section of the License file that
35.22 - * accompanied this code. If applicable, add the following below the
35.23 - * License Header, with the fields enclosed by brackets [] replaced by
35.24 - * your own identifying information:
35.25 - * "Portions Copyrighted [year] [name of copyright owner]"
35.26 - *
35.27 - * Contributor(s):
35.28 - *
35.29 - * The Original Software is NetBeans. The Initial Developer of the Original
35.30 - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
35.31 - * Microsystems, Inc. All Rights Reserved.
35.32 - *
35.33 - * If you wish your version of this file to be governed by only the CDDL
35.34 - * or only the GPL Version 2, indicate your decision by adding
35.35 - * "[Contributor] elects to include this software in this distribution
35.36 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
35.37 - * single choice of license, a recipient has the option to distribute
35.38 - * your version of this file under either the CDDL, the GPL Version 2 or
35.39 - * to extend the choice of license to its licensees as provided above.
35.40 - * However, if you add GPL Version 2 code and therefore, elected the GPL
35.41 - * Version 2 license, then the option applies only if the new code is
35.42 - * made subject to such option by the copyright holder.
35.43 - */
35.44 -
35.45 -package org.netbeans.modules.projectpackager.tools;
35.46 -import java.awt.BorderLayout;
35.47 -import java.awt.Component;
35.48 -import javax.swing.JLabel;
35.49 -import javax.swing.JPanel;
35.50 -import javax.swing.JPasswordField;
35.51 -import javax.swing.border.CompoundBorder;
35.52 -import javax.swing.border.EmptyBorder;
35.53 -import org.openide.DialogDescriptor;
35.54 -import org.openide.util.NbBundle;
35.55 -
35.56 -/**
35.57 - * @author Roman "Roumen" Strobl
35.58 - */
35.59 -public class NotifyDescriptorInputPassword extends DialogDescriptor {
35.60 -
35.61 - private javax.swing.JPasswordField passwordField;
35.62 -
35.63 - /** Creates new NotifyDescriptorInputPassword */
35.64 - public NotifyDescriptorInputPassword (String text, String title) {
35.65 - this(text, title, null);
35.66 - }
35.67 -
35.68 - /** Creates new NotifyDescriptorInputPassword */
35.69 - public NotifyDescriptorInputPassword (String text, String title, String description) {
35.70 - this(text, title, null, description, new JPasswordField[1]);
35.71 - }
35.72 -
35.73 - /** Creates new NotifyDescriptorInputPassword */
35.74 - public NotifyDescriptorInputPassword (String text, String title, char mnemonic) {
35.75 - this(text, title, mnemonic, null);
35.76 - }
35.77 -
35.78 - /** Creates new NotifyDescriptorInputPassword */
35.79 - public NotifyDescriptorInputPassword (String text, String title, char mnemonic, String description) {
35.80 - this(text, title, new Character(mnemonic), description, new JPasswordField[1]);
35.81 - }
35.82 -
35.83 - /**
35.84 - * Use this constructor as a hack to set passwordField variable.
35.85 - */
35.86 - private NotifyDescriptorInputPassword (String text, String title, Character mnemonic,
35.87 - String description, JPasswordField[] passwordFieldPtr) {
35.88 - super (createDesign(text, description, mnemonic, passwordFieldPtr), title);
35.89 - this.passwordField = passwordFieldPtr[0];
35.90 - }
35.91 -
35.92 - private static Component createDesign (String text, String description, Character mnemonic,
35.93 - JPasswordField passwordFieldPtr[]) {
35.94 - JPanel panel = new JPanel();
35.95 - JLabel textLabel = new JLabel(text);
35.96 - textLabel.setBorder(new EmptyBorder(0, 0, 0, 10));
35.97 - panel.setLayout(new BorderLayout());
35.98 - panel.setBorder(new EmptyBorder(10, 10, 6, 6));
35.99 - if (description != null) {
35.100 - JLabel descriptionLabel = new JLabel(description);
35.101 - panel.add(descriptionLabel, BorderLayout.NORTH);
35.102 - descriptionLabel.setBorder(new CompoundBorder(descriptionLabel.getBorder(), new EmptyBorder(2, 0, 11, 0)));
35.103 - }
35.104 - panel.add("West", textLabel); // NOI18N
35.105 - javax.swing.JPasswordField passwordField = new javax.swing.JPasswordField (25);
35.106 - panel.add("Center", passwordField); // NOI18N
35.107 - passwordField.setBorder(new CompoundBorder(passwordField.getBorder(), new EmptyBorder(2, 0, 2, 0)));
35.108 - passwordField.requestFocus();
35.109 -
35.110 - javax.swing.KeyStroke enter = javax.swing.KeyStroke.getKeyStroke(
35.111 - java.awt.event.KeyEvent.VK_ENTER, 0
35.112 - );
35.113 - javax.swing.text.Keymap map = passwordField.getKeymap ();
35.114 -
35.115 - map.removeKeyStrokeBinding (enter);
35.116 - textLabel.setLabelFor(passwordField);
35.117 - panel.getAccessibleContext().setAccessibleDescription(
35.118 - NbBundle.getBundle(Constants.BUNDLE).getString("NotifyDescriptorInputPassword.dialog"));
35.119 - passwordField.getAccessibleContext().setAccessibleDescription(NbBundle.getBundle(Constants.BUNDLE).getString("NotifyDescriptorInputPassword.passwordField"));
35.120 - if (mnemonic != null) {
35.121 - textLabel.setDisplayedMnemonic(mnemonic.charValue());
35.122 - }
35.123 - passwordFieldPtr[0] = passwordField;
35.124 - return panel;
35.125 - }
35.126 -
35.127 - /**
35.128 - * Get the text which the user typed into the input line.
35.129 - * @return the text entered by the user
35.130 - */
35.131 - public String getInputText () {
35.132 - if(passwordField==null) {
35.133 - return ""; // NOI18N
35.134 - } else return new String(passwordField.getPassword ());
35.135 - }
35.136 -
35.137 - /**
35.138 - * Set the text on the input line.
35.139 - * @param text the new text
35.140 - */
35.141 - public void setInputText (String text) {
35.142 - passwordField.setText (text);
35.143 - }
35.144 -
35.145 -}
36.1 --- a/projectpackager/src/org/netbeans/modules/projectpackager/tools/ProjectPackagerSettings.java Fri Dec 09 12:45:32 2011 -0500
36.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
36.3 @@ -1,120 +0,0 @@
36.4 -/*
36.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
36.6 - *
36.7 - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
36.8 - *
36.9 - * The contents of this file are subject to the terms of either the GNU
36.10 - * General Public License Version 2 only ("GPL") or the Common
36.11 - * Development and Distribution License("CDDL") (collectively, the
36.12 - * "License"). You may not use this file except in compliance with the
36.13 - * License. You can obtain a copy of the License at
36.14 - * http://www.netbeans.org/cddl-gplv2.html
36.15 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
36.16 - * specific language governing permissions and limitations under the
36.17 - * License. When distributing the software, include this License Header
36.18 - * Notice in each file and include the License file at
36.19 - * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
36.20 - * particular file as subject to the "Classpath" exception as provided
36.21 - * by Sun in the GPL Version 2 section of the License file that
36.22 - * accompanied this code. If applicable, add the following below the
36.23 - * License Header, with the fields enclosed by brackets [] replaced by
36.24 - * your own identifying information:
36.25 - * "Portions Copyrighted [year] [name of copyright owner]"
36.26 - *
36.27 - * Contributor(s):
36.28 - *
36.29 - * The Original Software is NetBeans. The Initial Developer of the Original
36.30 - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
36.31 - * Microsystems, Inc. All Rights Reserved.
36.32 - *
36.33 - * If you wish your version of this file to be governed by only the CDDL
36.34 - * or only the GPL Version 2, indicate your decision by adding
36.35 - * "[Contributor] elects to include this software in this distribution
36.36 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
36.37 - * single choice of license, a recipient has the option to distribute
36.38 - * your version of this file under either the CDDL, the GPL Version 2 or
36.39 - * to extend the choice of license to its licensees as provided above.
36.40 - * However, if you add GPL Version 2 code and therefore, elected the GPL
36.41 - * Version 2 license, then the option applies only if the new code is
36.42 - * made subject to such option by the copyright holder.
36.43 - */
36.44 -
36.45 -package org.netbeans.modules.projectpackager.tools;
36.46 -
36.47 -import java.util.prefs.Preferences;
36.48 -import org.netbeans.api.keyring.Keyring;
36.49 -import org.openide.util.NbBundle;
36.50 -import org.openide.util.NbPreferences;
36.51 -
36.52 -/**
36.53 - * Settings of Project Packager
36.54 - * @author Roman "Roumen" Strobl
36.55 - */
36.56 -public class ProjectPackagerSettings {
36.57 -
36.58 - private static final String KEYRING_SMTP_PASSWORD = "org.netbeans.modules.projectpackager.smtpPassword";
36.59 -
36.60 - private static Preferences prefs() {
36.61 - return NbPreferences.forModule(ProjectPackagerSettings.class);
36.62 - }
36.63 -
36.64 - public static void setSmtpServer(String newVal) {
36.65 - prefs().put("smtpServer", newVal);
36.66 - }
36.67 - public static String getSmtpServer() {
36.68 - return prefs().get("smtpServer", System.getProperty("smtp_server", ""));
36.69 - }
36.70 -
36.71 - public static void setSmtpUsername(String newVal) {
36.72 - prefs().put("smtpUsername", newVal);
36.73 - }
36.74 - public static String getSmtpUsername() {
36.75 - return prefs().get("smtpUsername", System.getProperty("smtp_username", ""));
36.76 - }
36.77 -
36.78 - public static void setSmtpPassword(String newVal) {
36.79 - if (newVal == null || newVal.isEmpty()) {
36.80 - Keyring.delete(KEYRING_SMTP_PASSWORD);
36.81 - } else {
36.82 - Keyring.save(KEYRING_SMTP_PASSWORD, newVal.toCharArray(), null);
36.83 - }
36.84 - }
36.85 - public static String getSmtpPassword() {
36.86 - String old = prefs().get("smtpPassword", null);
36.87 - if (old != null) {
36.88 - setSmtpPassword(old);
36.89 - prefs().remove("smtpPassword");
36.90 - }
36.91 - char[] pwd = Keyring.read(KEYRING_SMTP_PASSWORD);
36.92 - return pwd != null ? new String(pwd) : "";
36.93 - }
36.94 -
36.95 - public static void setSmtpUseSSL(boolean newVal) {
36.96 - prefs().putBoolean("smtpUseSSL", newVal);
36.97 - }
36.98 - public static boolean getSmtpUseSSL() {
36.99 - return prefs().getBoolean("smtpUseSSL", Boolean.getBoolean("smtp_use_ssl"));
36.100 - }
36.101 -
36.102 - public static void setMailFrom(String newVal) {
36.103 - prefs().put("mailFrom", newVal);
36.104 - }
36.105 - public static String getMailFrom() {
36.106 - return prefs().get("mailFrom", NbBundle.getBundle(Constants.BUNDLE).getString("Mail_From_Default"));
36.107 - }
36.108 -
36.109 - public static void setMailSubject(String newVal) {
36.110 - prefs().put("mailSubject", newVal);
36.111 - }
36.112 - public static String getMailSubject() {
36.113 - return prefs().get("mailSubject", NbBundle.getBundle(Constants.BUNDLE).getString("Mail_Subject_Default"));
36.114 - }
36.115 -
36.116 - public static void setMailBody(String newVal) {
36.117 - prefs().put("mailBody", newVal);
36.118 - }
36.119 - public static String getMailBody() {
36.120 - return prefs().get("mailBody", NbBundle.getBundle(Constants.BUNDLE).getString("Mail_Body_Default"));
36.121 - }
36.122 -
36.123 -}
37.1 --- a/projectpackager/src/org/netbeans/modules/projectpackager/tools/ZipFilter.java Fri Dec 09 12:45:32 2011 -0500
37.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
37.3 @@ -1,75 +0,0 @@
37.4 -/*
37.5 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
37.6 - *
37.7 - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
37.8 - *
37.9 - * The contents of this file are subject to the terms of either the GNU
37.10 - * General Public License Version 2 only ("GPL") or the Common
37.11 - * Development and Distribution License("CDDL") (collectively, the
37.12 - * "License"). You may not use this file except in compliance with the
37.13 - * License. You can obtain a copy of the License at
37.14 - * http://www.netbeans.org/cddl-gplv2.html
37.15 - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
37.16 - * specific language governing permissions and limitations under the
37.17 - * License. When distributing the software, include this License Header
37.18 - * Notice in each file and include the License file at
37.19 - * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
37.20 - * particular file as subject to the "Classpath" exception as provided
37.21 - * by Sun in the GPL Version 2 section of the License file that
37.22 - * accompanied this code. If applicable, add the following below the
37.23 - * License Header, with the fields enclosed by brackets [] replaced by
37.24 - * your own identifying information:
37.25 - * "Portions Copyrighted [year] [name of copyright owner]"
37.26 - *
37.27 - * Contributor(s):
37.28 - *
37.29 - * The Original Software is NetBeans. The Initial Developer of the Original
37.30 - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
37.31 - * Microsystems, Inc. All Rights Reserved.
37.32 - *
37.33 - * If you wish your version of this file to be governed by only the CDDL
37.34 - * or only the GPL Version 2, indicate your decision by adding
37.35 - * "[Contributor] elects to include this software in this distribution
37.36 - * under the [CDDL or GPL Version 2] license." If you do not indicate a
37.37 - * single choice of license, a recipient has the option to distribute
37.38 - * your version of this file under either the CDDL, the GPL Version 2 or
37.39 - * to extend the choice of license to its licensees as provided above.
37.40 - * However, if you add GPL Version 2 code and therefore, elected the GPL
37.41 - * Version 2 license, then the option applies only if the new code is
37.42 - * made subject to such option by the copyright holder.
37.43 - */
37.44 -
37.45 -package org.netbeans.modules.projectpackager.tools;
37.46 -
37.47 -import java.io.File;
37.48 -import javax.swing.filechooser.FileFilter;
37.49 -import org.openide.util.NbBundle;
37.50 -
37.51 -/**
37.52 - * Filter to show only directories and zips, allow only zips
37.53 - * @author Roman "Roumen" Strobl
37.54 - */
37.55 -public class ZipFilter extends FileFilter {
37.56 -
37.57 - /**
37.58 - * Filter
37.59 - * @param f file
37.60 - * @return true if accepted
37.61 - */
37.62 - public boolean accept(File f) {
37.63 - if (f.isDirectory() || f.getName().endsWith(".zip")) {
37.64 - return true;
37.65 - } else {
37.66 - return false;
37.67 - }
37.68 - }
37.69 -
37.70 - //The description of this filter
37.71 - /**
37.72 - * Return description for the dialog
37.73 - * @return description
37.74 - */
37.75 - public String getDescription() {
37.76 - return NbBundle.getBundle(Constants.BUNDLE).getString("Zip_Files");
37.77 - }
37.78 -}