Neurogami-roir 1.3.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +22 -0
- data/Manifest.txt +250 -0
- data/README.md +12 -0
- data/Rakefile +63 -0
- data/bin/roir +176 -0
- data/data/GenericJavaApp.icns +0 -0
- data/data/JavaApplicationStub +0 -0
- data/data/Rawr logo 1 large.png +0 -0
- data/data/Rawr logo 2 large.png +0 -0
- data/data/Rawr logo2.png +0 -0
- data/data/website/_notes/dwsync.xml +1 -0
- data/data/website/css/1.css +254 -0
- data/data/website/css/_notes/dwsync.xml +1 -0
- data/data/website/images/_notes/dwsync.xml +1 -0
- data/data/website/images/body_bg.jpg +0 -0
- data/data/website/images/bullet.gif +0 -0
- data/data/website/images/content.jpg +0 -0
- data/data/website/images/content_h2.gif +0 -0
- data/data/website/images/details.gif +0 -0
- data/data/website/images/details.jpg +0 -0
- data/data/website/images/header_bg.jpg +0 -0
- data/data/website/images/nav_a_hover.gif +0 -0
- data/data/website/images/rawr_logo.png +0 -0
- data/data/website/index.html +164 -0
- data/lib/app_bundler.rb +138 -0
- data/lib/bundler.rb +36 -0
- data/lib/command.rb +68 -0
- data/lib/exe_bundler.rb +106 -0
- data/lib/generator.rb +127 -0
- data/lib/jar_builder.rb +57 -0
- data/lib/jruby_batch_compiler.rb +127 -0
- data/lib/jruby_release.rb +104 -0
- data/lib/launch4j/LICENSE.txt +30 -0
- data/lib/launch4j/bin-linux/COPYING +340 -0
- data/lib/launch4j/bin-linux/ld +0 -0
- data/lib/launch4j/bin-linux/windres +0 -0
- data/lib/launch4j/bin-mac/COPYING +340 -0
- data/lib/launch4j/bin-mac/ld +0 -0
- data/lib/launch4j/bin-mac/readme.txt +1 -0
- data/lib/launch4j/bin-mac/windres +0 -0
- data/lib/launch4j/bin-win/COPYING +340 -0
- data/lib/launch4j/bin-win/ld.exe +0 -0
- data/lib/launch4j/bin-win/windres.exe +0 -0
- data/lib/launch4j/build.xml +62 -0
- data/lib/launch4j/demo/ConsoleApp/ConsoleApp.jar +0 -0
- data/lib/launch4j/demo/ConsoleApp/build.xml +57 -0
- data/lib/launch4j/demo/ConsoleApp/l4j/ConsoleApp.ico +0 -0
- data/lib/launch4j/demo/ConsoleApp/lib/readme.txt +8 -0
- data/lib/launch4j/demo/ConsoleApp/readme.txt +1 -0
- data/lib/launch4j/demo/ConsoleApp/src/net/sf/launch4j/example/ConsoleApp.java +72 -0
- data/lib/launch4j/demo/LICENSE.txt +30 -0
- data/lib/launch4j/demo/SimpleApp/SimpleApp.jar +0 -0
- data/lib/launch4j/demo/SimpleApp/build.xml +52 -0
- data/lib/launch4j/demo/SimpleApp/l4j/SimpleApp.ico +0 -0
- data/lib/launch4j/demo/SimpleApp/l4j/SimpleApp.xml +18 -0
- data/lib/launch4j/demo/SimpleApp/l4j/splash.bmp +0 -0
- data/lib/launch4j/demo/SimpleApp/lib/readme.txt +8 -0
- data/lib/launch4j/demo/SimpleApp/readme.txt +1 -0
- data/lib/launch4j/demo/SimpleApp/src/net/sf/launch4j/example/SimpleApp.java +104 -0
- data/lib/launch4j/demo/readme.txt +3 -0
- data/lib/launch4j/head/LICENSE.txt +23 -0
- data/lib/launch4j/head/consolehead.o +0 -0
- data/lib/launch4j/head/guihead.o +0 -0
- data/lib/launch4j/head/head.o +0 -0
- data/lib/launch4j/head_src/LICENSE.txt +23 -0
- data/lib/launch4j/head_src/consolehead/Makefile.win +33 -0
- data/lib/launch4j/head_src/consolehead/consolehead.c +65 -0
- data/lib/launch4j/head_src/consolehead/consolehead.dev +108 -0
- data/lib/launch4j/head_src/guihead/Makefile.win +33 -0
- data/lib/launch4j/head_src/guihead/guihead.c +185 -0
- data/lib/launch4j/head_src/guihead/guihead.dev +109 -0
- data/lib/launch4j/head_src/guihead/guihead.h +43 -0
- data/lib/launch4j/head_src/head.c +807 -0
- data/lib/launch4j/head_src/head.h +113 -0
- data/lib/launch4j/head_src/resource.h +71 -0
- data/lib/launch4j/launch4j +8 -0
- data/lib/launch4j/launch4j.jar +0 -0
- data/lib/launch4j/launch4j.jfpr +0 -0
- data/lib/launch4j/lib/JGoodies.Forms.LICENSE.txt +31 -0
- data/lib/launch4j/lib/JGoodies.Looks.LICENSE.txt +31 -0
- data/lib/launch4j/lib/Nuvola.Icon.Theme.LICENSE.txt +504 -0
- data/lib/launch4j/lib/XStream.LICENSE.txt +27 -0
- data/lib/launch4j/lib/commons-beanutils.jar +0 -0
- data/lib/launch4j/lib/commons-logging.jar +0 -0
- data/lib/launch4j/lib/commons.LICENSE.txt +50 -0
- data/lib/launch4j/lib/forms.jar +0 -0
- data/lib/launch4j/lib/formsrt.jar +0 -0
- data/lib/launch4j/lib/foxtrot.LICENSE.txt +25 -0
- data/lib/launch4j/lib/foxtrot.jar +0 -0
- data/lib/launch4j/lib/looks.jar +0 -0
- data/lib/launch4j/lib/xstream.jar +0 -0
- data/lib/launch4j/manifest/uac.exe.manifest +12 -0
- data/lib/launch4j/manifest/xp-themes.exe.manifest +14 -0
- data/lib/launch4j/src/images/asterix-o.gif +0 -0
- data/lib/launch4j/src/images/asterix.gif +0 -0
- data/lib/launch4j/src/images/build.png +0 -0
- data/lib/launch4j/src/images/button_ok.png +0 -0
- data/lib/launch4j/src/images/cancel16.png +0 -0
- data/lib/launch4j/src/images/down16.png +0 -0
- data/lib/launch4j/src/images/edit_add16.png +0 -0
- data/lib/launch4j/src/images/info.png +0 -0
- data/lib/launch4j/src/images/new.png +0 -0
- data/lib/launch4j/src/images/new16.png +0 -0
- data/lib/launch4j/src/images/ok16.png +0 -0
- data/lib/launch4j/src/images/open.png +0 -0
- data/lib/launch4j/src/images/open16.png +0 -0
- data/lib/launch4j/src/images/run.png +0 -0
- data/lib/launch4j/src/images/save.png +0 -0
- data/lib/launch4j/src/images/up16.png +0 -0
- data/lib/launch4j/src/launch4j.properties +2 -0
- data/lib/launch4j/src/net/sf/launch4j/Builder.java +207 -0
- data/lib/launch4j/src/net/sf/launch4j/BuilderException.java +52 -0
- data/lib/launch4j/src/net/sf/launch4j/ExecException.java +66 -0
- data/lib/launch4j/src/net/sf/launch4j/FileChooserFilter.java +76 -0
- data/lib/launch4j/src/net/sf/launch4j/Log.java +105 -0
- data/lib/launch4j/src/net/sf/launch4j/Main.java +99 -0
- data/lib/launch4j/src/net/sf/launch4j/Messages.java +78 -0
- data/lib/launch4j/src/net/sf/launch4j/OptionParser.java +71 -0
- data/lib/launch4j/src/net/sf/launch4j/RcBuilder.java +340 -0
- data/lib/launch4j/src/net/sf/launch4j/Util.java +197 -0
- data/lib/launch4j/src/net/sf/launch4j/ant/AntClassPath.java +61 -0
- data/lib/launch4j/src/net/sf/launch4j/ant/AntConfig.java +129 -0
- data/lib/launch4j/src/net/sf/launch4j/ant/AntJre.java +69 -0
- data/lib/launch4j/src/net/sf/launch4j/ant/Launch4jTask.java +162 -0
- data/lib/launch4j/src/net/sf/launch4j/ant/Messages.java +55 -0
- data/lib/launch4j/src/net/sf/launch4j/ant/StringWrapper.java +67 -0
- data/lib/launch4j/src/net/sf/launch4j/ant/messages.properties +35 -0
- data/lib/launch4j/src/net/sf/launch4j/ant/messages_es.properties +35 -0
- data/lib/launch4j/src/net/sf/launch4j/binding/Binding.java +62 -0
- data/lib/launch4j/src/net/sf/launch4j/binding/BindingException.java +52 -0
- data/lib/launch4j/src/net/sf/launch4j/binding/Bindings.java +317 -0
- data/lib/launch4j/src/net/sf/launch4j/binding/IValidatable.java +44 -0
- data/lib/launch4j/src/net/sf/launch4j/binding/InvariantViolationException.java +67 -0
- data/lib/launch4j/src/net/sf/launch4j/binding/JComboBoxBinding.java +119 -0
- data/lib/launch4j/src/net/sf/launch4j/binding/JListBinding.java +118 -0
- data/lib/launch4j/src/net/sf/launch4j/binding/JRadioButtonBinding.java +146 -0
- data/lib/launch4j/src/net/sf/launch4j/binding/JTextAreaBinding.java +123 -0
- data/lib/launch4j/src/net/sf/launch4j/binding/JTextComponentBinding.java +108 -0
- data/lib/launch4j/src/net/sf/launch4j/binding/JToggleButtonBinding.java +108 -0
- data/lib/launch4j/src/net/sf/launch4j/binding/Messages.java +78 -0
- data/lib/launch4j/src/net/sf/launch4j/binding/OptComponentBinding.java +119 -0
- data/lib/launch4j/src/net/sf/launch4j/binding/OptJTextAreaBinding.java +141 -0
- data/lib/launch4j/src/net/sf/launch4j/binding/Validator.java +259 -0
- data/lib/launch4j/src/net/sf/launch4j/binding/messages.properties +52 -0
- data/lib/launch4j/src/net/sf/launch4j/binding/messages_es.properties +51 -0
- data/lib/launch4j/src/net/sf/launch4j/config/ClassPath.java +87 -0
- data/lib/launch4j/src/net/sf/launch4j/config/Config.java +396 -0
- data/lib/launch4j/src/net/sf/launch4j/config/ConfigPersister.java +249 -0
- data/lib/launch4j/src/net/sf/launch4j/config/ConfigPersisterException.java +51 -0
- data/lib/launch4j/src/net/sf/launch4j/config/Jre.java +235 -0
- data/lib/launch4j/src/net/sf/launch4j/config/LdDefaults.java +62 -0
- data/lib/launch4j/src/net/sf/launch4j/config/Messages.java +78 -0
- data/lib/launch4j/src/net/sf/launch4j/config/Msg.java +111 -0
- data/lib/launch4j/src/net/sf/launch4j/config/SingleInstance.java +74 -0
- data/lib/launch4j/src/net/sf/launch4j/config/Splash.java +103 -0
- data/lib/launch4j/src/net/sf/launch4j/config/VersionInfo.java +168 -0
- data/lib/launch4j/src/net/sf/launch4j/config/messages.properties +93 -0
- data/lib/launch4j/src/net/sf/launch4j/config/messages_es.properties +75 -0
- data/lib/launch4j/src/net/sf/launch4j/form/BasicForm.java +283 -0
- data/lib/launch4j/src/net/sf/launch4j/form/BasicForm.jfrm +0 -0
- data/lib/launch4j/src/net/sf/launch4j/form/ClassPathForm.java +193 -0
- data/lib/launch4j/src/net/sf/launch4j/form/ClassPathForm.jfrm +0 -0
- data/lib/launch4j/src/net/sf/launch4j/form/ConfigForm.java +132 -0
- data/lib/launch4j/src/net/sf/launch4j/form/ConfigForm.jfrm +0 -0
- data/lib/launch4j/src/net/sf/launch4j/form/EnvironmentVarsForm.java +127 -0
- data/lib/launch4j/src/net/sf/launch4j/form/EnvironmentVarsForm.jfrm +0 -0
- data/lib/launch4j/src/net/sf/launch4j/form/HeaderForm.java +171 -0
- data/lib/launch4j/src/net/sf/launch4j/form/HeaderForm.jfrm +0 -0
- data/lib/launch4j/src/net/sf/launch4j/form/JreForm.java +266 -0
- data/lib/launch4j/src/net/sf/launch4j/form/JreForm.jfrm +0 -0
- data/lib/launch4j/src/net/sf/launch4j/form/Messages.java +55 -0
- data/lib/launch4j/src/net/sf/launch4j/form/MessagesForm.java +183 -0
- data/lib/launch4j/src/net/sf/launch4j/form/MessagesForm.jfrm +0 -0
- data/lib/launch4j/src/net/sf/launch4j/form/SingleInstanceForm.java +141 -0
- data/lib/launch4j/src/net/sf/launch4j/form/SingleInstanceForm.jfrm +0 -0
- data/lib/launch4j/src/net/sf/launch4j/form/SplashForm.java +166 -0
- data/lib/launch4j/src/net/sf/launch4j/form/SplashForm.jfrm +0 -0
- data/lib/launch4j/src/net/sf/launch4j/form/VersionInfoForm.java +232 -0
- data/lib/launch4j/src/net/sf/launch4j/form/VersionInfoForm.jfrm +0 -0
- data/lib/launch4j/src/net/sf/launch4j/form/messages.properties +146 -0
- data/lib/launch4j/src/net/sf/launch4j/form/messages_es.properties +118 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/AbstractAcceptListener.java +75 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/BasicFormImpl.java +101 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/BrowseActionListener.java +79 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/ClassPathFormImpl.java +222 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/ConfigFormImpl.java +100 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/EnvironmentVarsFormImpl.java +50 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/FileChooser.java +65 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/GlassPane.java +67 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/HeaderFormImpl.java +102 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/JreFormImpl.java +166 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/MainFrame.java +358 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/Messages.java +55 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/MessagesFormImpl.java +58 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/SingleInstanceFormImpl.java +54 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/SplashFormImpl.java +61 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/VersionInfoFormImpl.java +63 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/messages.properties +74 -0
- data/lib/launch4j/src/net/sf/launch4j/formimpl/messages_es.properties +56 -0
- data/lib/launch4j/src/net/sf/launch4j/messages.properties +45 -0
- data/lib/launch4j/src/net/sf/launch4j/messages_es.properties +45 -0
- data/lib/launch4j/w32api/MinGW.LICENSE.txt +25 -0
- data/lib/launch4j/w32api/crt2.o +0 -0
- data/lib/launch4j/w32api/libadvapi32.a +0 -0
- data/lib/launch4j/w32api/libgcc.a +0 -0
- data/lib/launch4j/w32api/libkernel32.a +0 -0
- data/lib/launch4j/w32api/libmingw32.a +0 -0
- data/lib/launch4j/w32api/libmsvcrt.a +0 -0
- data/lib/launch4j/w32api/libshell32.a +0 -0
- data/lib/launch4j/w32api/libuser32.a +0 -0
- data/lib/launch4j/web/bullet.gif +0 -0
- data/lib/launch4j/web/changelog.html +356 -0
- data/lib/launch4j/web/docs.html +585 -0
- data/lib/launch4j/web/index.html +128 -0
- data/lib/launch4j/web/launch4j-use.gif +0 -0
- data/lib/launch4j/web/launch4j.gif +0 -0
- data/lib/launch4j/web/links.html +73 -0
- data/lib/launch4j/web/style.css +159 -0
- data/lib/options.rb +101 -0
- data/lib/platform.rb +28 -0
- data/lib/rawr.rb +178 -0
- data/lib/rawr_bundle.rb +26 -0
- data/lib/rawr_version.rb +3 -0
- data/lib/web_bundler.rb +114 -0
- data/lib/zip/ioextras.rb +155 -0
- data/lib/zip/stdrubyext.rb +111 -0
- data/lib/zip/tempfile_bugfixed.rb +195 -0
- data/lib/zip/zip.rb +1848 -0
- data/lib/zip/zipfilesystem.rb +609 -0
- data/lib/zip/ziprequire.rb +90 -0
- data/tasks/ann.rake +81 -0
- data/tasks/bones.rake +21 -0
- data/tasks/gem.rake +121 -0
- data/tasks/manifest.rake +49 -0
- data/tasks/notes.rake +28 -0
- data/tasks/post_load.rake +39 -0
- data/tasks/rdoc.rake +51 -0
- data/tasks/rubyforge.rake +57 -0
- data/tasks/setup.rb +269 -0
- data/tasks/spec.rake +63 -0
- data/tasks/svn.rake +48 -0
- data/tasks/test.rake +38 -0
- data/test/unit/app_bundler_spec.rb +65 -0
- data/test/unit/bundler_spec.rb +27 -0
- data/test/unit/generator_spec.rb +49 -0
- data/test/unit/jar_builder_spec.rb +5 -0
- data/test/unit/options_spec.rb +97 -0
- data/test/unit/platform_spec.rb +29 -0
- data/test/unit/spec_helpers.rb +22 -0
- data/test/unit/web_bundler_spec.rb +83 -0
- metadata +501 -0
@@ -0,0 +1,52 @@
|
|
1
|
+
/*
|
2
|
+
Launch4j (http://launch4j.sourceforge.net/)
|
3
|
+
Cross-platform Java application wrapper for creating Windows native executables.
|
4
|
+
|
5
|
+
Copyright (c) 2004, 2007 Grzegorz Kowal
|
6
|
+
|
7
|
+
All rights reserved.
|
8
|
+
|
9
|
+
Redistribution and use in source and binary forms, with or without modification,
|
10
|
+
are permitted provided that the following conditions are met:
|
11
|
+
|
12
|
+
* Redistributions of source code must retain the above copyright notice,
|
13
|
+
this list of conditions and the following disclaimer.
|
14
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
15
|
+
this list of conditions and the following disclaimer in the documentation
|
16
|
+
and/or other materials provided with the distribution.
|
17
|
+
* Neither the name of the Launch4j nor the names of its contributors
|
18
|
+
may be used to endorse or promote products derived from this software without
|
19
|
+
specific prior written permission.
|
20
|
+
|
21
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
22
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
23
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
24
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
25
|
+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
26
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
27
|
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
28
|
+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
29
|
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
30
|
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
31
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
32
|
+
*/
|
33
|
+
|
34
|
+
/*
|
35
|
+
* Created on Apr 30, 2005
|
36
|
+
*/
|
37
|
+
package net.sf.launch4j.binding;
|
38
|
+
|
39
|
+
/**
|
40
|
+
* Signals a runtime error, a missing property in a Java Bean for example.
|
41
|
+
*
|
42
|
+
* @author Copyright (C) 2005 Grzegorz Kowal
|
43
|
+
*/
|
44
|
+
public class BindingException extends RuntimeException {
|
45
|
+
public BindingException(Throwable t) {
|
46
|
+
super(t);
|
47
|
+
}
|
48
|
+
|
49
|
+
public BindingException(String msg) {
|
50
|
+
super(msg);
|
51
|
+
}
|
52
|
+
}
|
@@ -0,0 +1,317 @@
|
|
1
|
+
/*
|
2
|
+
Launch4j (http://launch4j.sourceforge.net/)
|
3
|
+
Cross-platform Java application wrapper for creating Windows native executables.
|
4
|
+
|
5
|
+
Copyright (c) 2004, 2007 Grzegorz Kowal
|
6
|
+
|
7
|
+
All rights reserved.
|
8
|
+
|
9
|
+
Redistribution and use in source and binary forms, with or without modification,
|
10
|
+
are permitted provided that the following conditions are met:
|
11
|
+
|
12
|
+
* Redistributions of source code must retain the above copyright notice,
|
13
|
+
this list of conditions and the following disclaimer.
|
14
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
15
|
+
this list of conditions and the following disclaimer in the documentation
|
16
|
+
and/or other materials provided with the distribution.
|
17
|
+
* Neither the name of the Launch4j nor the names of its contributors
|
18
|
+
may be used to endorse or promote products derived from this software without
|
19
|
+
specific prior written permission.
|
20
|
+
|
21
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
22
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
23
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
24
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
25
|
+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
26
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
27
|
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
28
|
+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
29
|
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
30
|
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
31
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
32
|
+
*/
|
33
|
+
|
34
|
+
/*
|
35
|
+
* Created on Apr 30, 2005
|
36
|
+
*/
|
37
|
+
package net.sf.launch4j.binding;
|
38
|
+
|
39
|
+
import java.beans.PropertyChangeEvent;
|
40
|
+
import java.beans.PropertyChangeListener;
|
41
|
+
import java.util.HashMap;
|
42
|
+
import java.util.Iterator;
|
43
|
+
import java.util.Map;
|
44
|
+
|
45
|
+
import javax.swing.JComboBox;
|
46
|
+
import javax.swing.JComponent;
|
47
|
+
import javax.swing.JList;
|
48
|
+
import javax.swing.JRadioButton;
|
49
|
+
import javax.swing.JTextArea;
|
50
|
+
import javax.swing.JToggleButton;
|
51
|
+
import javax.swing.text.JTextComponent;
|
52
|
+
|
53
|
+
import org.apache.commons.beanutils.PropertyUtils;
|
54
|
+
|
55
|
+
/**
|
56
|
+
* Creates and handles bindings.
|
57
|
+
*
|
58
|
+
* @author Copyright (C) 2005 Grzegorz Kowal
|
59
|
+
*/
|
60
|
+
public class Bindings implements PropertyChangeListener {
|
61
|
+
private final Map _bindings = new HashMap();
|
62
|
+
private final Map _optComponents = new HashMap();
|
63
|
+
private boolean _modified = false;
|
64
|
+
|
65
|
+
/**
|
66
|
+
* Used to track component modifications.
|
67
|
+
*/
|
68
|
+
public void propertyChange(PropertyChangeEvent evt) {
|
69
|
+
String prop = evt.getPropertyName();
|
70
|
+
if ("AccessibleValue".equals(prop)
|
71
|
+
|| "AccessibleText".equals(prop)
|
72
|
+
|| "AccessibleVisibleData".equals(prop)) {
|
73
|
+
_modified = true;
|
74
|
+
}
|
75
|
+
}
|
76
|
+
|
77
|
+
/**
|
78
|
+
* Any of the components modified?
|
79
|
+
*/
|
80
|
+
public boolean isModified() {
|
81
|
+
return _modified;
|
82
|
+
}
|
83
|
+
|
84
|
+
public Binding getBinding(String property) {
|
85
|
+
return (Binding) _bindings.get(property);
|
86
|
+
}
|
87
|
+
|
88
|
+
private void registerPropertyChangeListener(JComponent c) {
|
89
|
+
c.getAccessibleContext().addPropertyChangeListener(this);
|
90
|
+
}
|
91
|
+
|
92
|
+
private void registerPropertyChangeListener(JComponent[] cs) {
|
93
|
+
for (int i = 0; i < cs.length; i++) {
|
94
|
+
cs[i].getAccessibleContext().addPropertyChangeListener(this);
|
95
|
+
}
|
96
|
+
}
|
97
|
+
|
98
|
+
private boolean isPropertyNull(IValidatable bean, Binding b) {
|
99
|
+
try {
|
100
|
+
for (Iterator iter = _optComponents.keySet().iterator(); iter.hasNext();) {
|
101
|
+
String property = (String) iter.next();
|
102
|
+
if (b.getProperty().startsWith(property)) {
|
103
|
+
return PropertyUtils.getProperty(bean, property) == null;
|
104
|
+
}
|
105
|
+
}
|
106
|
+
return false;
|
107
|
+
} catch (Exception e) {
|
108
|
+
throw new BindingException(e);
|
109
|
+
}
|
110
|
+
}
|
111
|
+
|
112
|
+
/**
|
113
|
+
* Enables or disables all components bound to properties that begin with given prefix.
|
114
|
+
*/
|
115
|
+
public void setComponentsEnabled(String prefix, boolean enabled) {
|
116
|
+
for (Iterator iter = _bindings.values().iterator(); iter.hasNext();) {
|
117
|
+
Binding b = (Binding) iter.next();
|
118
|
+
if (b.getProperty().startsWith(prefix)) {
|
119
|
+
b.setEnabled(enabled);
|
120
|
+
}
|
121
|
+
}
|
122
|
+
}
|
123
|
+
|
124
|
+
/**
|
125
|
+
* Clear all components, set them to their default values.
|
126
|
+
* Clears the _modified flag.
|
127
|
+
*/
|
128
|
+
public void clear(IValidatable bean) {
|
129
|
+
for (Iterator iter = _optComponents.values().iterator(); iter.hasNext();) {
|
130
|
+
((Binding) iter.next()).clear(bean);
|
131
|
+
}
|
132
|
+
for (Iterator iter = _bindings.values().iterator(); iter.hasNext();) {
|
133
|
+
((Binding) iter.next()).clear(bean);
|
134
|
+
}
|
135
|
+
_modified = false;
|
136
|
+
}
|
137
|
+
|
138
|
+
/**
|
139
|
+
* Copies data from the Java Bean to the UI components.
|
140
|
+
* Clears the _modified flag.
|
141
|
+
*/
|
142
|
+
public void put(IValidatable bean) {
|
143
|
+
for (Iterator iter = _optComponents.values().iterator(); iter.hasNext();) {
|
144
|
+
((Binding) iter.next()).put(bean);
|
145
|
+
}
|
146
|
+
for (Iterator iter = _bindings.values().iterator(); iter.hasNext();) {
|
147
|
+
Binding b = (Binding) iter.next();
|
148
|
+
if (isPropertyNull(bean, b)) {
|
149
|
+
b.clear(null);
|
150
|
+
} else {
|
151
|
+
b.put(bean);
|
152
|
+
}
|
153
|
+
}
|
154
|
+
_modified = false;
|
155
|
+
}
|
156
|
+
|
157
|
+
/**
|
158
|
+
* Copies data from UI components to the Java Bean and checks it's class invariants.
|
159
|
+
* Clears the _modified flag.
|
160
|
+
* @throws InvariantViolationException
|
161
|
+
* @throws BindingException
|
162
|
+
*/
|
163
|
+
public void get(IValidatable bean) {
|
164
|
+
try {
|
165
|
+
for (Iterator iter = _optComponents.values().iterator(); iter.hasNext();) {
|
166
|
+
((Binding) iter.next()).get(bean);
|
167
|
+
}
|
168
|
+
for (Iterator iter = _bindings.values().iterator(); iter.hasNext();) {
|
169
|
+
Binding b = (Binding) iter.next();
|
170
|
+
if (!isPropertyNull(bean, b)) {
|
171
|
+
b.get(bean);
|
172
|
+
}
|
173
|
+
}
|
174
|
+
bean.checkInvariants();
|
175
|
+
for (Iterator iter = _optComponents.keySet().iterator(); iter.hasNext();) {
|
176
|
+
String property = (String) iter.next();
|
177
|
+
IValidatable component = (IValidatable) PropertyUtils.getProperty(bean,
|
178
|
+
property);
|
179
|
+
if (component != null) {
|
180
|
+
component.checkInvariants();
|
181
|
+
}
|
182
|
+
}
|
183
|
+
_modified = false; // XXX
|
184
|
+
} catch (InvariantViolationException e) {
|
185
|
+
e.setBinding(getBinding(e.getProperty()));
|
186
|
+
throw e;
|
187
|
+
} catch (Exception e) {
|
188
|
+
throw new BindingException(e);
|
189
|
+
}
|
190
|
+
}
|
191
|
+
|
192
|
+
private Bindings add(Binding b) {
|
193
|
+
if (_bindings.containsKey(b.getProperty())) {
|
194
|
+
throw new BindingException(Messages.getString("Bindings.duplicate.binding"));
|
195
|
+
}
|
196
|
+
_bindings.put(b.getProperty(), b);
|
197
|
+
return this;
|
198
|
+
}
|
199
|
+
|
200
|
+
/**
|
201
|
+
* Add an optional (nullable) Java Bean component of type clazz.
|
202
|
+
*/
|
203
|
+
public Bindings addOptComponent(String property, Class clazz, JToggleButton c,
|
204
|
+
boolean enabledByDefault) {
|
205
|
+
Binding b = new OptComponentBinding(this, property, clazz, c, enabledByDefault);
|
206
|
+
if (_optComponents.containsKey(property)) {
|
207
|
+
throw new BindingException(Messages.getString("Bindings.duplicate.binding"));
|
208
|
+
}
|
209
|
+
_optComponents.put(property, b);
|
210
|
+
return this;
|
211
|
+
}
|
212
|
+
|
213
|
+
/**
|
214
|
+
* Add an optional (nullable) Java Bean component of type clazz.
|
215
|
+
*/
|
216
|
+
public Bindings addOptComponent(String property, Class clazz, JToggleButton c) {
|
217
|
+
return addOptComponent(property, clazz, c, false);
|
218
|
+
}
|
219
|
+
|
220
|
+
/**
|
221
|
+
* Handles JEditorPane, JTextArea, JTextField
|
222
|
+
*/
|
223
|
+
public Bindings add(String property, JTextComponent c, String defaultValue) {
|
224
|
+
registerPropertyChangeListener(c);
|
225
|
+
return add(new JTextComponentBinding(property, c, defaultValue));
|
226
|
+
}
|
227
|
+
|
228
|
+
/**
|
229
|
+
* Handles JEditorPane, JTextArea, JTextField
|
230
|
+
*/
|
231
|
+
public Bindings add(String property, JTextComponent c) {
|
232
|
+
registerPropertyChangeListener(c);
|
233
|
+
return add(new JTextComponentBinding(property, c, ""));
|
234
|
+
}
|
235
|
+
|
236
|
+
/**
|
237
|
+
* Handles JToggleButton, JCheckBox
|
238
|
+
*/
|
239
|
+
public Bindings add(String property, JToggleButton c, boolean defaultValue) {
|
240
|
+
registerPropertyChangeListener(c);
|
241
|
+
return add(new JToggleButtonBinding(property, c, defaultValue));
|
242
|
+
}
|
243
|
+
|
244
|
+
/**
|
245
|
+
* Handles JToggleButton, JCheckBox
|
246
|
+
*/
|
247
|
+
public Bindings add(String property, JToggleButton c) {
|
248
|
+
registerPropertyChangeListener(c);
|
249
|
+
return add(new JToggleButtonBinding(property, c, false));
|
250
|
+
}
|
251
|
+
|
252
|
+
/**
|
253
|
+
* Handles JRadioButton
|
254
|
+
*/
|
255
|
+
public Bindings add(String property, JRadioButton[] cs, int defaultValue) {
|
256
|
+
registerPropertyChangeListener(cs);
|
257
|
+
return add(new JRadioButtonBinding(property, cs, defaultValue));
|
258
|
+
}
|
259
|
+
|
260
|
+
/**
|
261
|
+
* Handles JRadioButton
|
262
|
+
*/
|
263
|
+
public Bindings add(String property, JRadioButton[] cs) {
|
264
|
+
registerPropertyChangeListener(cs);
|
265
|
+
return add(new JRadioButtonBinding(property, cs, 0));
|
266
|
+
}
|
267
|
+
|
268
|
+
/**
|
269
|
+
* Handles JTextArea
|
270
|
+
*/
|
271
|
+
public Bindings add(String property, JTextArea textArea, String defaultValue) {
|
272
|
+
registerPropertyChangeListener(textArea);
|
273
|
+
return add(new JTextComponentBinding(property, textArea, defaultValue));
|
274
|
+
}
|
275
|
+
|
276
|
+
/**
|
277
|
+
* Handles JTextArea lists
|
278
|
+
*/
|
279
|
+
public Bindings add(String property, JTextArea textArea) {
|
280
|
+
registerPropertyChangeListener(textArea);
|
281
|
+
return add(new JTextAreaBinding(property, textArea));
|
282
|
+
}
|
283
|
+
|
284
|
+
/**
|
285
|
+
* Handles Optional JTextArea lists
|
286
|
+
*/
|
287
|
+
public Bindings add(String property, String stateProperty,
|
288
|
+
JToggleButton button, JTextArea textArea) {
|
289
|
+
registerPropertyChangeListener(button);
|
290
|
+
registerPropertyChangeListener(textArea);
|
291
|
+
return add(new OptJTextAreaBinding(property, stateProperty, button, textArea));
|
292
|
+
}
|
293
|
+
|
294
|
+
/**
|
295
|
+
* Handles JList
|
296
|
+
*/
|
297
|
+
public Bindings add(String property, JList list) {
|
298
|
+
registerPropertyChangeListener(list);
|
299
|
+
return add(new JListBinding(property, list));
|
300
|
+
}
|
301
|
+
|
302
|
+
/**
|
303
|
+
* Handles JComboBox
|
304
|
+
*/
|
305
|
+
public Bindings add(String property, JComboBox combo, int defaultValue) {
|
306
|
+
registerPropertyChangeListener(combo);
|
307
|
+
return add(new JComboBoxBinding(property, combo, defaultValue));
|
308
|
+
}
|
309
|
+
|
310
|
+
/**
|
311
|
+
* Handles JComboBox
|
312
|
+
*/
|
313
|
+
public Bindings add(String property, JComboBox combo) {
|
314
|
+
registerPropertyChangeListener(combo);
|
315
|
+
return add(new JComboBoxBinding(property, combo, 0));
|
316
|
+
}
|
317
|
+
}
|
@@ -0,0 +1,44 @@
|
|
1
|
+
/*
|
2
|
+
Launch4j (http://launch4j.sourceforge.net/)
|
3
|
+
Cross-platform Java application wrapper for creating Windows native executables.
|
4
|
+
|
5
|
+
Copyright (c) 2004, 2007 Grzegorz Kowal
|
6
|
+
|
7
|
+
All rights reserved.
|
8
|
+
|
9
|
+
Redistribution and use in source and binary forms, with or without modification,
|
10
|
+
are permitted provided that the following conditions are met:
|
11
|
+
|
12
|
+
* Redistributions of source code must retain the above copyright notice,
|
13
|
+
this list of conditions and the following disclaimer.
|
14
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
15
|
+
this list of conditions and the following disclaimer in the documentation
|
16
|
+
and/or other materials provided with the distribution.
|
17
|
+
* Neither the name of the Launch4j nor the names of its contributors
|
18
|
+
may be used to endorse or promote products derived from this software without
|
19
|
+
specific prior written permission.
|
20
|
+
|
21
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
22
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
23
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
24
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
25
|
+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
26
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
27
|
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
28
|
+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
29
|
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
30
|
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
31
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
32
|
+
*/
|
33
|
+
|
34
|
+
/*
|
35
|
+
* Created on 2004-01-30
|
36
|
+
*/
|
37
|
+
package net.sf.launch4j.binding;
|
38
|
+
|
39
|
+
/**
|
40
|
+
* @author Copyright (C) 2004 Grzegorz Kowal
|
41
|
+
*/
|
42
|
+
public interface IValidatable {
|
43
|
+
public void checkInvariants();
|
44
|
+
}
|
@@ -0,0 +1,67 @@
|
|
1
|
+
/*
|
2
|
+
Launch4j (http://launch4j.sourceforge.net/)
|
3
|
+
Cross-platform Java application wrapper for creating Windows native executables.
|
4
|
+
|
5
|
+
Copyright (c) 2004, 2007 Grzegorz Kowal
|
6
|
+
|
7
|
+
All rights reserved.
|
8
|
+
|
9
|
+
Redistribution and use in source and binary forms, with or without modification,
|
10
|
+
are permitted provided that the following conditions are met:
|
11
|
+
|
12
|
+
* Redistributions of source code must retain the above copyright notice,
|
13
|
+
this list of conditions and the following disclaimer.
|
14
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
15
|
+
this list of conditions and the following disclaimer in the documentation
|
16
|
+
and/or other materials provided with the distribution.
|
17
|
+
* Neither the name of the Launch4j nor the names of its contributors
|
18
|
+
may be used to endorse or promote products derived from this software without
|
19
|
+
specific prior written permission.
|
20
|
+
|
21
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
22
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
23
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
24
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
25
|
+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
26
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
27
|
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
28
|
+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
29
|
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
30
|
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
31
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
32
|
+
*/
|
33
|
+
|
34
|
+
/*
|
35
|
+
* Created on Jun 23, 2003
|
36
|
+
*/
|
37
|
+
package net.sf.launch4j.binding;
|
38
|
+
|
39
|
+
/**
|
40
|
+
* @author Copyright (C) 2003 Grzegorz Kowal
|
41
|
+
*/
|
42
|
+
public class InvariantViolationException extends RuntimeException {
|
43
|
+
private final String _property;
|
44
|
+
private Binding _binding;
|
45
|
+
|
46
|
+
public InvariantViolationException(String msg) {
|
47
|
+
super(msg);
|
48
|
+
_property = null;
|
49
|
+
}
|
50
|
+
|
51
|
+
public InvariantViolationException(String property, String msg) {
|
52
|
+
super(msg);
|
53
|
+
_property = property;
|
54
|
+
}
|
55
|
+
|
56
|
+
public String getProperty() {
|
57
|
+
return _property;
|
58
|
+
}
|
59
|
+
|
60
|
+
public Binding getBinding() {
|
61
|
+
return _binding;
|
62
|
+
}
|
63
|
+
|
64
|
+
public void setBinding(Binding binding) {
|
65
|
+
_binding = binding;
|
66
|
+
}
|
67
|
+
}
|
@@ -0,0 +1,119 @@
|
|
1
|
+
/*
|
2
|
+
Launch4j (http://launch4j.sourceforge.net/)
|
3
|
+
Cross-platform Java application wrapper for creating Windows native executables.
|
4
|
+
|
5
|
+
Copyright (c) 2007 Ian Roberts
|
6
|
+
|
7
|
+
All rights reserved.
|
8
|
+
|
9
|
+
Redistribution and use in source and binary forms, with or without modification,
|
10
|
+
are permitted provided that the following conditions are met:
|
11
|
+
|
12
|
+
* Redistributions of source code must retain the above copyright notice,
|
13
|
+
this list of conditions and the following disclaimer.
|
14
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
15
|
+
this list of conditions and the following disclaimer in the documentation
|
16
|
+
and/or other materials provided with the distribution.
|
17
|
+
* Neither the name of the Launch4j nor the names of its contributors
|
18
|
+
may be used to endorse or promote products derived from this software without
|
19
|
+
specific prior written permission.
|
20
|
+
|
21
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
22
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
23
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
24
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
25
|
+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
26
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
27
|
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
28
|
+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
29
|
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
30
|
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
31
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
32
|
+
*/
|
33
|
+
|
34
|
+
/*
|
35
|
+
* Created on May 10, 2005
|
36
|
+
*/
|
37
|
+
package net.sf.launch4j.binding;
|
38
|
+
|
39
|
+
import java.awt.Color;
|
40
|
+
|
41
|
+
import javax.swing.JComboBox;
|
42
|
+
|
43
|
+
import org.apache.commons.beanutils.PropertyUtils;
|
44
|
+
|
45
|
+
/**
|
46
|
+
* @author Copyright (C) 2007 Ian Roberts
|
47
|
+
*/
|
48
|
+
public class JComboBoxBinding implements Binding {
|
49
|
+
private final String _property;
|
50
|
+
private final JComboBox _combo;
|
51
|
+
private final int _defaultValue;
|
52
|
+
private final Color _validColor;
|
53
|
+
|
54
|
+
public JComboBoxBinding(String property, JComboBox combo, int defaultValue) {
|
55
|
+
if (property == null || combo == null) {
|
56
|
+
throw new NullPointerException();
|
57
|
+
}
|
58
|
+
if (property.equals("")
|
59
|
+
|| combo.getItemCount() == 0
|
60
|
+
|| defaultValue < 0 || defaultValue >= combo.getItemCount()) {
|
61
|
+
throw new IllegalArgumentException();
|
62
|
+
}
|
63
|
+
_property = property;
|
64
|
+
_combo = combo;
|
65
|
+
_defaultValue = defaultValue;
|
66
|
+
_validColor = combo.getBackground();
|
67
|
+
}
|
68
|
+
|
69
|
+
public String getProperty() {
|
70
|
+
return _property;
|
71
|
+
}
|
72
|
+
|
73
|
+
public void clear(IValidatable bean) {
|
74
|
+
select(_defaultValue);
|
75
|
+
}
|
76
|
+
|
77
|
+
public void put(IValidatable bean) {
|
78
|
+
try {
|
79
|
+
Integer i = (Integer) PropertyUtils.getProperty(bean, _property);
|
80
|
+
if (i == null) {
|
81
|
+
throw new BindingException(
|
82
|
+
Messages.getString("JComboBoxBinding.property.null"));
|
83
|
+
}
|
84
|
+
select(i.intValue());
|
85
|
+
} catch (Exception e) {
|
86
|
+
throw new BindingException(e);
|
87
|
+
}
|
88
|
+
}
|
89
|
+
|
90
|
+
public void get(IValidatable bean) {
|
91
|
+
try {
|
92
|
+
PropertyUtils.setProperty(bean, _property, new Integer(_combo.getSelectedIndex()));
|
93
|
+
return;
|
94
|
+
} catch (Exception e) {
|
95
|
+
throw new BindingException(e);
|
96
|
+
}
|
97
|
+
}
|
98
|
+
|
99
|
+
private void select(int index) {
|
100
|
+
if (index < 0 || index >= _combo.getItemCount()) {
|
101
|
+
throw new BindingException(
|
102
|
+
Messages.getString("JComboBoxBinding.index.out.of.bounds"));
|
103
|
+
}
|
104
|
+
_combo.setSelectedIndex(index);
|
105
|
+
}
|
106
|
+
|
107
|
+
public void markValid() {
|
108
|
+
_combo.setBackground(_validColor);
|
109
|
+
_combo.requestFocusInWindow();
|
110
|
+
}
|
111
|
+
|
112
|
+
public void markInvalid() {
|
113
|
+
_combo.setBackground(Binding.INVALID_COLOR);
|
114
|
+
}
|
115
|
+
|
116
|
+
public void setEnabled(boolean enabled) {
|
117
|
+
_combo.setEnabled(enabled);
|
118
|
+
}
|
119
|
+
}
|