diff options
author | Jonathan Bauer | 2016-09-09 15:32:39 +0200 |
---|---|---|
committer | Jonathan Bauer | 2016-09-09 15:32:39 +0200 |
commit | be61c6453178f9383bcbeb2d2071618cd4dc4388 (patch) | |
tree | 5e3324b00b934022d0f2cd326d39d23ac93364fc /dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/NetrulesConfigurator.java | |
parent | [client] do not close Netrules page if parsing returned an error (diff) | |
download | tutor-module-be61c6453178f9383bcbeb2d2071618cd4dc4388.tar.gz tutor-module-be61c6453178f9383bcbeb2d2071618cd4dc4388.tar.xz tutor-module-be61c6453178f9383bcbeb2d2071618cd4dc4388.zip |
[client] minor: update commentaries of NetrulesConfigurator
Diffstat (limited to 'dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/NetrulesConfigurator.java')
-rw-r--r-- | dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/NetrulesConfigurator.java | 31 |
1 files changed, 11 insertions, 20 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/NetrulesConfigurator.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/NetrulesConfigurator.java index 040fc6eb..793e6e4a 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/NetrulesConfigurator.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/NetrulesConfigurator.java @@ -30,7 +30,7 @@ import org.openslx.dozmod.gui.helper.MessageType; import org.openslx.dozmod.gui.helper.TextChangeListener; /** - * Widget for netrules configuration options for lectures + * Widget for netrules configuration of lectures */ public class NetrulesConfigurator extends NetrulesConfiguratorLayout { @@ -66,25 +66,20 @@ public class NetrulesConfigurator extends NetrulesConfiguratorLayout { } /** - * Gets the state of the widget. This will first try to parse the - * tpNetworkRules and taRunScript and build the corresponding - * AdvancedConfiguration Object returned. + * Gets the state of the widget as a list of netrules. Internally it first transforms + * the input text in a list of netrules. * - * @return advanced configuration object composed of the parsed network - * rules as List<NetRule> and the raw runscript text as String - * @see org.openslx.dozmod.gui.control.NetrulesConfigurator.AdvancedConfiguration + * @return the list of rules as parsed by parseNetRules() */ public List<NetRule> getState() { // cleanup the TextPane for network rules if needed String input = tpNetworkRules.getText().trim(); - final List<NetRule> rules = parseNetRules(input); - return rules; + return parseNetRules(input); } /** - * Sets the state of this widget to the given AdvancedConfiguration. Basicly - * this sets the content of the text areas to the corresponding network - * rules/runscript as given by the AdvancedConfiguration object + * Sets the state of this widget to the given list of netrules. This will internally + * transform the list to its string representation * * @param config * AdvancedConfiguration to set the state to @@ -129,14 +124,11 @@ public class NetrulesConfigurator extends NetrulesConfiguratorLayout { } /** - * Parsed the given rawNetRules String to a list of NetRule + * Parses the given rawNetRules String to a list of NetRule * * @param rawNetRules * the raw text to be parsed - * @return list of valid net rules parsed from the given rawNetRules, - * invalid ones are not included - * @throws Exception - * when parsing fails + * @return list of netrules if successful. If any errors occured while parsing, null is returned. */ public List<NetRule> parseNetRules(final String rawNetRules) { if (rawNetRules == null) @@ -340,7 +332,7 @@ public class NetrulesConfigurator extends NetrulesConfiguratorLayout { } /** - * Custom event mechanism to detect changes to the user list (Mostly needed + * Custom event mechanism to detect changes to the netrules list (Mostly needed * for the reactToChange() stuff in LectureDetailsWindow) */ protected EventListenerList listenerList = new EventListenerList(); @@ -384,8 +376,7 @@ public class NetrulesConfigurator extends NetrulesConfiguratorLayout { } /** - * Internal layout class for the advanced configurator (to keep it clean even - * for widgets) + * Internal layout class for this widget */ class NetrulesConfiguratorLayout extends JPanel { |