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