aboutsummaryrefslogtreecommitdiffstats
path: root/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java
diff options
context:
space:
mode:
authorOmair Majid <[email protected]>2010-12-20 09:26:16 -0500
committerOmair Majid <[email protected]>2010-12-20 09:26:16 -0500
commit3c92b8a089bdbe50943c1fdfcc8eee46f2948054 (patch)
tree03fa8ca4911d45b5873f98ce6de972c4663ef07d /netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java
parentef9a3f269781353eaf8b2cfb74a68b5f33265ad7 (diff)
add command line interface to the control panel
2010-12-20 Omair Majid <[email protected]> * Makefile.am ($(NETX_DIR)/launcher/controlpanel/%.o): Set program name, and launch net.sourceforge.jnlp.controlpanel.CommandLine. * netx/net/sourceforge/jnlp/config/Defaults.java (getDefaults): Set descriptions to Unknown rather than the name. Set source to localized form of internal. * netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java (getProperty): Check for nulls. (setProperty): Add unknown as description and source for new properties. (checkAndFixConfiguration): Fix translation constants. (parsePropertiesFile): Use unknown as description. * netx/net/sourceforge/jnlp/controlpanel/CommandLine.java: New file (CommandLine): New method. (handleHelpCommand): Likewise. (printListHelp): Likewise. (handleListCommand): Likewise. (printGetHelp): Likewise. (handleGetCommand): Likewise. (printSetHelp): Likewise. (handleSetCommand): Likewise. (printResetHelp): Likewise. (handleResetCommand): Likewise. (printInfoHelp): Likewise. (handleInfoCommand): Likewise. (printCheckHelp): Likewise. (handleCheckCommand): Likewise. (handle): Likewise. (main): Likewise. * netx/net/sourceforge/jnlp/resources/Messages.properties: Add Usage, Unknown, RConfigurationFatal, DCIncorrectValue, DCSourceInternal, DCUnknownSettingWithName, VVPossibleValues, CLNoInfo, CLValue, CLValueSource, CLDescription, CLUnknownCommand CLUnknownProperty, CLNoIssuesFound, CLIncorrectValue, CLListDescription, CLGetDescription, CLSetDescription, CLResetDescription, CLInfoDescription, CLCheckDescription and CLHelpDescription. Remove DCErrorInSetting and DCUnknownSettingWithVal.
Diffstat (limited to 'netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java')
-rw-r--r--netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java16
1 files changed, 10 insertions, 6 deletions
diff --git a/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java b/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java
index dd329aa..a07df1f 100644
--- a/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java
+++ b/netx/net/sourceforge/jnlp/config/DeploymentConfiguration.java
@@ -267,7 +267,11 @@ public final class DeploymentConfiguration {
}
}
- return currentConfiguration.get(key).getValue();
+ String value = null;
+ if (currentConfiguration.get(key) != null) {
+ value = currentConfiguration.get(key).getValue();
+ }
+ return value;
}
/**
@@ -319,7 +323,7 @@ public final class DeploymentConfiguration {
currentValue.setValue(value);
}
} else {
- currentValue = new Setting<String>(key, key, false, null, null, value, "<unknown>");
+ currentValue = new Setting<String>(key, R("Unknown"), false, null, null, value, R("Unknown"));
currentConfiguration.put(key, currentValue);
}
}
@@ -341,7 +345,7 @@ public final class DeploymentConfiguration {
if (!(s.getName().equals(key))) {
System.out.println(R("DCInternal", "key " + key + " does not match setting name " + s.getName()));
} else if (!defaults.containsKey(key)) {
- System.out.println(R("DCUnknownSettingWithVal", key));
+ System.out.println(R("DCUnknownSettingWithName", key));
} else {
ValueValidator checker = defaults.get(key).getValidator();
if (checker == null) {
@@ -351,7 +355,7 @@ public final class DeploymentConfiguration {
try {
checker.validate(s.getValue());
} catch (IllegalArgumentException e) {
- System.out.println(R("DCErrorInSetting", key, s.getValue(), s.getDefaultValue(), checker.getPossibleValues()));
+ System.out.println(R("DCIncorrectValue", key, s.getValue(), checker.getPossibleValues()));
s.setValue(s.getDefaultValue());
}
}
@@ -546,7 +550,7 @@ public final class DeploymentConfiguration {
String realKey = key.substring(0, key.length() - ".locked".length());
Setting<String> configValue = result.get(realKey);
if (configValue == null) {
- configValue = new Setting<String>(realKey, realKey, true, null, null, null, propertiesFile.toString());
+ configValue = new Setting<String>(realKey, R("Unknown"), true, null, null, null, propertiesFile.toString());
result.put(realKey, configValue);
} else {
configValue.setLocked(true);
@@ -556,7 +560,7 @@ public final class DeploymentConfiguration {
String newValue = properties.getProperty(key);
Setting<String> configValue = result.get(key);
if (configValue == null) {
- configValue = new Setting<String>(key, key, false, null, null, newValue, propertiesFile.toString());
+ configValue = new Setting<String>(key, R("Unknown"), false, null, null, newValue, propertiesFile.toString());
result.put(key, configValue);
} else {
configValue.setValue(newValue);