Revision 35
tags/org.gvsig.customize.app-1.0.2/pom.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
|
|
3 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
4 |
|
|
5 |
<modelVersion>4.0.0</modelVersion> |
|
6 |
<artifactId>org.gvsig.customize.app</artifactId> |
|
7 |
<packaging>pom</packaging> |
|
8 |
<name>${project.artifactId}</name> |
|
9 |
<version>1.0.2</version> |
|
10 |
<description>Customize some setting of gvSIG desktop</description> |
|
11 |
<parent> |
|
12 |
<groupId>org.gvsig</groupId> |
|
13 |
<artifactId>org.gvsig.desktop</artifactId> |
|
14 |
<version>2.0.101</version> |
|
15 |
</parent> |
|
16 |
<url>https://devel.gvsig.org/redmine/projects/gvsig-desktop-customize</url> |
|
17 |
|
|
18 |
<scm> |
|
19 |
<connection>scm:svn:https://devel.gvsig.org/svn/gvsig-desktop-customize/tags/org.gvsig.customize.app-1.0.2</connection> |
|
20 |
<developerConnection>scm:svn:https://devel.gvsig.org/svn/gvsig-desktop-customize/tags/org.gvsig.customize.app-1.0.2</developerConnection> |
|
21 |
<url>https://devel.gvsig.org/redmine/projects/gvsig-desktop-customize/repository/show/tags/org.gvsig.customize.app-1.0.2</url> |
|
22 |
</scm> |
|
23 |
<repositories> |
|
24 |
<repository> |
|
25 |
<id>gvsig-public-http-repository</id> |
|
26 |
<name>gvSIG maven public HTTP repository</name> |
|
27 |
<url>http://devel.gvsig.org/m2repo/j2se</url> |
|
28 |
<releases> |
|
29 |
<enabled>true</enabled> |
|
30 |
<updatePolicy>daily</updatePolicy> |
|
31 |
<checksumPolicy>warn</checksumPolicy> |
|
32 |
</releases> |
|
33 |
<snapshots> |
|
34 |
<enabled>true</enabled> |
|
35 |
<updatePolicy>daily</updatePolicy> |
|
36 |
<checksumPolicy>warn</checksumPolicy> |
|
37 |
</snapshots> |
|
38 |
</repository> |
|
39 |
</repositories> |
|
40 |
|
|
41 |
<build> |
|
42 |
<plugins> |
|
43 |
<plugin> |
|
44 |
<groupId>org.apache.maven.plugins</groupId> |
|
45 |
<artifactId>maven-release-plugin</artifactId> |
|
46 |
<configuration> |
|
47 |
<tagBase>https://devel.gvsig.org/svn/gvsig-desktop-customize/tags</tagBase> |
|
48 |
</configuration> |
|
49 |
</plugin> |
|
50 |
</plugins> |
|
51 |
</build> |
|
52 |
|
|
53 |
<modules> |
|
54 |
<module>org.gvsig.customize.app.mainplugin</module> |
|
55 |
</modules> |
|
56 |
|
|
57 |
</project> |
tags/org.gvsig.customize.app-1.0.2/org.gvsig.customize.app.mainplugin/buildNumber.properties | ||
---|---|---|
1 |
#Fri Jul 03 23:12:43 CEST 2015 |
|
2 |
buildNumber=7 |
tags/org.gvsig.customize.app-1.0.2/org.gvsig.customize.app.mainplugin/src/main/assembly/gvsig-plugin-package.xml | ||
---|---|---|
1 |
<!-- |
|
2 |
|
|
3 |
gvSIG. Desktop Geographic Information System. |
|
4 |
|
|
5 |
Copyright (C) 2007-2013 gvSIG Association. |
|
6 |
|
|
7 |
This program is free software; you can redistribute it and/or |
|
8 |
modify it under the terms of the GNU General Public License |
|
9 |
as published by the Free Software Foundation; either version 3 |
|
10 |
of the License, or (at your option) any later version. |
|
11 |
|
|
12 |
This program is distributed in the hope that it will be useful, |
|
13 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
14 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
15 |
GNU General Public License for more details. |
|
16 |
|
|
17 |
You should have received a copy of the GNU General Public License |
|
18 |
along with this program; if not, write to the Free Software |
|
19 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
20 |
MA 02110-1301, USA. |
|
21 |
|
|
22 |
For any additional information, do not hesitate to contact us |
|
23 |
at info AT gvsig.com, or visit our website www.gvsig.com. |
|
24 |
|
|
25 |
--> |
|
26 |
<assembly> |
|
27 |
<id>gvsig-plugin-package</id> |
|
28 |
<formats> |
|
29 |
<format>zip</format> |
|
30 |
</formats> |
|
31 |
<baseDirectory>${project.artifactId}</baseDirectory> |
|
32 |
<includeBaseDirectory>true</includeBaseDirectory> |
|
33 |
<files> |
|
34 |
<file> |
|
35 |
<source>target/${project.artifactId}-${project.version}.jar</source> |
|
36 |
<outputDirectory>lib</outputDirectory> |
|
37 |
</file> |
|
38 |
<file> |
|
39 |
<source>target/package.info</source> |
|
40 |
</file> |
|
41 |
</files> |
|
42 |
|
|
43 |
<fileSets> |
|
44 |
<fileSet> |
|
45 |
<directory>src/main/resources-plugin</directory> |
|
46 |
<outputDirectory>.</outputDirectory> |
|
47 |
</fileSet> |
|
48 |
</fileSets> |
|
49 |
|
|
50 |
|
|
51 |
<!-- |
|
52 |
Si le quito los comentarios y dejo la seccion includes vacia, me incluye |
|
53 |
si o si, todas depedencias, como si no hiciese caso del parametro |
|
54 |
useTransitiveDependencies |
|
55 |
<dependencySets> |
|
56 |
<dependencySet> |
|
57 |
<useProjectArtifact>false</useProjectArtifact> |
|
58 |
<useTransitiveDependencies>false</useTransitiveDependencies> |
|
59 |
<outputDirectory>lib</outputDirectory> |
|
60 |
<includes> |
|
61 |
</includes> |
|
62 |
</dependencySet> |
|
63 |
</dependencySets> |
|
64 |
--> |
|
65 |
|
|
66 |
</assembly> |
|
67 |
|
tags/org.gvsig.customize.app-1.0.2/org.gvsig.customize.app.mainplugin/src/main/java/org/gvsig/customize/DistributionParametersPanelLayout.java | ||
---|---|---|
1 |
/* |
|
2 |
* To change this license header, choose License Headers in Project Properties. |
|
3 |
* To change this template file, choose Tools | Templates |
|
4 |
* and open the template in the editor. |
|
5 |
*/ |
|
6 |
package org.gvsig.customize; |
|
7 |
|
|
8 |
/** |
|
9 |
* |
|
10 |
* @author jjdelcerro |
|
11 |
*/ |
|
12 |
public class DistributionParametersPanelLayout extends javax.swing.JPanel { |
|
13 |
|
|
14 |
/** |
|
15 |
* Creates new form DistributionPanelLayout |
|
16 |
*/ |
|
17 |
public DistributionParametersPanelLayout() { |
|
18 |
initComponents(); |
|
19 |
} |
|
20 |
|
|
21 |
/** |
|
22 |
* This method is called from within the constructor to initialize the form. |
|
23 |
* WARNING: Do NOT modify this code. The content of this method is always |
|
24 |
* regenerated by the Form Editor. |
|
25 |
*/ |
|
26 |
@SuppressWarnings("unchecked") |
|
27 |
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents |
|
28 |
private void initComponents() { |
|
29 |
java.awt.GridBagConstraints gridBagConstraints; |
|
30 |
|
|
31 |
filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(2, 2), new java.awt.Dimension(2, 2), new java.awt.Dimension(2, 2)); |
|
32 |
filler2 = new javax.swing.Box.Filler(new java.awt.Dimension(2, 2), new java.awt.Dimension(2, 2), new java.awt.Dimension(2, 2)); |
|
33 |
jTabbedPane1 = new javax.swing.JTabbedPane(); |
|
34 |
jPanel2 = new javax.swing.JPanel(); |
|
35 |
filler3 = new javax.swing.Box.Filler(new java.awt.Dimension(4, 4), new java.awt.Dimension(4, 4), new java.awt.Dimension(4, 4)); |
|
36 |
lblOnlineInstaller = new javax.swing.JLabel(); |
|
37 |
txtOnlineInstaller = new javax.swing.JTextField(); |
|
38 |
butBrowseOnlineInstaller = new javax.swing.JButton(); |
|
39 |
lblDistributionId = new javax.swing.JLabel(); |
|
40 |
txtDistributionId = new javax.swing.JTextField(); |
|
41 |
lblPackageSet = new javax.swing.JLabel(); |
|
42 |
txtPackageSet = new javax.swing.JTextField(); |
|
43 |
butBrowsePackageSet = new javax.swing.JButton(); |
|
44 |
lblWorkingFolder = new javax.swing.JLabel(); |
|
45 |
txtWorkingFolder = new javax.swing.JTextField(); |
|
46 |
butBrowseWorkingFolder = new javax.swing.JButton(); |
|
47 |
lblIncludeCustomizePlugin = new javax.swing.JLabel(); |
|
48 |
chkIncludeCustomizePlugin = new javax.swing.JCheckBox(); |
|
49 |
filler7 = new javax.swing.Box.Filler(new java.awt.Dimension(4, 4), new java.awt.Dimension(4, 4), new java.awt.Dimension(4, 4)); |
|
50 |
filler4 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 32767)); |
|
51 |
jPanel1 = new javax.swing.JPanel(); |
|
52 |
filler6 = new javax.swing.Box.Filler(new java.awt.Dimension(4, 4), new java.awt.Dimension(4, 4), new java.awt.Dimension(4, 4)); |
|
53 |
butAddPackage = new javax.swing.JButton(); |
|
54 |
butRemovePackage = new javax.swing.JButton(); |
|
55 |
jScrollPane2 = new javax.swing.JScrollPane(); |
|
56 |
lstPackages = new javax.swing.JList(); |
|
57 |
lblPackagesToInclude = new javax.swing.JLabel(); |
|
58 |
lblCheckToInstallByDefault = new javax.swing.JLabel(); |
|
59 |
filler9 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(32767, 0)); |
|
60 |
filler10 = new javax.swing.Box.Filler(new java.awt.Dimension(4, 4), new java.awt.Dimension(4, 4), new java.awt.Dimension(4, 4)); |
|
61 |
butCheckAll = new javax.swing.JButton(); |
|
62 |
butUncheckAll = new javax.swing.JButton(); |
|
63 |
butClose = new javax.swing.JButton(); |
|
64 |
butCreate = new javax.swing.JButton(); |
|
65 |
filler5 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(32767, 0)); |
|
66 |
lblMessages = new javax.swing.JLabel(); |
|
67 |
|
|
68 |
java.awt.GridBagLayout layout = new java.awt.GridBagLayout(); |
|
69 |
layout.columnWidths = new int[] {0, 5, 0, 5, 0, 5, 0, 5, 0}; |
|
70 |
layout.rowHeights = new int[] {0, 5, 0, 5, 0, 5, 0}; |
|
71 |
setLayout(layout); |
|
72 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
73 |
gridBagConstraints.gridx = 8; |
|
74 |
gridBagConstraints.gridy = 6; |
|
75 |
add(filler1, gridBagConstraints); |
|
76 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
77 |
gridBagConstraints.gridx = 0; |
|
78 |
gridBagConstraints.gridy = 0; |
|
79 |
add(filler6, gridBagConstraints); |
|
80 |
|
|
81 |
java.awt.GridBagLayout jPanel2Layout = new java.awt.GridBagLayout(); |
|
82 |
jPanel2Layout.columnWidths = new int[] {0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0}; |
|
83 |
jPanel2Layout.rowHeights = new int[] {0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0}; |
|
84 |
jPanel2.setLayout(jPanel2Layout); |
|
85 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
86 |
gridBagConstraints.gridx = 0; |
|
87 |
gridBagConstraints.gridy = 0; |
|
88 |
jPanel2.add(filler3, gridBagConstraints); |
|
89 |
|
|
90 |
lblOnlineInstaller.setText("Online installer"); |
|
91 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
92 |
gridBagConstraints.gridx = 2; |
|
93 |
gridBagConstraints.gridy = 4; |
|
94 |
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; |
|
95 |
jPanel2.add(lblOnlineInstaller, gridBagConstraints); |
|
96 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
97 |
gridBagConstraints.gridx = 4; |
|
98 |
gridBagConstraints.gridy = 4; |
|
99 |
gridBagConstraints.gridwidth = 5; |
|
100 |
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; |
|
101 |
gridBagConstraints.weightx = 0.1; |
|
102 |
jPanel2.add(txtOnlineInstaller, gridBagConstraints); |
|
103 |
|
|
104 |
butBrowseOnlineInstaller.setText("Browse..."); |
|
105 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
106 |
gridBagConstraints.gridx = 10; |
|
107 |
gridBagConstraints.gridy = 4; |
|
108 |
jPanel2.add(butBrowseOnlineInstaller, gridBagConstraints); |
|
109 |
|
|
110 |
lblDistributionId.setText("Distribution id"); |
|
111 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
112 |
gridBagConstraints.gridx = 2; |
|
113 |
gridBagConstraints.gridy = 2; |
|
114 |
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; |
|
115 |
jPanel2.add(lblDistributionId, gridBagConstraints); |
|
116 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
117 |
gridBagConstraints.gridx = 4; |
|
118 |
gridBagConstraints.gridy = 2; |
|
119 |
gridBagConstraints.gridwidth = 7; |
|
120 |
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; |
|
121 |
gridBagConstraints.weightx = 0.5; |
|
122 |
jPanel2.add(txtDistributionId, gridBagConstraints); |
|
123 |
|
|
124 |
lblPackageSet.setText("Package set"); |
|
125 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
126 |
gridBagConstraints.gridx = 2; |
|
127 |
gridBagConstraints.gridy = 6; |
|
128 |
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; |
|
129 |
jPanel2.add(lblPackageSet, gridBagConstraints); |
|
130 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
131 |
gridBagConstraints.gridx = 4; |
|
132 |
gridBagConstraints.gridy = 6; |
|
133 |
gridBagConstraints.gridwidth = 5; |
|
134 |
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; |
|
135 |
gridBagConstraints.weightx = 0.1; |
|
136 |
jPanel2.add(txtPackageSet, gridBagConstraints); |
|
137 |
|
|
138 |
butBrowsePackageSet.setText("Browse..."); |
|
139 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
140 |
gridBagConstraints.gridx = 10; |
|
141 |
gridBagConstraints.gridy = 6; |
|
142 |
jPanel2.add(butBrowsePackageSet, gridBagConstraints); |
|
143 |
|
|
144 |
lblWorkingFolder.setText("Working folder"); |
|
145 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
146 |
gridBagConstraints.gridx = 2; |
|
147 |
gridBagConstraints.gridy = 8; |
|
148 |
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; |
|
149 |
jPanel2.add(lblWorkingFolder, gridBagConstraints); |
|
150 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
151 |
gridBagConstraints.gridx = 4; |
|
152 |
gridBagConstraints.gridy = 8; |
|
153 |
gridBagConstraints.gridwidth = 5; |
|
154 |
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; |
|
155 |
gridBagConstraints.weightx = 0.1; |
|
156 |
jPanel2.add(txtWorkingFolder, gridBagConstraints); |
|
157 |
|
|
158 |
butBrowseWorkingFolder.setText("Browse..."); |
|
159 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
160 |
gridBagConstraints.gridx = 10; |
|
161 |
gridBagConstraints.gridy = 8; |
|
162 |
jPanel2.add(butBrowseWorkingFolder, gridBagConstraints); |
|
163 |
|
|
164 |
lblIncludeCustomizePlugin.setText("Include Customize Plugin"); |
|
165 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
166 |
gridBagConstraints.gridx = 2; |
|
167 |
gridBagConstraints.gridy = 10; |
|
168 |
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; |
|
169 |
jPanel2.add(lblIncludeCustomizePlugin, gridBagConstraints); |
|
170 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
171 |
gridBagConstraints.gridx = 4; |
|
172 |
gridBagConstraints.gridy = 10; |
|
173 |
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; |
|
174 |
jPanel2.add(chkIncludeCustomizePlugin, gridBagConstraints); |
|
175 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
176 |
gridBagConstraints.gridx = 12; |
|
177 |
gridBagConstraints.gridy = 12; |
|
178 |
jPanel2.add(filler7, gridBagConstraints); |
|
179 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
180 |
gridBagConstraints.gridx = 0; |
|
181 |
gridBagConstraints.gridy = 12; |
|
182 |
gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL; |
|
183 |
gridBagConstraints.weighty = 0.4; |
|
184 |
jPanel2.add(filler4, gridBagConstraints); |
|
185 |
|
|
186 |
jTabbedPane1.addTab("General", jPanel2); |
|
187 |
|
|
188 |
java.awt.GridBagLayout jPanel1Layout = new java.awt.GridBagLayout(); |
|
189 |
jPanel1Layout.columnWidths = new int[] {0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0}; |
|
190 |
jPanel1Layout.rowHeights = new int[] {0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0}; |
|
191 |
jPanel1.setLayout(jPanel1Layout); |
|
192 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
193 |
gridBagConstraints.gridx = 0; |
|
194 |
gridBagConstraints.gridy = 0; |
|
195 |
jPanel1.add(filler6, gridBagConstraints); |
|
196 |
|
|
197 |
butAddPackage.setText("Add"); |
|
198 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
199 |
gridBagConstraints.gridx = 8; |
|
200 |
gridBagConstraints.gridy = 8; |
|
201 |
jPanel1.add(butAddPackage, gridBagConstraints); |
|
202 |
|
|
203 |
butRemovePackage.setText("Remove"); |
|
204 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
205 |
gridBagConstraints.gridx = 10; |
|
206 |
gridBagConstraints.gridy = 8; |
|
207 |
jPanel1.add(butRemovePackage, gridBagConstraints); |
|
208 |
|
|
209 |
jScrollPane2.setViewportView(lstPackages); |
|
210 |
|
|
211 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
212 |
gridBagConstraints.gridx = 2; |
|
213 |
gridBagConstraints.gridy = 6; |
|
214 |
gridBagConstraints.gridwidth = 9; |
|
215 |
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; |
|
216 |
gridBagConstraints.weightx = 0.1; |
|
217 |
gridBagConstraints.weighty = 0.1; |
|
218 |
jPanel1.add(jScrollPane2, gridBagConstraints); |
|
219 |
|
|
220 |
lblPackagesToInclude.setText("Packages to include in the distribution"); |
|
221 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
222 |
gridBagConstraints.gridx = 2; |
|
223 |
gridBagConstraints.gridy = 2; |
|
224 |
gridBagConstraints.gridwidth = 5; |
|
225 |
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; |
|
226 |
jPanel1.add(lblPackagesToInclude, gridBagConstraints); |
|
227 |
|
|
228 |
lblCheckToInstallByDefault.setText("Check the pacakges to install by default"); |
|
229 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
230 |
gridBagConstraints.gridx = 2; |
|
231 |
gridBagConstraints.gridy = 4; |
|
232 |
gridBagConstraints.gridwidth = 5; |
|
233 |
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; |
|
234 |
jPanel1.add(lblCheckToInstallByDefault, gridBagConstraints); |
|
235 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
236 |
gridBagConstraints.gridx = 2; |
|
237 |
gridBagConstraints.gridy = 8; |
|
238 |
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; |
|
239 |
gridBagConstraints.weightx = 0.2; |
|
240 |
jPanel1.add(filler9, gridBagConstraints); |
|
241 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
242 |
gridBagConstraints.gridx = 12; |
|
243 |
gridBagConstraints.gridy = 10; |
|
244 |
jPanel1.add(filler10, gridBagConstraints); |
|
245 |
|
|
246 |
butCheckAll.setText("Check all"); |
|
247 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
248 |
gridBagConstraints.gridx = 6; |
|
249 |
gridBagConstraints.gridy = 8; |
|
250 |
jPanel1.add(butCheckAll, gridBagConstraints); |
|
251 |
|
|
252 |
butUncheckAll.setText("Uncheck all"); |
|
253 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
254 |
gridBagConstraints.gridx = 4; |
|
255 |
gridBagConstraints.gridy = 8; |
|
256 |
jPanel1.add(butUncheckAll, gridBagConstraints); |
|
257 |
|
|
258 |
jTabbedPane1.addTab("Package set", jPanel1); |
|
259 |
|
|
260 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
261 |
gridBagConstraints.gridx = 2; |
|
262 |
gridBagConstraints.gridy = 2; |
|
263 |
gridBagConstraints.gridwidth = 5; |
|
264 |
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; |
|
265 |
gridBagConstraints.weightx = 0.1; |
|
266 |
gridBagConstraints.weighty = 0.1; |
|
267 |
add(jTabbedPane1, gridBagConstraints); |
|
268 |
jTabbedPane1.getAccessibleContext().setAccessibleName("tab2"); |
|
269 |
|
|
270 |
butClose.setText("Close"); |
|
271 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
272 |
gridBagConstraints.gridx = 4; |
|
273 |
gridBagConstraints.gridy = 4; |
|
274 |
add(butClose, gridBagConstraints); |
|
275 |
|
|
276 |
butCreate.setText("Create"); |
|
277 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
278 |
gridBagConstraints.gridx = 6; |
|
279 |
gridBagConstraints.gridy = 4; |
|
280 |
add(butCreate, gridBagConstraints); |
|
281 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
282 |
gridBagConstraints.gridx = 2; |
|
283 |
gridBagConstraints.gridy = 4; |
|
284 |
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; |
|
285 |
gridBagConstraints.weightx = 0.3; |
|
286 |
add(filler5, gridBagConstraints); |
|
287 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
288 |
gridBagConstraints.gridx = 2; |
|
289 |
gridBagConstraints.gridy = 6; |
|
290 |
gridBagConstraints.gridwidth = 5; |
|
291 |
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; |
|
292 |
add(lblMessages, gridBagConstraints); |
|
293 |
}// </editor-fold>//GEN-END:initComponents |
|
294 |
|
|
295 |
|
|
296 |
// Variables declaration - do not modify//GEN-BEGIN:variables |
|
297 |
protected javax.swing.JButton butAddPackage; |
|
298 |
protected javax.swing.JButton butBrowseOnlineInstaller; |
|
299 |
protected javax.swing.JButton butBrowsePackageSet; |
|
300 |
protected javax.swing.JButton butBrowseWorkingFolder; |
|
301 |
protected javax.swing.JButton butCheckAll; |
|
302 |
protected javax.swing.JButton butClose; |
|
303 |
protected javax.swing.JButton butCreate; |
|
304 |
protected javax.swing.JButton butRemovePackage; |
|
305 |
protected javax.swing.JButton butUncheckAll; |
|
306 |
protected javax.swing.JCheckBox chkIncludeCustomizePlugin; |
|
307 |
protected javax.swing.Box.Filler filler1; |
|
308 |
protected javax.swing.Box.Filler filler10; |
|
309 |
protected javax.swing.Box.Filler filler2; |
|
310 |
protected javax.swing.Box.Filler filler3; |
|
311 |
protected javax.swing.Box.Filler filler4; |
|
312 |
protected javax.swing.Box.Filler filler5; |
|
313 |
protected javax.swing.Box.Filler filler6; |
|
314 |
protected javax.swing.Box.Filler filler7; |
|
315 |
protected javax.swing.Box.Filler filler9; |
|
316 |
protected javax.swing.JPanel jPanel1; |
|
317 |
protected javax.swing.JPanel jPanel2; |
|
318 |
protected javax.swing.JScrollPane jScrollPane2; |
|
319 |
protected javax.swing.JTabbedPane jTabbedPane1; |
|
320 |
protected javax.swing.JLabel lblCheckToInstallByDefault; |
|
321 |
protected javax.swing.JLabel lblDistributionId; |
|
322 |
protected javax.swing.JLabel lblIncludeCustomizePlugin; |
|
323 |
protected javax.swing.JLabel lblMessages; |
|
324 |
protected javax.swing.JLabel lblOnlineInstaller; |
|
325 |
protected javax.swing.JLabel lblPackageSet; |
|
326 |
protected javax.swing.JLabel lblPackagesToInclude; |
|
327 |
protected javax.swing.JLabel lblWorkingFolder; |
|
328 |
protected javax.swing.JList lstPackages; |
|
329 |
protected javax.swing.JTextField txtDistributionId; |
|
330 |
protected javax.swing.JTextField txtOnlineInstaller; |
|
331 |
protected javax.swing.JTextField txtPackageSet; |
|
332 |
protected javax.swing.JTextField txtWorkingFolder; |
|
333 |
// End of variables declaration//GEN-END:variables |
|
334 |
} |
tags/org.gvsig.customize.app-1.0.2/org.gvsig.customize.app.mainplugin/src/main/java/org/gvsig/customize/DistributionParametersPanel.java | ||
---|---|---|
1 |
package org.gvsig.customize; |
|
2 |
|
|
3 |
import java.awt.event.ActionEvent; |
|
4 |
import java.awt.event.ActionListener; |
|
5 |
import java.io.File; |
|
6 |
import java.io.FileOutputStream; |
|
7 |
import java.io.IOException; |
|
8 |
import java.nio.file.DirectoryIteratorException; |
|
9 |
import java.nio.file.DirectoryStream; |
|
10 |
import java.nio.file.FileSystem; |
|
11 |
import java.nio.file.FileSystems; |
|
12 |
import java.nio.file.Files; |
|
13 |
import java.nio.file.Path; |
|
14 |
import java.nio.file.Paths; |
|
15 |
import java.util.ArrayList; |
|
16 |
import java.util.Arrays; |
|
17 |
import java.util.Collections; |
|
18 |
import java.util.HashMap; |
|
19 |
import java.util.HashSet; |
|
20 |
import java.util.List; |
|
21 |
import java.util.Map; |
|
22 |
import java.util.Set; |
|
23 |
import javax.swing.DefaultListModel; |
|
24 |
import javax.swing.JTextField; |
|
25 |
import javax.swing.ListModel; |
|
26 |
import javax.swing.ListSelectionModel; |
|
27 |
import javax.swing.SwingUtilities; |
|
28 |
import javax.swing.event.ListSelectionEvent; |
|
29 |
import javax.swing.event.ListSelectionListener; |
|
30 |
import org.apache.commons.io.FileUtils; |
|
31 |
import org.apache.commons.io.IOUtils; |
|
32 |
import org.apache.commons.lang3.BooleanUtils; |
|
33 |
import org.apache.commons.lang3.StringUtils; |
|
34 |
import org.gvsig.andami.PluginServices; |
|
35 |
import org.gvsig.andami.PluginsLocator; |
|
36 |
import org.gvsig.andami.PluginsManager; |
|
37 |
import org.gvsig.app.ApplicationLocator; |
|
38 |
import org.gvsig.app.ApplicationManager; |
|
39 |
import org.gvsig.tools.dynobject.DynObject; |
|
40 |
import org.slf4j.Logger; |
|
41 |
import org.slf4j.LoggerFactory; |
|
42 |
|
|
43 |
public class DistributionParametersPanel extends DistributionParametersPanelLayout implements MessageBar { |
|
44 |
|
|
45 |
private static final Logger logger = LoggerFactory.getLogger(DistributionParametersPanel.class); |
|
46 |
|
|
47 |
private List<ActionListener> listeners = new ArrayList<ActionListener>(); |
|
48 |
private final DynObject pluginProperties; |
|
49 |
private final PluginServices plugin; |
|
50 |
private JListWithCheckbox lchkPackages; |
|
51 |
private Set<String> defaultPackages = new HashSet<String>(); |
|
52 |
|
|
53 |
public DistributionParametersPanel() { |
|
54 |
super(); |
|
55 |
PluginsManager pluginManager = PluginsLocator.getManager(); |
|
56 |
this.plugin = pluginManager.getPlugin(CustomizeExtension.class); |
|
57 |
this.pluginProperties = plugin.getPluginProperties(); |
|
58 |
this.initComponents(); |
|
59 |
} |
|
60 |
|
|
61 |
private String getPropertyPath(String name) { |
|
62 |
File f = (File) pluginProperties.getDynValue(name); |
|
63 |
if (f == null) { |
|
64 |
return ""; |
|
65 |
} |
|
66 |
return f.getAbsolutePath(); |
|
67 |
} |
|
68 |
|
|
69 |
private void initComponents() { |
|
70 |
this.lchkPackages = new JListWithCheckbox(this.lstPackages); |
|
71 |
|
|
72 |
this.setCloseAndCreateVisible(false); |
|
73 |
this.txtOnlineInstaller.setEditable(false); |
|
74 |
this.txtPackageSet.setEditable(false); |
|
75 |
this.txtWorkingFolder.setEditable(false); |
|
76 |
this.chkIncludeCustomizePlugin.setSelected(false); |
|
77 |
loadFormValues(); |
|
78 |
|
|
79 |
this.butBrowseOnlineInstaller.addActionListener(new ActionListener() { |
|
80 |
@Override |
|
81 |
public void actionPerformed(ActionEvent ae) { |
|
82 |
doBrowseFile(getOnlineInstaller(), "Select the online installer", txtOnlineInstaller); |
|
83 |
} |
|
84 |
}); |
|
85 |
this.butBrowsePackageSet.addActionListener(new ActionListener() { |
|
86 |
@Override |
|
87 |
public void actionPerformed(ActionEvent ae) { |
|
88 |
doBrowseFile(getPackageSetFolder(), "Select the package set", txtPackageSet); |
|
89 |
unzipPackagset(); |
|
90 |
} |
|
91 |
}); |
|
92 |
this.butBrowseWorkingFolder.addActionListener(new ActionListener() { |
|
93 |
@Override |
|
94 |
public void actionPerformed(ActionEvent ae) { |
|
95 |
doBrowseFolder(getWorkingFolder(), "Select the working folder", txtWorkingFolder); |
|
96 |
} |
|
97 |
}); |
|
98 |
this.butClose.addActionListener(new ActionListener() { |
|
99 |
@Override |
|
100 |
public void actionPerformed(ActionEvent ae) { |
|
101 |
doClose(); |
|
102 |
} |
|
103 |
}); |
|
104 |
this.butCreate.addActionListener(new ActionListener() { |
|
105 |
@Override |
|
106 |
public void actionPerformed(ActionEvent ae) { |
|
107 |
doCreate(); |
|
108 |
} |
|
109 |
}); |
|
110 |
this.butAddPackage.addActionListener(new ActionListener() { |
|
111 |
@Override |
|
112 |
public void actionPerformed(ActionEvent ae) { |
|
113 |
doAddPackage(); |
|
114 |
} |
|
115 |
}); |
|
116 |
this.butRemovePackage.addActionListener(new ActionListener() { |
|
117 |
@Override |
|
118 |
public void actionPerformed(ActionEvent ae) { |
|
119 |
doRemovePackage(); |
|
120 |
} |
|
121 |
}); |
|
122 |
this.lchkPackages.addChecksListener(new ListSelectionListener() { |
|
123 |
@Override |
|
124 |
public void valueChanged(ListSelectionEvent lse) { |
|
125 |
doChecksValueChanged(lse); |
|
126 |
} |
|
127 |
}); |
|
128 |
this.butCheckAll.addActionListener(new ActionListener() { |
|
129 |
@Override |
|
130 |
public void actionPerformed(ActionEvent ae) { |
|
131 |
doCheckAll(); |
|
132 |
} |
|
133 |
}); |
|
134 |
this.butUncheckAll.addActionListener(new ActionListener() { |
|
135 |
@Override |
|
136 |
public void actionPerformed(ActionEvent ae) { |
|
137 |
doUncheckAll(); |
|
138 |
} |
|
139 |
}); |
|
140 |
|
|
141 |
} |
|
142 |
|
|
143 |
private void doCheckAll() { |
|
144 |
ListModel model = this.lchkPackages.getModel(); |
|
145 |
this.lchkPackages.getCheckedModel().addSelectionInterval(0, model.getSize() - 1); |
|
146 |
for (int i = 0; i < model.getSize(); i++) { |
|
147 |
String filename = (String) model.getElementAt(i); |
|
148 |
String code = getPackageCode(filename); |
|
149 |
this.defaultPackages.add(code); |
|
150 |
} |
|
151 |
} |
|
152 |
|
|
153 |
private void doUncheckAll() { |
|
154 |
this.lchkPackages.getCheckedModel().clearSelection(); |
|
155 |
this.defaultPackages.clear(); |
|
156 |
} |
|
157 |
|
|
158 |
private void doChecksValueChanged(ListSelectionEvent lse) { |
|
159 |
ListSelectionModel checkedsModel = this.lchkPackages.getCheckedModel(); |
|
160 |
ListModel model = this.lchkPackages.getModel(); |
|
161 |
for (int i = lse.getFirstIndex(); i <= lse.getLastIndex(); i++) { |
|
162 |
String packageCode = getPackageCode((String) model.getElementAt(i)); |
|
163 |
if (checkedsModel.isSelectedIndex(i)) { |
|
164 |
this.defaultPackages.add(packageCode); |
|
165 |
} else { |
|
166 |
this.defaultPackages.remove(packageCode); |
|
167 |
} |
|
168 |
} |
|
169 |
} |
|
170 |
|
|
171 |
private void loadFormValues() { |
|
172 |
this.txtDistributionId.setText((String) pluginProperties.getDynValue("distributionID")); |
|
173 |
this.txtOnlineInstaller.setText(getPropertyPath("onlineInstaller")); |
|
174 |
this.txtPackageSet.setText(getPropertyPath("packageSet")); |
|
175 |
this.txtWorkingFolder.setText(getPropertyPath("WorkingFolder")); |
|
176 |
this.chkIncludeCustomizePlugin.setSelected(BooleanUtils.isTrue((Boolean) pluginProperties.getDynValue("includeCustomizePlugin"))); |
|
177 |
unzipPackagset(); |
|
178 |
fillPackageList(); |
|
179 |
} |
|
180 |
|
|
181 |
private void saveFormValues() { |
|
182 |
pluginProperties.setDynValue("onlineInstaller", getOnlineInstaller()); |
|
183 |
pluginProperties.setDynValue("packageSet", getPackageSet()); |
|
184 |
pluginProperties.setDynValue("WorkingFolder", getWorkingFolder()); |
|
185 |
pluginProperties.setDynValue("distributionID", getDistributionId()); |
|
186 |
pluginProperties.setDynValue("includeCustomizePlugin", getIncludeCustomizePlugin()); |
|
187 |
plugin.savePluginProperties(); |
|
188 |
} |
|
189 |
|
|
190 |
private void updateDefaultPackagesFile() { |
|
191 |
ArrayList lines = new ArrayList(); |
|
192 |
lines.addAll(this.defaultPackages); |
|
193 |
if (this.getIncludeCustomizePlugin()) { |
|
194 |
lines.add(this.plugin.getPluginName()); |
|
195 |
} |
|
196 |
Collections.sort(lines); |
|
197 |
try { |
|
198 |
FileUtils.writeLines( |
|
199 |
new File(this.getPackageSetFolder(), "defaultPackages"), |
|
200 |
lines |
|
201 |
); |
|
202 |
} catch (IOException ex) { |
|
203 |
this.message("Can't write defaultPackages. " + ex.getMessage()); |
|
204 |
logger.warn("Can't write defaultPackages.", ex); |
|
205 |
} |
|
206 |
} |
|
207 |
|
|
208 |
private void doCreate() { |
|
209 |
saveFormValues(); |
|
210 |
updateDefaultPackagesFile(); |
|
211 |
this.fireActionPerformed(); |
|
212 |
} |
|
213 |
|
|
214 |
private void doClose() { |
|
215 |
saveFormValues(); |
|
216 |
this.setVisible(false); |
|
217 |
} |
|
218 |
|
|
219 |
private void doBrowseFile(File currentValue, String label, JTextField field) { |
|
220 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
221 |
File folder = currentValue; |
|
222 |
if (folder != null) { |
|
223 |
folder = folder.getParentFile(); |
|
224 |
} |
|
225 |
File[] folders = application.showOpenFileDialog(label, folder); |
|
226 |
if (folders != null && folders.length == 1) { |
|
227 |
field.setText(folders[0].getAbsolutePath()); |
|
228 |
} |
|
229 |
} |
|
230 |
|
|
231 |
private void doBrowseFolder(File currentValue, String label, JTextField field) { |
|
232 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
233 |
File folder = currentValue; |
|
234 |
if (folder != null) { |
|
235 |
folder = folder.getParentFile(); |
|
236 |
} |
|
237 |
File[] folders = application.showOpenDirectoryDialog(label, folder); |
|
238 |
if (folders != null && folders.length == 1) { |
|
239 |
field.setText(folders[0].getAbsolutePath()); |
|
240 |
} |
|
241 |
} |
|
242 |
|
|
243 |
public void message(final String msg) { |
|
244 |
if (!SwingUtilities.isEventDispatchThread()) { |
|
245 |
SwingUtilities.invokeLater(new Runnable() { |
|
246 |
@Override |
|
247 |
public void run() { |
|
248 |
message(msg); |
|
249 |
} |
|
250 |
}); |
|
251 |
return; |
|
252 |
} |
|
253 |
this.lblMessages.setText("<html>" + msg.replace("\n", "<br>\n") + "</html>"); |
|
254 |
} |
|
255 |
|
|
256 |
public File getOnlineInstaller() { |
|
257 |
String path = this.txtOnlineInstaller.getText(); |
|
258 |
if (StringUtils.isBlank(path)) { |
|
259 |
return null; |
|
260 |
} |
|
261 |
return new File(path); |
|
262 |
} |
|
263 |
|
|
264 |
private File getPackageSet() { |
|
265 |
String path = this.txtPackageSet.getText(); |
|
266 |
if (StringUtils.isBlank(path)) { |
|
267 |
return null; |
|
268 |
} |
|
269 |
return new File(path); |
|
270 |
} |
|
271 |
|
|
272 |
public File getPackageSetFolder() { |
|
273 |
File packagesetFolder = new File(getWorkingFolder(), "packages"); |
|
274 |
return packagesetFolder; |
|
275 |
} |
|
276 |
|
|
277 |
public File getWorkingFolder() { |
|
278 |
String path = this.txtWorkingFolder.getText(); |
|
279 |
if (StringUtils.isBlank(path)) { |
|
280 |
return null; |
|
281 |
} |
|
282 |
return new File(path); |
|
283 |
} |
|
284 |
|
|
285 |
public String getDistributionId() { |
|
286 |
String id = this.txtDistributionId.getText(); |
|
287 |
if (StringUtils.isBlank(id)) { |
|
288 |
return null; |
|
289 |
} |
|
290 |
return id.trim(); |
|
291 |
} |
|
292 |
|
|
293 |
public boolean getIncludeCustomizePlugin() { |
|
294 |
return this.chkIncludeCustomizePlugin.isSelected(); |
|
295 |
} |
|
296 |
|
|
297 |
public void setCloseAndCreateVisible(boolean visible) { |
|
298 |
this.butClose.setVisible(visible); |
|
299 |
this.butCreate.setVisible(visible); |
|
300 |
} |
|
301 |
|
|
302 |
public void setCloseAndCreateEnabled(final boolean enabled) { |
|
303 |
if (!SwingUtilities.isEventDispatchThread()) { |
|
304 |
SwingUtilities.invokeLater(new Runnable() { |
|
305 |
@Override |
|
306 |
public void run() { |
|
307 |
setCloseAndCreateEnabled(enabled); |
|
308 |
} |
|
309 |
}); |
|
310 |
return; |
|
311 |
} |
|
312 |
this.butClose.setEnabled(enabled); |
|
313 |
this.butCreate.setEnabled(enabled); |
|
314 |
} |
|
315 |
|
|
316 |
public void addActionListener(ActionListener l) { |
|
317 |
if (this.listeners.contains(l)) { |
|
318 |
return; |
|
319 |
} |
|
320 |
this.listeners.add(l); |
|
321 |
} |
|
322 |
|
|
323 |
protected void fireActionPerformed() { |
|
324 |
ActionEvent event = new ActionEvent(this, 0, "create_distribution"); |
|
325 |
|
|
326 |
for (ActionListener listener : listeners) { |
|
327 |
try { |
|
328 |
listener.actionPerformed(event); |
|
329 |
} catch (Exception ex) { |
|
330 |
logger.warn("Error triggering event", ex); |
|
331 |
} |
|
332 |
} |
|
333 |
} |
|
334 |
|
|
335 |
private void loadDefaultPackages(File packages) { |
|
336 |
message("Loading default packages information"); |
|
337 |
try { |
|
338 |
this.defaultPackages = new HashSet<String>(); |
|
339 |
|
|
340 |
List<String> lines = FileUtils.readLines(packages); |
|
341 |
this.defaultPackages.clear(); |
|
342 |
for (String line : lines) { |
|
343 |
line = line.trim(); |
|
344 |
if (line.startsWith("#") || line.startsWith(";")) { |
|
345 |
continue; |
|
346 |
} |
|
347 |
this.defaultPackages.add(line.toLowerCase()); |
|
348 |
} |
|
349 |
} catch (IOException ex) { |
|
350 |
logger.warn("Can't load defaultPackages from '" + packages.getAbsolutePath() + "'.", ex); |
|
351 |
} finally { |
|
352 |
message(""); |
|
353 |
} |
|
354 |
} |
|
355 |
|
|
356 |
private String getPackageCode(String filename) { |
|
357 |
if (StringUtils.isEmpty(filename)) { |
|
358 |
return filename; |
|
359 |
} |
|
360 |
String[] ss = filename.split("-"); |
|
361 |
if (ss.length > 3) { |
|
362 |
return ss[3].toLowerCase(); |
|
363 |
} |
|
364 |
return ""; |
|
365 |
} |
|
366 |
|
|
367 |
private void fillPackageList() { |
|
368 |
File f = this.getWorkingFolder(); |
|
369 |
if (f == null) { |
|
370 |
return; |
|
371 |
} |
|
372 |
DefaultListModel model = new DefaultListModel(); |
|
373 |
int first = this.lchkPackages.getFirstVisibleIndex(); |
|
374 |
File packagesetFolder = new File(f, "packages"); |
|
375 |
if (packagesetFolder.exists()) { |
|
376 |
File[] packagesArray = packagesetFolder.listFiles(); |
|
377 |
List<File> packages = Arrays.asList(packagesArray); |
|
378 |
Collections.sort(packages); |
|
379 |
for (File package1 : packages) { |
|
380 |
String filename = package1.getName(); |
|
381 |
if (!"defaultPackages".equalsIgnoreCase(filename)) { |
|
382 |
model.addElement(filename); |
|
383 |
} |
|
384 |
} |
|
385 |
} |
|
386 |
this.lchkPackages.setModel(model); |
|
387 |
updateCheckeds(); |
|
388 |
this.lchkPackages.ensureIndexIsVisible(first); |
|
389 |
} |
|
390 |
|
|
391 |
private void updateCheckeds() { |
|
392 |
this.lchkPackages.getCheckedModel().clearSelection(); |
|
393 |
ListModel model = this.lchkPackages.getModel(); |
|
394 |
for (int i = 0; i < model.getSize(); i++) { |
|
395 |
String filename = (String) model.getElementAt(i); |
|
396 |
String code = getPackageCode(filename); |
|
397 |
if (this.defaultPackages.contains(code)) { |
|
398 |
this.lchkPackages.getCheckedModel().addSelectionInterval(i, i); |
|
399 |
} |
|
400 |
} |
|
401 |
} |
|
402 |
|
|
403 |
private void unzipPackagset() { |
|
404 |
final Runnable updategui = new Runnable() { |
|
405 |
|
|
406 |
@Override |
|
407 |
public void run() { |
|
408 |
fillPackageList(); |
|
409 |
updateCheckeds(); |
|
410 |
lchkPackages.setEnabled(true); |
|
411 |
butBrowsePackageSet.setEnabled(true); |
|
412 |
butAddPackage.setEnabled(true); |
|
413 |
butRemovePackage.setEnabled(true); |
|
414 |
butClose.setEnabled(true); |
|
415 |
butCreate.setEnabled(true); |
|
416 |
} |
|
417 |
}; |
|
418 |
final Runnable task = new Runnable() { |
|
419 |
|
|
420 |
@Override |
|
421 |
public void run() { |
|
422 |
FileSystem zipfs = null; |
|
423 |
try { |
|
424 |
File packageSet = getPackageSet(); |
|
425 |
if (packageSet == null) { |
|
426 |
return; |
|
427 |
} |
|
428 |
if (getWorkingFolder() == null) { |
|
429 |
return; |
|
430 |
} |
|
431 |
|
|
432 |
message("Updating package set"); |
|
433 |
File packagesetFolder = getPackageSetFolder(); |
|
434 |
if (packagesetFolder.exists()) { |
|
435 |
try { |
|
436 |
FileUtils.deleteDirectory(packagesetFolder); |
|
437 |
} catch (IOException ex) { |
|
438 |
message("Can't delete 'packages' directory. " + ex.getMessage()); |
|
439 |
} |
|
440 |
} |
|
441 |
packagesetFolder.mkdir(); |
|
442 |
|
|
443 |
Map<String, String> env = new HashMap<>(); |
|
444 |
env.put("create", "true"); |
|
445 |
|
|
446 |
Path zippath = Paths.get(packageSet.getAbsolutePath()); |
|
447 |
zipfs = FileSystems.newFileSystem(zippath, null); |
|
448 |
Iterable<Path> dirs = zipfs.getRootDirectories(); |
|
449 |
for (Path name : dirs) { |
|
450 |
DirectoryStream<Path> stream = Files.newDirectoryStream(name); |
|
451 |
for (Path file : stream) { |
|
452 |
FileOutputStream fos = null; |
|
453 |
try { |
|
454 |
message("Extracting " + file.getFileName() + "..."); |
|
455 |
fos = new FileOutputStream(new File(packagesetFolder, file.getFileName().toString())); |
|
456 |
Files.copy(file, fos); |
|
457 |
} catch (IOException | DirectoryIteratorException x) { |
|
458 |
// Do nothing |
|
459 |
} finally { |
|
460 |
if (fos != null) { |
|
461 |
IOUtils.closeQuietly(fos); |
|
462 |
} |
|
463 |
} |
|
464 |
} |
|
465 |
} |
|
466 |
loadDefaultPackages(new File(packagesetFolder, "defaultPackages")); |
|
467 |
} catch (Exception ex) { |
|
468 |
|
|
469 |
} finally { |
|
470 |
message(""); |
|
471 |
if (zipfs != null) { |
|
472 |
try { |
|
473 |
zipfs.close(); |
|
474 |
} catch (IOException ex) { |
|
475 |
} |
|
476 |
} |
|
477 |
SwingUtilities.invokeLater(updategui); |
|
478 |
} |
|
479 |
} |
|
480 |
}; |
|
481 |
File packageSet = getPackageSet(); |
|
482 |
if (packageSet == null) { |
|
483 |
return; |
|
484 |
} |
|
485 |
lchkPackages.setEnabled(false); |
|
486 |
butBrowsePackageSet.setEnabled(false); |
|
487 |
butAddPackage.setEnabled(false); |
|
488 |
butRemovePackage.setEnabled(false); |
|
489 |
butClose.setEnabled(false); |
|
490 |
butCreate.setEnabled(false); |
|
491 |
Thread thread = new Thread(task); |
|
492 |
thread.start(); |
|
493 |
} |
|
494 |
|
|
495 |
private void doRemovePackage() { |
|
496 |
List<String> filenames = this.lchkPackages.getSelectedValuesList(); |
|
497 |
if (filenames == null || filenames.isEmpty()) { |
|
498 |
return; |
|
499 |
} |
|
500 |
File packagesetFolder = new File(getWorkingFolder(), "packages"); |
|
501 |
for (String filename : filenames) { |
|
502 |
File filetoremove = new File(packagesetFolder, filename); |
|
503 |
filetoremove.delete(); |
|
504 |
} |
|
505 |
fillPackageList(); |
|
506 |
} |
|
507 |
|
|
508 |
private void doAddPackage() { |
|
509 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
510 |
File[] files = application.showOpenFileDialog("Select package to add", this.getWorkingFolder()); |
|
511 |
if (files == null) { |
|
512 |
return; |
|
513 |
} |
|
514 |
File packagesetFolder = new File(getWorkingFolder(), "packages"); |
|
515 |
for (File file : files) { |
|
516 |
try { |
|
517 |
FileUtils.copyFileToDirectory(file, packagesetFolder); |
|
518 |
} catch (IOException ex) { |
|
519 |
this.message("Can't copy package to working folder. " + ex.getMessage()); |
|
520 |
} |
|
521 |
} |
|
522 |
fillPackageList(); |
|
523 |
} |
|
524 |
} |
tags/org.gvsig.customize.app-1.0.2/org.gvsig.customize.app.mainplugin/src/main/java/org/gvsig/customize/InstallPackagesPanelLayout.java | ||
---|---|---|
1 |
/* |
|
2 |
* To change this license header, choose License Headers in Project Properties. |
|
3 |
* To change this template file, choose Tools | Templates |
|
4 |
* and open the template in the editor. |
|
5 |
*/ |
|
6 |
package org.gvsig.customize; |
|
7 |
|
|
8 |
/** |
|
9 |
* |
|
10 |
* @author jjdelcerro |
|
11 |
*/ |
|
12 |
public class InstallPackagesPanelLayout extends javax.swing.JPanel { |
|
13 |
|
|
14 |
/** |
|
15 |
* Creates new form InstallPackagesPanelLayout |
|
16 |
*/ |
|
17 |
public InstallPackagesPanelLayout() { |
|
18 |
initComponents(); |
|
19 |
} |
|
20 |
|
|
21 |
/** |
|
22 |
* This method is called from within the constructor to initialize the form. |
|
23 |
* WARNING: Do NOT modify this code. The content of this method is always |
|
24 |
* regenerated by the Form Editor. |
|
25 |
*/ |
|
26 |
@SuppressWarnings("unchecked") |
|
27 |
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents |
|
28 |
private void initComponents() { |
|
29 |
java.awt.GridBagConstraints gridBagConstraints; |
|
30 |
|
|
31 |
lblTitle = new javax.swing.JLabel(); |
|
32 |
filler1 = new javax.swing.Box.Filler(new java.awt.Dimension(4, 4), new java.awt.Dimension(4, 4), new java.awt.Dimension(4, 4)); |
|
33 |
filler2 = new javax.swing.Box.Filler(new java.awt.Dimension(4, 4), new java.awt.Dimension(4, 4), new java.awt.Dimension(4, 4)); |
|
34 |
pnlProgress = new javax.swing.JPanel(); |
|
35 |
butClose = new javax.swing.JButton(); |
|
36 |
filler3 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 32767)); |
|
37 |
lblMessage = new javax.swing.JLabel(); |
|
38 |
|
|
39 |
setPreferredSize(new java.awt.Dimension(400, 115)); |
|
40 |
java.awt.GridBagLayout layout = new java.awt.GridBagLayout(); |
|
41 |
layout.columnWidths = new int[] {0, 5, 0, 5, 0}; |
|
42 |
layout.rowHeights = new int[] {0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0}; |
|
43 |
setLayout(layout); |
|
44 |
|
|
45 |
lblTitle.setText("Configuring installation"); |
|
46 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
47 |
gridBagConstraints.gridx = 2; |
|
48 |
gridBagConstraints.gridy = 2; |
|
49 |
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; |
|
50 |
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; |
|
51 |
gridBagConstraints.weightx = 0.3; |
|
52 |
add(lblTitle, gridBagConstraints); |
|
53 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
54 |
gridBagConstraints.gridx = 4; |
|
55 |
gridBagConstraints.gridy = 0; |
|
56 |
add(filler1, gridBagConstraints); |
|
57 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
58 |
gridBagConstraints.gridx = 0; |
|
59 |
gridBagConstraints.gridy = 0; |
|
60 |
add(filler2, gridBagConstraints); |
|
61 |
|
|
62 |
pnlProgress.setPreferredSize(new java.awt.Dimension(300, 80)); |
|
63 |
|
|
64 |
javax.swing.GroupLayout pnlProgressLayout = new javax.swing.GroupLayout(pnlProgress); |
|
65 |
pnlProgress.setLayout(pnlProgressLayout); |
|
66 |
pnlProgressLayout.setHorizontalGroup( |
|
67 |
pnlProgressLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) |
|
68 |
.addGap(0, 382, Short.MAX_VALUE) |
|
69 |
); |
|
70 |
pnlProgressLayout.setVerticalGroup( |
|
71 |
pnlProgressLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) |
|
72 |
.addGap(0, 80, Short.MAX_VALUE) |
|
73 |
); |
|
74 |
|
|
75 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
76 |
gridBagConstraints.gridx = 2; |
|
77 |
gridBagConstraints.gridy = 4; |
|
78 |
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; |
|
79 |
add(pnlProgress, gridBagConstraints); |
|
80 |
|
|
81 |
butClose.setText("Close"); |
|
82 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
83 |
gridBagConstraints.gridx = 2; |
|
84 |
gridBagConstraints.gridy = 8; |
|
85 |
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END; |
|
86 |
add(butClose, gridBagConstraints); |
|
87 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
88 |
gridBagConstraints.gridx = 4; |
|
89 |
gridBagConstraints.gridy = 10; |
|
90 |
gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL; |
|
91 |
gridBagConstraints.weighty = 0.1; |
|
92 |
add(filler3, gridBagConstraints); |
|
93 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
94 |
gridBagConstraints.gridx = 2; |
|
95 |
gridBagConstraints.gridy = 6; |
|
96 |
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; |
|
97 |
gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START; |
|
98 |
add(lblMessage, gridBagConstraints); |
|
99 |
}// </editor-fold>//GEN-END:initComponents |
|
100 |
|
|
101 |
|
|
102 |
// Variables declaration - do not modify//GEN-BEGIN:variables |
|
103 |
protected javax.swing.JButton butClose; |
|
104 |
protected javax.swing.Box.Filler filler1; |
|
105 |
protected javax.swing.Box.Filler filler2; |
|
106 |
protected javax.swing.Box.Filler filler3; |
|
107 |
protected javax.swing.JLabel lblMessage; |
|
108 |
protected javax.swing.JLabel lblTitle; |
|
109 |
protected javax.swing.JPanel pnlProgress; |
|
110 |
// End of variables declaration//GEN-END:variables |
|
111 |
} |
tags/org.gvsig.customize.app-1.0.2/org.gvsig.customize.app.mainplugin/src/main/java/org/gvsig/customize/InstallPackagesPanel.java | ||
---|---|---|
1 |
|
|
2 |
package org.gvsig.customize; |
|
3 |
|
|
4 |
import java.awt.BorderLayout; |
|
5 |
import java.awt.event.ActionEvent; |
|
6 |
import java.awt.event.ActionListener; |
|
7 |
import javax.swing.SwingUtilities; |
|
8 |
import javax.swing.Timer; |
|
9 |
import org.gvsig.tools.ToolsLocator; |
|
10 |
import org.gvsig.tools.i18n.I18nManager; |
|
11 |
import org.gvsig.tools.observer.Observable; |
|
12 |
import org.gvsig.tools.observer.Observer; |
|
13 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
|
14 |
import org.gvsig.tools.swing.api.task.JTaskStatus; |
|
15 |
import org.gvsig.tools.task.TaskStatus; |
|
16 |
|
|
17 |
|
|
18 |
public class InstallPackagesPanel extends InstallPackagesPanelLayout { |
|
19 |
private TaskStatus taskStatus; |
|
20 |
private JTaskStatus jtaskStatus; |
|
21 |
// private Timer autoCloseTimer = null; |
|
22 |
|
|
23 |
public InstallPackagesPanel(TaskStatus taskStatus) { |
|
24 |
this.taskStatus = taskStatus; |
|
25 |
initComponents(); |
|
26 |
} |
|
27 |
|
|
28 |
private void initComponents() { |
|
29 |
I18nManager i18nManager = ToolsLocator.getI18nManager(); |
|
30 |
|
|
31 |
this.lblTitle.setText(i18nManager.getTranslation("_Configuring_installation")); |
|
32 |
|
|
33 |
this.butClose.setEnabled(false); |
|
34 |
this.butClose.setText(i18nManager.getTranslation("_Close")); |
|
35 |
this.butClose.addActionListener(new ActionListener() { |
|
36 |
|
|
37 |
@Override |
|
38 |
public void actionPerformed(ActionEvent e) { |
|
39 |
doClose(); |
|
40 |
} |
|
41 |
}); |
|
42 |
|
|
43 |
this.jtaskStatus = ToolsSwingLocator.getTaskStatusSwingManager().createJTaskStatus(); |
|
44 |
|
|
45 |
this.pnlProgress.setLayout(new BorderLayout()); |
|
46 |
this.pnlProgress.add(this.jtaskStatus, BorderLayout.CENTER); |
|
47 |
|
|
48 |
this.taskStatus.addObserver(new Observer() { |
|
49 |
@Override |
|
50 |
public void update(Observable o, Object o1) { |
|
51 |
if( SwingUtilities.isEventDispatchThread() ) { |
|
52 |
doCheckTaskStatus(); |
|
53 |
} else { |
|
54 |
SwingUtilities.invokeLater(new Runnable() { |
|
55 |
@Override |
|
56 |
public void run() { |
|
57 |
doCheckTaskStatus(); |
|
58 |
} |
|
59 |
}); |
|
60 |
} |
|
61 |
} |
|
62 |
}); |
|
63 |
this.jtaskStatus.bind(taskStatus); |
|
64 |
} |
|
65 |
|
|
66 |
public void message(String message) { |
|
67 |
this.lblMessage.setText(message); |
|
68 |
} |
|
69 |
|
|
70 |
private void doCheckTaskStatus() { |
|
71 |
if( this.taskStatus.isRunning() ) { |
|
72 |
return; |
|
73 |
} |
|
74 |
this.butClose.setEnabled(true); |
|
75 |
// autoCloseTimer = new Timer(15000, new ActionListener() { |
|
76 |
// |
|
77 |
// @Override |
|
78 |
// public void actionPerformed(ActionEvent e) { |
|
79 |
// doClose(); |
|
80 |
// } |
|
81 |
// }); |
|
82 |
// autoCloseTimer.setRepeats(false); |
|
83 |
// autoCloseTimer.start(); |
|
84 |
} |
|
85 |
|
|
86 |
private void doClose() { |
|
87 |
// if( this.autoCloseTimer!=null ) { |
|
88 |
// this.autoCloseTimer.stop(); |
|
89 |
// this.autoCloseTimer = null; |
|
90 |
// } |
|
91 |
this.setVisible(false); |
|
92 |
} |
|
93 |
} |
tags/org.gvsig.customize.app-1.0.2/org.gvsig.customize.app.mainplugin/src/main/java/org/gvsig/customize/DistributionBuilder.java | ||
---|---|---|
1 |
/* |
|
2 |
* To change this license header, choose License Headers in Project Properties. |
|
3 |
* To change this template file, choose Tools | Templates |
|
4 |
* and open the template in the editor. |
|
5 |
*/ |
|
6 |
package org.gvsig.customize; |
|
7 |
|
|
8 |
import java.io.File; |
|
9 |
import java.io.FileNotFoundException; |
|
10 |
import java.io.FileOutputStream; |
|
11 |
import java.io.IOException; |
|
12 |
import java.net.URI; |
|
13 |
import java.nio.file.FileSystem; |
|
14 |
import java.nio.file.FileSystems; |
|
15 |
import java.nio.file.Files; |
|
16 |
import java.nio.file.Path; |
|
17 |
import java.nio.file.Paths; |
|
18 |
import java.nio.file.StandardCopyOption; |
|
19 |
import java.util.HashMap; |
|
20 |
import java.util.Map; |
|
21 |
|
|
22 |
import org.apache.commons.io.FileUtils; |
|
23 |
import org.gvsig.andami.PluginServices; |
|
24 |
import org.gvsig.andami.PluginsLocator; |
|
25 |
import org.gvsig.andami.PluginsManager; |
|
26 |
import org.gvsig.installer.lib.api.InstallerLocator; |
|
27 |
import org.gvsig.installer.lib.api.InstallerManager; |
|
28 |
import org.gvsig.installer.lib.api.PackageInfo; |
|
29 |
import org.gvsig.installer.lib.api.creation.MakePackageService; |
|
30 |
import org.gvsig.installer.lib.api.creation.MakePackageServiceException; |
|
31 |
import org.slf4j.Logger; |
|
32 |
import org.slf4j.LoggerFactory; |
|
33 |
|
|
34 |
/** |
|
35 |
* |
|
36 |
* @author jjdelcerro |
|
37 |
*/ |
|
38 |
public class DistributionBuilder { |
|
39 |
|
|
40 |
private static final Logger logger = LoggerFactory.getLogger(DistributionBuilder.class); |
|
41 |
|
|
42 |
private String distributionId; |
|
43 |
private File onlineInstaller; |
|
44 |
private File workingFolder; |
|
45 |
private File customizePackagePath; |
|
46 |
private MessageBar messagebar; |
|
47 |
private boolean includeCustomizePlugin; |
|
48 |
private File packagesetFolder; |
|
49 |
|
|
50 |
public DistributionBuilder(MessageBar messagebar) { |
|
51 |
this.messagebar = messagebar; |
|
52 |
} |
|
53 |
|
|
54 |
private void message(String msg) { |
|
55 |
this.messagebar.message(msg); |
|
56 |
} |
|
57 |
|
|
58 |
public void setDistributionId(String distributionId) { |
|
59 |
this.distributionId = distributionId; |
|
60 |
} |
|
61 |
|
|
62 |
public void setOnlineInstaller(File onlineInstaller) { |
|
63 |
this.onlineInstaller = onlineInstaller; |
|
64 |
} |
|
65 |
|
|
66 |
public void setWorkingFolder(File workingFolder) { |
|
67 |
this.workingFolder = workingFolder; |
|
68 |
} |
|
69 |
|
|
70 |
void setIncludeCustomizePlugin(boolean includeCustomizePlugin) { |
|
71 |
this.includeCustomizePlugin = includeCustomizePlugin; |
|
72 |
} |
|
73 |
|
|
74 |
public boolean build() { |
|
75 |
try { |
|
76 |
Installkit installkit = new Installkit(); |
|
77 |
|
|
78 |
String target_name = this.onlineInstaller.getName().replace("online", this.distributionId); |
|
79 |
File target = new File(this.workingFolder, target_name); |
|
80 |
|
|
81 |
message("Creating package set..."); |
|
82 |
File packageSet = new File(this.workingFolder, "packages.gvspks"); |
|
83 |
createPackageset(packageSet); |
|
84 |
|
|
85 |
if (this.includeCustomizePlugin) { |
|
86 |
message("Building customize plugin..."); |
|
87 |
this.buildCustomizePlugin(); |
|
88 |
|
|
89 |
message("Adding customized plugin to package set..."); |
|
90 |
this.addToZip(packageSet, customizePackagePath); |
|
91 |
} |
|
92 |
|
|
93 |
message("Coping online installer..."); |
|
94 |
FileUtils.copyFile(this.onlineInstaller, target); |
|
95 |
|
|
96 |
message("Adding package set to the installer..."); |
|
97 |
installkit.addpks(target.getAbsolutePath(), packageSet.getAbsolutePath()); |
|
98 |
|
|
99 |
message("Installer created."); |
|
100 |
} catch (Exception ex) { |
|
101 |
message("Can't build the distribution.\n" + ex.getMessage()); |
|
102 |
logger.warn("Can't build the distribution."); |
|
103 |
logger.warn("working folder:" + this.workingFolder.getAbsolutePath()); |
|
104 |
logger.warn("online installer:" + this.onlineInstaller.getAbsolutePath()); |
|
105 |
return false; |
|
106 |
} |
|
107 |
return true; |
|
108 |
} |
|
109 |
|
|
110 |
private void createPackageset(File zipfile) { |
|
111 |
Map<String, String> env = new HashMap<>(); |
|
112 |
env.put("create", "true"); |
|
113 |
|
|
114 |
FileSystem zipfs = null; |
|
115 |
try { |
|
116 |
Path zippath = Paths.get(zipfile.getAbsolutePath()); |
|
117 |
final URI uri = URI.create("jar:file:" + zippath.toUri().getPath()); |
|
118 |
zipfs = FileSystems.newFileSystem(uri, env); |
|
119 |
File[] packages = packagesetFolder.listFiles(); |
|
120 |
for (File newEntry : packages) { |
|
121 |
Path externalFile = Paths.get(newEntry.getAbsoluteFile().toURI()); |
|
122 |
Path pathInZipfile = zipfs.getPath("/" + newEntry.getName()); |
|
123 |
Files.copy(externalFile, pathInZipfile, StandardCopyOption.REPLACE_EXISTING); |
|
124 |
} |
|
125 |
zipfs.close(); |
|
126 |
} catch (Exception ex) { |
|
127 |
logger.warn("Can't create packageset ("+zipfile.getAbsolutePath()+")",ex); |
|
128 |
} finally { |
|
129 |
if (zipfs != null) { |
|
130 |
try { |
|
131 |
zipfs.close(); |
|
132 |
} catch (IOException ex) { |
|
133 |
} |
|
134 |
} |
|
135 |
} |
|
136 |
|
|
137 |
} |
|
138 |
|
|
139 |
private void buildCustomizePlugin() throws FileNotFoundException, MakePackageServiceException, IOException { |
|
140 |
FileOutputStream fos = null; |
|
141 |
try { |
|
142 |
PluginsManager pluginsManager = PluginsLocator.getManager(); |
|
143 |
PluginServices plugin = pluginsManager.getPlugin(CustomizeExtension.class); |
|
144 |
InstallerManager installManager = InstallerLocator.getInstallerManager(); |
|
145 |
|
|
146 |
FileUtils.copyFileToDirectory( |
|
147 |
new File(packagesetFolder,"defaultPackages"), |
|
148 |
plugin.getPluginDirectory() |
|
149 |
); |
|
150 |
|
|
151 |
PackageInfo pkginfo = pluginsManager.getPackageInfo(CustomizeExtension.class); |
|
152 |
String pkgfilename = installManager.getPackageFileName(pkginfo); |
|
153 |
customizePackagePath = new File(this.workingFolder, pkgfilename); |
|
154 |
|
|
155 |
MakePackageService maker = installManager.createMakePackage(plugin.getPluginDirectory(), pkginfo); |
|
156 |
fos = new FileOutputStream(customizePackagePath); |
|
157 |
maker.createPackage(fos); |
|
158 |
} finally { |
|
159 |
if (fos != null) { |
|
160 |
fos.close(); |
|
161 |
} |
|
162 |
} |
|
163 |
|
|
164 |
} |
|
165 |
|
|
166 |
private void addToZip(File zipfile, File newEntry) { |
|
167 |
Map<String, String> env = new HashMap<>(); |
|
168 |
env.put("create", "true"); |
|
169 |
|
|
170 |
FileSystem zipfs = null; |
|
171 |
try { |
|
172 |
Path zippath = Paths.get(zipfile.getAbsolutePath()); |
|
173 |
final URI uri = URI.create("jar:file:" + zippath.toUri().getPath()); |
|
174 |
zipfs = FileSystems.newFileSystem(uri, env); |
|
175 |
Path externalFile = Paths.get(newEntry.getAbsoluteFile().toURI()); |
|
176 |
Path pathInZipfile = zipfs.getPath("/" + newEntry.getName()); |
|
177 |
Files.copy(externalFile, pathInZipfile, StandardCopyOption.REPLACE_EXISTING); |
|
178 |
zipfs.close(); |
|
179 |
} catch (IOException ex) { |
|
180 |
|
|
181 |
} finally { |
|
182 |
if (zipfs != null) { |
|
183 |
try { |
|
184 |
zipfs.close(); |
|
185 |
} catch (IOException ex) { |
|
186 |
} |
|
187 |
} |
|
188 |
} |
|
189 |
|
|
190 |
} |
|
191 |
|
|
192 |
void setPackageSet(File packageSet) { |
|
193 |
this.packagesetFolder = packageSet; |
|
194 |
} |
|
195 |
|
|
196 |
} |
tags/org.gvsig.customize.app-1.0.2/org.gvsig.customize.app.mainplugin/src/main/java/org/gvsig/customize/HttpProxyLoginDialogLayout.java | ||
---|---|---|
1 |
/* |
|
2 |
* To change this license header, choose License Headers in Project Properties. |
|
3 |
* To change this template file, choose Tools | Templates |
|
4 |
* and open the template in the editor. |
|
5 |
*/ |
|
6 |
|
|
7 |
package org.gvsig.customize; |
|
8 |
|
|
9 |
/** |
|
10 |
* |
|
11 |
* @author jjdelcerro |
|
12 |
*/ |
|
13 |
public class HttpProxyLoginDialogLayout extends javax.swing.JPanel { |
|
14 |
|
|
15 |
/** |
|
16 |
* Creates new form HttpProxyLoginLayout |
|
17 |
*/ |
|
18 |
public HttpProxyLoginDialogLayout() { |
|
19 |
initComponents(); |
|
20 |
} |
|
21 |
|
|
22 |
/** |
|
23 |
* This method is called from within the constructor to initialize the form. |
|
24 |
* WARNING: Do NOT modify this code. The content of this method is always |
|
25 |
* regenerated by the Form Editor. |
|
26 |
*/ |
|
27 |
@SuppressWarnings("unchecked") |
|
28 |
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents |
|
29 |
private void initComponents() { |
|
30 |
java.awt.GridBagConstraints gridBagConstraints; |
|
31 |
|
|
32 |
lblTitle = new javax.swing.JLabel(); |
|
33 |
lblName = new javax.swing.JLabel(); |
|
34 |
txtName = new javax.swing.JTextField(); |
|
35 |
lblPassword = new javax.swing.JLabel(); |
|
36 |
botLogin = new javax.swing.JButton(); |
|
37 |
botCancel = new javax.swing.JButton(); |
|
38 |
txtPassword = new javax.swing.JPasswordField(); |
|
39 |
|
|
40 |
setBorder(javax.swing.BorderFactory.createEmptyBorder(10, 10, 10, 10)); |
|
41 |
setAlignmentX(1.0F); |
|
42 |
setAlignmentY(1.0F); |
|
43 |
java.awt.GridBagLayout layout = new java.awt.GridBagLayout(); |
|
44 |
layout.columnWidths = new int[] {0, 5, 0, 5, 0, 5, 0}; |
|
45 |
layout.rowHeights = new int[] {0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0}; |
|
46 |
setLayout(layout); |
|
47 |
|
|
48 |
lblTitle.setText("Identificacion de usuario para acceso a internet"); |
|
49 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
50 |
gridBagConstraints.gridx = 2; |
|
51 |
gridBagConstraints.gridy = 2; |
|
52 |
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; |
|
53 |
add(lblTitle, gridBagConstraints); |
|
54 |
|
|
55 |
lblName.setText("Nombre de usuario:"); |
|
56 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
57 |
gridBagConstraints.gridx = 2; |
|
58 |
gridBagConstraints.gridy = 6; |
|
59 |
gridBagConstraints.gridwidth = 3; |
|
60 |
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; |
|
61 |
add(lblName, gridBagConstraints); |
|
62 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
63 |
gridBagConstraints.gridx = 2; |
|
64 |
gridBagConstraints.gridy = 8; |
|
65 |
gridBagConstraints.gridwidth = 3; |
|
66 |
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; |
|
67 |
add(txtName, gridBagConstraints); |
|
68 |
|
|
69 |
lblPassword.setText("Clave:"); |
|
70 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
71 |
gridBagConstraints.gridx = 2; |
|
72 |
gridBagConstraints.gridy = 12; |
Also available in: Unified diff