KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > launch4j > config > Msg


1 /*
2     Launch4j (http://launch4j.sourceforge.net/)
3     Cross-platform Java application wrapper for creating Windows native executables.
4
5     Copyright (C) 2004, 2006 Grzegorz Kowal
6
7     This program is free software; you can redistribute it and/or modify
8     it under the terms of the GNU General Public License as published by
9     the Free Software Foundation; either version 2 of the License, or
10     (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 St, Fifth Floor, Boston, MA 02110-1301 USA
20 */

21
22 /*
23  * Created on Oct 8, 2006
24  */

25 package net.sf.launch4j.config;
26
27 import net.sf.launch4j.binding.IValidatable;
28 import net.sf.launch4j.binding.Validator;
29
30 /**
31  * @author Copyright (C) 2006 Grzegorz Kowal
32  */

33 public class Msg implements IValidatable {
34     private String JavaDoc startupErr;
35     private String JavaDoc bundledJreErr;
36     private String JavaDoc jreVersionErr;
37     private String JavaDoc launcherErr;
38
39     public void checkInvariants() {
40         Validator.checkOptString(startupErr, 1024, "startupErr",
41                 Messages.getString("Msg.startupErr"));
42         Validator.checkOptString(bundledJreErr, 1024, "bundledJreErr",
43                 Messages.getString("Msg.bundledJreErr"));
44         Validator.checkOptString(jreVersionErr, 1024, "jreVersionErr",
45                 Messages.getString("Msg.jreVersionErr"));
46         Validator.checkOptString(launcherErr, 1024, "launcherErr",
47                 Messages.getString("Msg.launcherErr"));
48     }
49
50     public String JavaDoc getStartupErr() {
51         return !Validator.isEmpty(startupErr) ? startupErr
52                 : "An error occurred while starting the application.";
53     }
54     
55     public void setStartupErr(String JavaDoc startupErr) {
56         this.startupErr = startupErr;
57     }
58
59     public String JavaDoc getBundledJreErr() {
60         return !Validator.isEmpty(bundledJreErr) ? bundledJreErr
61                 : "This application was configured to use a bundled Java Runtime" +
62                         " Environment but the runtime is missing or corrupted.";
63     }
64
65     public void setBundledJreErr(String JavaDoc bundledJreErr) {
66         this.bundledJreErr = bundledJreErr;
67     }
68
69     public String JavaDoc getJreVersionErr() {
70         return !Validator.isEmpty(jreVersionErr) ? jreVersionErr
71                 : "This application requires a Java Runtime Environment";
72     }
73
74     public void setJreVersionErr(String JavaDoc jreVersionErr) {
75         this.jreVersionErr = jreVersionErr;
76     }
77     
78     public String JavaDoc getLauncherErr() {
79         return !Validator.isEmpty(launcherErr) ? launcherErr
80                 : "The registry refers to a nonexistent Java Runtime Environment" +
81                         " installation or the runtime is corrupted.";
82     }
83     
84     public void setLauncherErr(String JavaDoc launcherErr) {
85         this.launcherErr = launcherErr;
86     }
87 }
88
Popular Tags