* Fills the components like text fielsd. Leaves the default values if no
* value is found in the user preferences. The values where set prior to this
* operation to default values.
*/
private void loadUserPrefsGUI() {
OwnPreferences prefs =
OwnPreferences.userNodeForPackage(this.getClass());
// Position frame
int x = prefs.getInt(JFrameLogginConfigurator.FRAME_X, 10);
int y = prefs.getInt(JFrameLogginConfigurator.FRAME_Y, 10);
int w = prefs.getInt(JFrameLogginConfigurator.FRAME_W, 10);
int h = prefs.getInt(JFrameLogginConfigurator.FRAME_H, 10);
// Fill components. Leave value if user pref not found.
String s = prefs.get(JFrameLogginConfigurator.USE_FILE_HANDLER, "");
if (!"".equals(s)) {
this.jCheckBoxUseFileHandler.setSelected(false);
if (s.equalsIgnoreCase("true")) {
this.jCheckBoxUseFileHandler.setSelected(true);
}
}
s = prefs.get(JFrameLogginConfigurator.USE_CONSOLE_HANDLER, "");
if (!"".equals(s)) {
this.jCheckBoxUseConsoleHandler.setSelected(false);
if (s.equalsIgnoreCase("true")) {
this.jCheckBoxUseConsoleHandler.setSelected(true);
}
}
s = prefs.get(JFrameLogginConfigurator.LOG_LEVEL, "");
if (!"".equals(s)) {
this.jComboBoxLogLevel.setSelectedItem(s);
}
s = prefs.get(JFrameLogginConfigurator.LOG_DIRECTORY, "");
if (!"".equals(s)) {
this.jTextFieldDirectory.setText(s);
}
s = prefs.get(JFrameLogginConfigurator.LOG_FILE_NAME, "");
if (!"".equals(s)) {
this.jTextFieldFileName.setText(s);
}
s = prefs.get(JFrameLogginConfigurator.LOG_FILE_COUNT, "");
if (!"".equals(s)) {
this.jTextFieldMaxFileCount.setText(s);
}
s = prefs.get(JFrameLogginConfigurator.LOG_FILE_SIZE, "");
if (!"".equals(s)) {
this.jTextFieldMaxFileSize.setText(s);
}
s = prefs.get(JFrameLogginConfigurator.LOG_FILE_APPEND, "");
if (!"".equals(s)) {
this.jCheckBoxAppendFile.setSelected(false);
if (s.equalsIgnoreCase("true")) {
this.jCheckBoxAppendFile.setSelected(true);
}
}
s = prefs.get(JFrameLogginConfigurator.FORMATTER, "");
if (!"".equals(s)) {
this.jTextFieldFormatter.setText(s);
}
s = prefs.get(JFrameLogginConfigurator.LOG_CONFIG_FILE, "");
if (!"".equals(s)) {
this.jTextFieldLogConfigFile.setText(s);
}
this.pack();