01: /*
02: JSmooth: a VM wrapper toolkit for Windows
03: Copyright (C) 2003 Rodrigo Reyes <reyes@charabia.net>
04:
05: This program is free software; you can redistribute it and/or modify
06: it under the terms of the GNU General Public License as published by
07: the Free Software Foundation; either version 2 of the License, or
08: (at your option) any later version.
09:
10: This program is distributed in the hope that it will be useful,
11: but WITHOUT ANY WARRANTY; without even the implied warranty of
12: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13: GNU General Public License for more details.
14:
15: You should have received a copy of the GNU General Public License
16: along with this program; if not, write to the Free Software
17: Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18:
19: */
20:
21: package net.charabia.jsmoothgen.application;
22:
23: public class JVMSearchElement {
24: static public final JVMSearchElement REGISTRY = new JVMSearchElement(
25: "registry", "Windows Registry");
26: static public final JVMSearchElement JAVA_HOME = new JVMSearchElement(
27: "javahome", "JAVA_HOME environment variable");
28: static public final JVMSearchElement JRE_PATH = new JVMSearchElement(
29: "jrepath", "JRE_PATH environment variable");
30: static public final JVMSearchElement JDK_PATH = new JVMSearchElement(
31: "jdkpath", "JDK_PATH environment variable");
32: static public final JVMSearchElement EXEPATH = new JVMSearchElement(
33: "exepath", "Windows executable path (PATH env var)");
34: static public final JVMSearchElement JVIEW = new JVMSearchElement(
35: "jview", "Windows JView");
36:
37: static public final JVMSearchElement[] Elements = { REGISTRY,
38: JAVA_HOME, JRE_PATH, JDK_PATH, EXEPATH, JVIEW };
39:
40: public static JVMSearchElement getStandardElement(String id) {
41: for (int i = 0; i < Elements.length; i++) {
42: if (Elements[i].getId().equals(id))
43: return Elements[i];
44: }
45: return null;
46: }
47:
48: private String m_id;
49: private String m_name;
50:
51: /** Creates a new instance of JVMSearchElement */
52: public JVMSearchElement() {
53: }
54:
55: public JVMSearchElement(String id, String name) {
56: m_id = id;
57: m_name = name;
58: }
59:
60: public String getId() {
61: return m_id;
62: }
63:
64: public String getName() {
65: return m_name;
66: }
67:
68: public String toString() {
69: return m_name;
70: }
71: }
|