GUACAMOLE-470: Allow TEXT fields to be associated with predefined sets of known-good values.

This commit is contained in:
Michael Jumper
2018-06-12 12:37:07 -07:00
parent a8bb6fe966
commit 426a7919b3
4 changed files with 66 additions and 1 deletions

View File

@@ -19,6 +19,8 @@
package org.apache.guacamole.form;
import java.util.Collection;
/**
* Represents a basic text field. The field may generally contain any data, but
* may not contain multiple lines.
@@ -35,6 +37,21 @@ public class TextField extends Field {
super(name, Field.Type.TEXT);
}
/**
* Creates a new TextField with the given name and possible values. As a
* text field may contain any data by definition, any provided options are
* simply known-good values.
*
* @param name
* The unique name to associate with this field.
*
* @param options
* A set of known legal options for this field.
*/
public TextField(String name, Collection<String> options) {
super(name, Field.Type.TEXT, options);
}
/**
* Parses the given string, interpreting empty strings as equivalent to
* null. For all other cases, the given string is returned verbatim.