KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sourceforge > tracelog > utils > ProjectProperties


1 /*
2  * ProjectProperties.java May 7, 2007
3  */

4 package net.sourceforge.tracelog.utils;
5
6 import java.util.Properties JavaDoc;
7
8 import org.apache.log4j.Logger;
9
10 public class ProjectProperties {
11     private static Logger log = Logger.getLogger(ProjectProperties.class);
12     private static final String JavaDoc FILE_PROJECT_PROPERTIES = "/net/sourceforge/tracelog/resources/resource.properties";
13     private static ProjectProperties projectProperties;
14     private Properties JavaDoc props;
15
16     private ProjectProperties() {
17         props = new Properties JavaDoc();
18
19         try {
20             props.load(Util.getOwnResource(FILE_PROJECT_PROPERTIES));
21         }
22         catch (Exception JavaDoc e) {
23             log.error(e.getMessage());
24         }
25     }
26
27     public static ProjectProperties getInstance() {
28         if (projectProperties == null) {
29             projectProperties = new ProjectProperties();
30         }
31
32         return projectProperties;
33     }
34
35     public String JavaDoc getApplicationTitle() {
36         return props.getProperty("app.title");
37     }
38
39     public String JavaDoc getAuthorName() {
40         return props.getProperty("author.name");
41     }
42
43     public String JavaDoc getShellIconPath() {
44         return props.getProperty("shell.icon.path");
45     }
46
47     public String JavaDoc getMainTabItemName() {
48         return props.getProperty("main.tab.item.name");
49     }
50
51     public String JavaDoc getOldConfigFilePath() {
52         return props.getProperty("old.config.file.path");
53     }
54
55     public String JavaDoc getNewConfigFilePath() {
56         return props.getProperty("new.config.file.path");
57     }
58
59     public String JavaDoc getXMLConfigFilePath() {
60         return props.getProperty("xml.config.file.path");
61     }
62
63     public String JavaDoc getUpdateURL() {
64         return props.getProperty("url.update");
65     }
66
67     public String JavaDoc getProjectHomeURL() {
68         return props.getProperty("url.home");
69     }
70
71     public String JavaDoc getTutorialURL() {
72         return props.getProperty("url.tutorial");
73     }
74
75     public String JavaDoc getBugReportURL() {
76         return props.getProperty("url.bug.report");
77     }
78
79     public String JavaDoc getFeedbackURL() {
80         return props.getProperty("url.feedback");
81     }
82
83     public String JavaDoc getUpdateCheckerURL() {
84         return props.getProperty("url.update.checker");
85     }
86
87     public String JavaDoc getVersionFilePath() {
88         return props.getProperty("file.version");
89     }
90
91     public String JavaDoc getIconConfig() {
92         return props.getProperty("icon.config");
93     }
94
95     public String JavaDoc getIconClear() {
96         return props.getProperty("icon.clear");
97     }
98
99     public String JavaDoc getIconZoomIn() {
100         return props.getProperty("icon.zoom.in");
101     }
102
103     public String JavaDoc getIconZoomOut() {
104         return props.getProperty("icon.zoom.out");
105     }
106
107     public String JavaDoc getIconScrollLock() {
108         return props.getProperty("icon.scroll.lock");
109     }
110
111     public String JavaDoc getIconOpenFile() {
112         return props.getProperty("icon.open.file");
113     }
114
115     public String JavaDoc getIconActive() {
116         return props.getProperty("icon.active");
117     }
118
119     public String JavaDoc getIconStart() {
120         return props.getProperty("icon.start");
121     }
122
123     public String JavaDoc getIconStop() {
124         return props.getProperty("icon.stop");
125     }
126
127     public String JavaDoc getIconClearAll() {
128         return props.getProperty("icon.clear.all");
129     }
130
131     public String JavaDoc getMainShell() {
132         return props.getProperty("shell.main");
133     }
134
135     public String JavaDoc getAboutShell() {
136         return props.getProperty("shell.about");
137     }
138
139     public String JavaDoc getHistoryShell() {
140         return props.getProperty("shell.history");
141     }
142
143     public String JavaDoc getTrayShell() {
144         return props.getProperty("shell.tray");
145     }
146
147     public String JavaDoc getMainShellButtonBar() {
148         return props.getProperty("component.shell.main.button.bar");
149     }
150
151     public String JavaDoc getMainShellMenuBar() {
152         return props.getProperty("component.shell.main.menu.bar");
153     }
154
155     public String JavaDoc getMainShellLogViewer() {
156         return props.getProperty("component.shell.main.log.viewer");
157     }
158
159     public String JavaDoc getOptionShellLogConfigColorChooser() {
160         return props.getProperty("component.shell.option.log.config.color.chooser");
161     }
162
163     public String JavaDoc getOptionShellLogConfig() {
164         return props.getProperty("component.shell.option.log.config");
165     }
166
167     public String JavaDoc getOptionShellGeneral() {
168         return props.getProperty("component.shell.option.general");
169     }
170
171     public String JavaDoc getOptionShell() {
172         return props.getProperty("shell.option");
173     }
174
175     public String JavaDoc[] getSampleServerConfigs() {
176         return new String JavaDoc[] {
177                 props.getProperty("sample.server.config.1"),
178                 props.getProperty("sample.server.config.2"),
179                 props.getProperty("sample.server.config.3")
180         };
181     }
182 }
183
Popular Tags