741 |
10 Oct 06 |
olle |
1 |
/* |
1652 |
22 May 07 |
gregory |
$Id$ |
741 |
10 Oct 06 |
olle |
3 |
|
1916 |
31 Aug 07 |
jari |
Copyright (C) 2006 Olle Mansson |
1916 |
31 Aug 07 |
jari |
Copyright (C) 2007 Gregory Vincic |
741 |
10 Oct 06 |
olle |
6 |
|
1652 |
22 May 07 |
gregory |
This file is part of Proteios. |
1652 |
22 May 07 |
gregory |
Available at http://www.proteios.org/ |
741 |
10 Oct 06 |
olle |
9 |
|
1652 |
22 May 07 |
gregory |
Proteios is free software; you can redistribute it and/or modify it |
1652 |
22 May 07 |
gregory |
under the terms of the GNU General Public License as published by |
1652 |
22 May 07 |
gregory |
the Free Software Foundation; either version 2 of the License, or |
1652 |
22 May 07 |
gregory |
(at your option) any later version. |
741 |
10 Oct 06 |
olle |
14 |
|
1652 |
22 May 07 |
gregory |
Proteios is distributed in the hope that it will be useful, but |
1652 |
22 May 07 |
gregory |
WITHOUT ANY WARRANTY; without even the implied warranty of |
1652 |
22 May 07 |
gregory |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
1652 |
22 May 07 |
gregory |
General Public License for more details. |
741 |
10 Oct 06 |
olle |
19 |
|
1652 |
22 May 07 |
gregory |
You should have received a copy of the GNU General Public License |
1652 |
22 May 07 |
gregory |
along with this program; if not, write to the Free Software |
1652 |
22 May 07 |
gregory |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
1652 |
22 May 07 |
gregory |
02111-1307, USA. |
1652 |
22 May 07 |
gregory |
24 |
*/ |
741 |
10 Oct 06 |
olle |
25 |
|
741 |
10 Oct 06 |
olle |
// Xerver Free Web Server |
741 |
10 Oct 06 |
olle |
// Copyright (C) 2002-2005 Omid Rouhani |
741 |
10 Oct 06 |
olle |
28 |
// |
741 |
10 Oct 06 |
olle |
29 |
// |
741 |
10 Oct 06 |
olle |
// This program is free software; you can redistribute it and/or |
741 |
10 Oct 06 |
olle |
// modify it under the terms of the GNU General Public License |
741 |
10 Oct 06 |
olle |
// as published by the Free Software Foundation; either version 2 |
741 |
10 Oct 06 |
olle |
// of the License, or (at your option) any later version. |
741 |
10 Oct 06 |
olle |
34 |
// |
741 |
10 Oct 06 |
olle |
// This program is distributed in the hope that it will be useful, |
741 |
10 Oct 06 |
olle |
// but WITHOUT ANY WARRANTY; without even the implied warranty of |
741 |
10 Oct 06 |
olle |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
741 |
10 Oct 06 |
olle |
// GNU General Public License for more details. |
741 |
10 Oct 06 |
olle |
39 |
// |
741 |
10 Oct 06 |
olle |
// You should have received a copy of the GNU General Public License |
741 |
10 Oct 06 |
olle |
// along with this program; if not, write to the Free Software |
741 |
10 Oct 06 |
olle |
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
741 |
10 Oct 06 |
olle |
43 |
// |
741 |
10 Oct 06 |
olle |
44 |
// |
741 |
10 Oct 06 |
olle |
45 |
// ############################################################# |
741 |
10 Oct 06 |
olle |
// ## YOU CAN CONTACT THE AUTHOR (OMID ROUHANI) AT: ## |
741 |
10 Oct 06 |
olle |
// ## HTTP://WWW.JAVASCRIPT.NU/XERVER/ ## |
741 |
10 Oct 06 |
olle |
48 |
// ## ## |
741 |
10 Oct 06 |
olle |
// ## IF YOUR SOFTWARE IS NOT RELEASED UNDER THE ## |
741 |
10 Oct 06 |
olle |
// ## GNU GENERAL PUBLIC LICENSE (GPL), ## |
741 |
10 Oct 06 |
olle |
// ## PLEASE DO NOT COPY ANYTHING FROM THIS SOURCE CODE!!! ## |
741 |
10 Oct 06 |
olle |
52 |
// ## ## |
741 |
10 Oct 06 |
olle |
// ## FOR FULL LICENSE, PLEASE READ "XERVER LICENSE". ## |
741 |
10 Oct 06 |
olle |
54 |
// ############################################################# |
741 |
10 Oct 06 |
olle |
55 |
|
1652 |
22 May 07 |
gregory |
56 |
package se.lu.thep.coreftpd.webserver; |
741 |
10 Oct 06 |
olle |
57 |
|
791 |
23 Oct 06 |
olle |
58 |
import se.lu.thep.coreftpd.common.JFolderChooser; |
741 |
10 Oct 06 |
olle |
59 |
import java.awt.BorderLayout; |
741 |
10 Oct 06 |
olle |
60 |
import java.awt.Color; |
741 |
10 Oct 06 |
olle |
61 |
import java.awt.Container; |
741 |
10 Oct 06 |
olle |
62 |
import java.awt.GridLayout; |
741 |
10 Oct 06 |
olle |
63 |
import java.awt.event.MouseEvent; |
741 |
10 Oct 06 |
olle |
64 |
import java.awt.event.MouseListener; |
741 |
10 Oct 06 |
olle |
65 |
import java.awt.event.WindowAdapter; |
741 |
10 Oct 06 |
olle |
66 |
import java.awt.event.WindowEvent; |
741 |
10 Oct 06 |
olle |
67 |
import java.io.File; |
741 |
10 Oct 06 |
olle |
68 |
import javax.swing.JButton; |
741 |
10 Oct 06 |
olle |
69 |
import javax.swing.JFrame; |
741 |
10 Oct 06 |
olle |
70 |
import javax.swing.JLabel; |
741 |
10 Oct 06 |
olle |
71 |
import javax.swing.JList; |
741 |
10 Oct 06 |
olle |
72 |
import javax.swing.JOptionPane; |
741 |
10 Oct 06 |
olle |
73 |
import javax.swing.JTextField; |
741 |
10 Oct 06 |
olle |
74 |
import javax.swing.UIManager; |
741 |
10 Oct 06 |
olle |
75 |
import javax.swing.event.ListSelectionEvent; |
741 |
10 Oct 06 |
olle |
76 |
import javax.swing.event.ListSelectionListener; |
741 |
10 Oct 06 |
olle |
77 |
|
741 |
10 Oct 06 |
olle |
78 |
/** |
1652 |
22 May 07 |
gregory |
79 |
* |
1652 |
22 May 07 |
gregory |
* <B>About this class:</B> <BR> |
1652 |
22 May 07 |
gregory |
* This is the install program for Xerver. The user can choose in which |
1652 |
22 May 07 |
gregory |
* directory shall be created and can crate new directories on his harddrive. |
1652 |
22 May 07 |
gregory |
83 |
* |
741 |
10 Oct 06 |
olle |
* @author <a href="http://www.JavaScript.nu/xerver/" TARGET="_top">Omid Rouhani</a> |
741 |
10 Oct 06 |
olle |
* @version 1.0 |
741 |
10 Oct 06 |
olle |
86 |
*/ |
741 |
10 Oct 06 |
olle |
87 |
|
1223 |
18 Feb 07 |
gregory |
88 |
@SuppressWarnings("serial") |
1652 |
22 May 07 |
gregory |
89 |
final public class SetupWindow extends JFrame implements MouseListener, |
1652 |
22 May 07 |
gregory |
90 |
ListSelectionListener { |
741 |
10 Oct 06 |
olle |
91 |
private JFolderChooser JFC_folderChooser; |
1652 |
22 May 07 |
gregory |
92 |
|
741 |
10 Oct 06 |
olle |
93 |
private JFolderChooser JFC_driverChooser; |
741 |
10 Oct 06 |
olle |
94 |
|
741 |
10 Oct 06 |
olle |
95 |
private JButton JB_exitButton; |
1652 |
22 May 07 |
gregory |
96 |
|
741 |
10 Oct 06 |
olle |
97 |
private JButton JB_extractButton; |
1652 |
22 May 07 |
gregory |
98 |
|
741 |
10 Oct 06 |
olle |
99 |
private JButton JB_createFolderButton; |
1652 |
22 May 07 |
gregory |
100 |
|
741 |
10 Oct 06 |
olle |
101 |
private JTextField JTF_installPath; |
741 |
10 Oct 06 |
olle |
102 |
|
1652 |
22 May 07 |
gregory |
103 |
public static void main(String[] s) { |
1652 |
22 May 07 |
gregory |
104 |
try { |
1652 |
22 May 07 |
gregory |
// UIManager.setLookAndFeel( |
1652 |
22 May 07 |
gregory |
// UIManager.getCrossPlatformLookAndFeelClassName()); |
1652 |
22 May 07 |
gregory |
107 |
UIManager |
1652 |
22 May 07 |
gregory |
108 |
.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); // Try |
1652 |
22 May 07 |
gregory |
// to |
1652 |
22 May 07 |
gregory |
// use |
1652 |
22 May 07 |
gregory |
// Windows |
1652 |
22 May 07 |
gregory |
// interface |
1652 |
22 May 07 |
gregory |
113 |
} catch (Exception e) { |
1652 |
22 May 07 |
gregory |
114 |
} |
741 |
10 Oct 06 |
olle |
115 |
|
741 |
10 Oct 06 |
olle |
116 |
new SetupWindow(); |
741 |
10 Oct 06 |
olle |
117 |
} |
741 |
10 Oct 06 |
olle |
118 |
|
1652 |
22 May 07 |
gregory |
119 |
SetupWindow() { |
1652 |
22 May 07 |
gregory |
120 |
JFC_driverChooser = new JFolderChooser(null);// null=show drivers |
1652 |
22 May 07 |
gregory |
121 |
JFC_folderChooser = new JFolderChooser((new PathInfo(null)) |
1652 |
22 May 07 |
gregory |
122 |
.getAllDirsWithReadAccess()[0].getPath()); |
741 |
10 Oct 06 |
olle |
123 |
|
741 |
10 Oct 06 |
olle |
124 |
JFC_driverChooser.addListSelectionListener(this); |
741 |
10 Oct 06 |
olle |
125 |
JFC_folderChooser.addListSelectionListener(this); |
741 |
10 Oct 06 |
olle |
126 |
|
1652 |
22 May 07 |
gregory |
127 |
Container CP = getContentPane(); |
1652 |
22 May 07 |
gregory |
128 |
Container CPpath = new Container(); |
1652 |
22 May 07 |
gregory |
129 |
Container CPdrivers = new Container(); |
1652 |
22 May 07 |
gregory |
130 |
Container CPfolders = new Container(); |
1652 |
22 May 07 |
gregory |
131 |
Container CPleft = new Container(); |
1652 |
22 May 07 |
gregory |
132 |
Container CPlagrebuttons = new Container(); |
1652 |
22 May 07 |
gregory |
133 |
Container CPbuttons = new Container(); // Inte "BorderLayout" |
741 |
10 Oct 06 |
olle |
134 |
|
741 |
10 Oct 06 |
olle |
135 |
CP.setLayout(new BorderLayout()); |
741 |
10 Oct 06 |
olle |
136 |
CPpath.setLayout(new BorderLayout()); |
741 |
10 Oct 06 |
olle |
137 |
CPdrivers.setLayout(new BorderLayout()); |
741 |
10 Oct 06 |
olle |
138 |
CPfolders.setLayout(new BorderLayout()); |
741 |
10 Oct 06 |
olle |
139 |
CPleft.setLayout(new BorderLayout()); |
741 |
10 Oct 06 |
olle |
140 |
CPlagrebuttons.setLayout(new BorderLayout()); |
1652 |
22 May 07 |
gregory |
141 |
CPbuttons.setLayout(new GridLayout(2, 1)); |
741 |
10 Oct 06 |
olle |
142 |
|
1652 |
22 May 07 |
gregory |
143 |
JB_exitButton = new JButton("Exit"); |
741 |
10 Oct 06 |
olle |
144 |
JB_exitButton.addMouseListener(this); |
1652 |
22 May 07 |
gregory |
145 |
JB_createFolderButton = new JButton("Create New Folder"); |
741 |
10 Oct 06 |
olle |
146 |
JB_createFolderButton.addMouseListener(this); |
741 |
10 Oct 06 |
olle |
147 |
CPbuttons.add(JB_createFolderButton); |
741 |
10 Oct 06 |
olle |
148 |
CPbuttons.add(JB_exitButton); |
741 |
10 Oct 06 |
olle |
149 |
|
1652 |
22 May 07 |
gregory |
150 |
JTF_installPath = new JTextField(JFC_folderChooser.getPath()); |
741 |
10 Oct 06 |
olle |
151 |
JTF_installPath.setEditable(false); |
741 |
10 Oct 06 |
olle |
152 |
JTF_installPath.setDisabledTextColor(Color.red); |
741 |
10 Oct 06 |
olle |
153 |
JTF_installPath.setSelectedTextColor(Color.red); |
741 |
10 Oct 06 |
olle |
154 |
JTF_installPath.setForeground(Color.red); |
741 |
10 Oct 06 |
olle |
155 |
JTF_installPath.setBackground(Color.black); |
1652 |
22 May 07 |
gregory |
156 |
JB_extractButton = new JButton("Extract files"); |
741 |
10 Oct 06 |
olle |
157 |
JB_extractButton.addMouseListener(this); |
741 |
10 Oct 06 |
olle |
158 |
CPpath.add(JB_extractButton, BorderLayout.WEST); |
741 |
10 Oct 06 |
olle |
159 |
CPpath.add(JTF_installPath, BorderLayout.CENTER); |
741 |
10 Oct 06 |
olle |
160 |
|
741 |
10 Oct 06 |
olle |
161 |
CPdrivers.add(new JLabel("Drivers:"), BorderLayout.NORTH); |
741 |
10 Oct 06 |
olle |
162 |
CPdrivers.add(JFC_driverChooser, BorderLayout.CENTER); |
741 |
10 Oct 06 |
olle |
163 |
|
741 |
10 Oct 06 |
olle |
164 |
CPleft.add(CPdrivers, BorderLayout.NORTH); |
741 |
10 Oct 06 |
olle |
165 |
CPleft.add(CPlagrebuttons, BorderLayout.CENTER); |
741 |
10 Oct 06 |
olle |
166 |
|
741 |
10 Oct 06 |
olle |
167 |
CPlagrebuttons.add(CPbuttons, BorderLayout.NORTH); |
741 |
10 Oct 06 |
olle |
168 |
CPlagrebuttons.add(new JLabel(""), BorderLayout.CENTER); |
741 |
10 Oct 06 |
olle |
169 |
|
741 |
10 Oct 06 |
olle |
170 |
CPfolders.add(new JLabel("Folders in drive:"), BorderLayout.NORTH); |
741 |
10 Oct 06 |
olle |
171 |
CPfolders.add(JFC_folderChooser, BorderLayout.CENTER); |
741 |
10 Oct 06 |
olle |
172 |
|
741 |
10 Oct 06 |
olle |
173 |
CP.add(CPleft, BorderLayout.WEST); |
741 |
10 Oct 06 |
olle |
174 |
CP.add(CPfolders, BorderLayout.CENTER); |
741 |
10 Oct 06 |
olle |
175 |
CP.add(CPpath, BorderLayout.SOUTH); |
741 |
10 Oct 06 |
olle |
176 |
|
741 |
10 Oct 06 |
olle |
177 |
CP.validate(); |
741 |
10 Oct 06 |
olle |
178 |
|
741 |
10 Oct 06 |
olle |
179 |
setTitle("Install Xerver"); |
741 |
10 Oct 06 |
olle |
180 |
JFC_driverChooser.setVisibleRowCount(4); |
741 |
10 Oct 06 |
olle |
181 |
JFC_folderChooser.setVisibleRowCount(20); |
741 |
10 Oct 06 |
olle |
182 |
addWindowListener(MyWindowListener); |
1652 |
22 May 07 |
gregory |
183 |
setSize(600, 400); |
741 |
10 Oct 06 |
olle |
184 |
setVisible(true); |
741 |
10 Oct 06 |
olle |
185 |
toFront(); |
741 |
10 Oct 06 |
olle |
186 |
} |
741 |
10 Oct 06 |
olle |
187 |
|
741 |
10 Oct 06 |
olle |
188 |
/** |
1652 |
22 May 07 |
gregory |
* Extract Xerver files into <CODE>JTF_installPath.getText()</CODE>. |
1652 |
22 May 07 |
gregory |
190 |
*/ |
1652 |
22 May 07 |
gregory |
191 |
private void extractFiles() { |
741 |
10 Oct 06 |
olle |
192 |
new InstallXerver(JTF_installPath.getText()); |
1652 |
22 May 07 |
gregory |
193 |
if (File.separatorChar == '\\') // Windows user... |
741 |
10 Oct 06 |
olle |
194 |
{ |
741 |
10 Oct 06 |
olle |
195 |
try { |
1652 |
22 May 07 |
gregory |
196 |
JOptionPane |
1652 |
22 May 07 |
gregory |
197 |
.showMessageDialog( |
1652 |
22 May 07 |
gregory |
198 |
null, |
1652 |
22 May 07 |
gregory |
199 |
"Xerver has been successfully installed at:\n" |
1652 |
22 May 07 |
gregory |
200 |
+ JTF_installPath.getText() |
1652 |
22 May 07 |
gregory |
201 |
+ "\n\nPress OK to quit installer and start Xerver (this might take a few seconds).", |
1652 |
22 May 07 |
gregory |
202 |
"Xerver successfully installed", |
1652 |
22 May 07 |
gregory |
203 |
JOptionPane.INFORMATION_MESSAGE); |
1652 |
22 May 07 |
gregory |
204 |
setVisible(false); |
1652 |
22 May 07 |
gregory |
205 |
dispose(); // Close install program |
1652 |
22 May 07 |
gregory |
206 |
Runtime run; |
1652 |
22 May 07 |
gregory |
207 |
Process proc; |
1652 |
22 May 07 |
gregory |
208 |
run = Runtime.getRuntime(); |
1652 |
22 May 07 |
gregory |
209 |
System.out.println("Xerver is now running..."); |
1652 |
22 May 07 |
gregory |
210 |
proc = run.exec("\"" + JTF_installPath.getText() |
1652 |
22 May 07 |
gregory |
211 |
+ File.separator + "dontrun.bat\" \"" |
1652 |
22 May 07 |
gregory |
212 |
+ JTF_installPath.getText() + File.separator + "\""); // By |
1652 |
22 May 07 |
gregory |
// default |
1652 |
22 May 07 |
gregory |
// c: |
1652 |
22 May 07 |
gregory |
// is |
1652 |
22 May 07 |
gregory |
// shared, |
1652 |
22 May 07 |
gregory |
// so |
1652 |
22 May 07 |
gregory |
// start |
1652 |
22 May 07 |
gregory |
// Xerver |
1652 |
22 May 07 |
gregory |
// for |
1652 |
22 May 07 |
gregory |
// Windows |
1652 |
22 May 07 |
gregory |
// users... |
1652 |
22 May 07 |
gregory |
223 |
proc.waitFor(); |
1652 |
22 May 07 |
gregory |
224 |
System.exit(0); |
1652 |
22 May 07 |
gregory |
225 |
} catch (Exception e) { |
1652 |
22 May 07 |
gregory |
226 |
} |
1652 |
22 May 07 |
gregory |
227 |
; |
1652 |
22 May 07 |
gregory |
// JOptionPane.showMessageDialog(null, "You can start Xerver by |
1652 |
22 May 07 |
gregory |
// starting:\n"+JTF_installPath.getText()+File.separator+"StartXerver.exe", |
1652 |
22 May 07 |
gregory |
// "Start Xerver", JOptionPane.INFORMATION_MESSAGE); |
1652 |
22 May 07 |
gregory |
231 |
} else { |
1652 |
22 May 07 |
gregory |
232 |
JOptionPane |
1652 |
22 May 07 |
gregory |
233 |
.showMessageDialog( |
1652 |
22 May 07 |
gregory |
234 |
null, |
1652 |
22 May 07 |
gregory |
235 |
"Xerver has been successfully installed at:\n" |
1652 |
22 May 07 |
gregory |
236 |
+ JTF_installPath.getText() |
1652 |
22 May 07 |
gregory |
237 |
+ "\n\nTo start Xerver Setup, type \"java SetupXerver\" when you are located at:\n" |
1652 |
22 May 07 |
gregory |
238 |
+ JTF_installPath.getText() |
1652 |
22 May 07 |
gregory |
239 |
+ File.separator, "Start Xerver Setup", |
1652 |
22 May 07 |
gregory |
240 |
JOptionPane.INFORMATION_MESSAGE); // Non-windows |
1652 |
22 May 07 |
gregory |
// users might |
1652 |
22 May 07 |
gregory |
// prefer a |
1652 |
22 May 07 |
gregory |
// setup-window. |
741 |
10 Oct 06 |
olle |
244 |
System.exit(0); |
741 |
10 Oct 06 |
olle |
245 |
} |
741 |
10 Oct 06 |
olle |
246 |
} |
741 |
10 Oct 06 |
olle |
247 |
|
741 |
10 Oct 06 |
olle |
248 |
/** |
1652 |
22 May 07 |
gregory |
* Prompt the user for a directory name and then create then directory. |
1652 |
22 May 07 |
gregory |
250 |
*/ |
1652 |
22 May 07 |
gregory |
251 |
private void createNewDir() { |
1652 |
22 May 07 |
gregory |
252 |
String s_newFolder = (String) JOptionPane.showInputDialog(null, |
1652 |
22 May 07 |
gregory |
253 |
"New folder name:", "Create new folder", |
1652 |
22 May 07 |
gregory |
254 |
JOptionPane.QUESTION_MESSAGE, null, null, "Xerver"); |
1652 |
22 May 07 |
gregory |
255 |
if (s_newFolder != null) { |
1652 |
22 May 07 |
gregory |
256 |
if (!s_newFolder.equals("")) { |
1652 |
22 May 07 |
gregory |
257 |
String s_newPath = JFC_folderChooser.getPath() + File.separator |
1652 |
22 May 07 |
gregory |
258 |
+ s_newFolder; |
1652 |
22 May 07 |
gregory |
259 |
File f_newFolder = new File(s_newPath); |
741 |
10 Oct 06 |
olle |
260 |
|
1652 |
22 May 07 |
gregory |
261 |
if (f_newFolder.mkdir()) { |
741 |
10 Oct 06 |
olle |
262 |
JFC_folderChooser.setNewPath(f_newFolder.getPath()); |
741 |
10 Oct 06 |
olle |
263 |
JTF_installPath.setText(f_newFolder.getPath()); |
1652 |
22 May 07 |
gregory |
264 |
} else { |
1652 |
22 May 07 |
gregory |
265 |
JOptionPane |
1652 |
22 May 07 |
gregory |
266 |
.showMessageDialog( |
1652 |
22 May 07 |
gregory |
267 |
null, |
1652 |
22 May 07 |
gregory |
268 |
"Could not create:\n" |
1652 |
22 May 07 |
gregory |
269 |
+ f_newFolder.getPath() |
1652 |
22 May 07 |
gregory |
270 |
+ "\n\nThe folder might already exists,\nthe folder might contain illegal characters or\nyou might not have permission to create the folder.", |
1652 |
22 May 07 |
gregory |
271 |
"Error creating folder", |
1652 |
22 May 07 |
gregory |
272 |
JOptionPane.ERROR_MESSAGE); |
741 |
10 Oct 06 |
olle |
273 |
} |
741 |
10 Oct 06 |
olle |
274 |
getContentPane().validate(); |
741 |
10 Oct 06 |
olle |
275 |
} |
741 |
10 Oct 06 |
olle |
276 |
} |
741 |
10 Oct 06 |
olle |
277 |
} |
741 |
10 Oct 06 |
olle |
278 |
|
1652 |
22 May 07 |
gregory |
279 |
public void mouseClicked(MouseEvent e) { |
1652 |
22 May 07 |
gregory |
280 |
if (e.getSource() == JB_extractButton) { |
1652 |
22 May 07 |
gregory |
281 |
if (JOptionPane.YES_OPTION == JOptionPane.showConfirmDialog(null, |
1652 |
22 May 07 |
gregory |
282 |
"Extract and install Xerver files to " |
1652 |
22 May 07 |
gregory |
283 |
+ JTF_installPath.getText() + "?", |
1652 |
22 May 07 |
gregory |
284 |
"Extract Xerver", JOptionPane.YES_NO_OPTION, |
1652 |
22 May 07 |
gregory |
285 |
JOptionPane.QUESTION_MESSAGE)) |
741 |
10 Oct 06 |
olle |
286 |
extractFiles(); |
1652 |
22 May 07 |
gregory |
287 |
} else if (e.getSource() == JB_exitButton) { |
1652 |
22 May 07 |
gregory |
288 |
if (JOptionPane.YES_OPTION == JOptionPane.showConfirmDialog(null, |
1652 |
22 May 07 |
gregory |
289 |
"Exit Xerver Installer?", "Exit Xerver Installer?", |
1652 |
22 May 07 |
gregory |
290 |
JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE)) |
741 |
10 Oct 06 |
olle |
291 |
System.exit(0); |
1652 |
22 May 07 |
gregory |
292 |
} else if (e.getSource() == JB_createFolderButton) { |
741 |
10 Oct 06 |
olle |
293 |
createNewDir(); |
741 |
10 Oct 06 |
olle |
294 |
} |
741 |
10 Oct 06 |
olle |
295 |
|
741 |
10 Oct 06 |
olle |
296 |
getContentPane().validate(); |
741 |
10 Oct 06 |
olle |
297 |
} |
741 |
10 Oct 06 |
olle |
298 |
|
741 |
10 Oct 06 |
olle |
/* "Do nothing"-events */ |
1652 |
22 May 07 |
gregory |
300 |
public void mouseEntered(MouseEvent e) { |
1652 |
22 May 07 |
gregory |
301 |
} |
741 |
10 Oct 06 |
olle |
302 |
|
1652 |
22 May 07 |
gregory |
303 |
public void mouseExited(MouseEvent e) { |
1652 |
22 May 07 |
gregory |
304 |
} |
741 |
10 Oct 06 |
olle |
305 |
|
1652 |
22 May 07 |
gregory |
306 |
public void mousePressed(MouseEvent e) { |
1652 |
22 May 07 |
gregory |
307 |
} |
1652 |
22 May 07 |
gregory |
308 |
|
1652 |
22 May 07 |
gregory |
309 |
public void mouseReleased(MouseEvent e) { |
1652 |
22 May 07 |
gregory |
310 |
} |
1652 |
22 May 07 |
gregory |
311 |
|
1652 |
22 May 07 |
gregory |
312 |
public void valueChanged(ListSelectionEvent e) { |
1652 |
22 May 07 |
gregory |
313 |
JList JT = (JList) e.getSource(); |
1652 |
22 May 07 |
gregory |
314 |
MyFile selectedFile = (MyFile) JT.getSelectedValue(); |
1652 |
22 May 07 |
gregory |
// int selRow = JT.getRowForLocation(e.getX(), e.getY()); |
1652 |
22 May 07 |
gregory |
// TreePath selPath = JT.getPathForLocation(e.getX(), e.getY()); |
1652 |
22 May 07 |
gregory |
317 |
|
1652 |
22 May 07 |
gregory |
318 |
if (!JT.isSelectionEmpty()) { |
741 |
10 Oct 06 |
olle |
319 |
JTF_installPath.setText(selectedFile.getPath()); |
741 |
10 Oct 06 |
olle |
320 |
JFC_folderChooser.setNewPath(selectedFile.getPath()); |
741 |
10 Oct 06 |
olle |
321 |
} |
741 |
10 Oct 06 |
olle |
322 |
getContentPane().validate(); |
741 |
10 Oct 06 |
olle |
323 |
} |
741 |
10 Oct 06 |
olle |
324 |
|
1652 |
22 May 07 |
gregory |
325 |
private WindowAdapter MyWindowListener = new WindowAdapter() { |
2386 |
14 Nov 07 |
gregory |
326 |
@Override |
1652 |
22 May 07 |
gregory |
327 |
public void windowClosing(WindowEvent e) // Window is closeing |
741 |
10 Oct 06 |
olle |
328 |
{ |
741 |
10 Oct 06 |
olle |
329 |
System.exit(0); |
741 |
10 Oct 06 |
olle |
330 |
} |
741 |
10 Oct 06 |
olle |
331 |
}; |
741 |
10 Oct 06 |
olle |
332 |
} |