Examples of TextField


Examples of org.beryl.gui.widgets.TextField

/**
* A validator for long numbers
*/
public class LongValidator implements Validator {
  public void validate(View view) throws ValidationException {
    TextField field = (TextField) view;
    String text = field.getText();

    try {
      Long.parseLong(text);
    } catch (NumberFormatException e) {
      throw new ValidationException(view, InternationalizationManager.getString("xmlgui.validator.number.invalid"));
View Full Code Here

Examples of org.beryl.gui.widgets.TextField

/**
* A validator for floating point numbers
*/
public class DoubleValidator implements Validator {
  public void validate(View view) throws ValidationException {
    TextField field = (TextField) view;
    String text = field.getText();

    try {
      Double.parseDouble(text);
    } catch (NumberFormatException e) {
      throw new ValidationException(view, InternationalizationManager.getString("xmlgui.validator.number.invalid"));
View Full Code Here

Examples of org.beryl.gui.widgets.TextField

        });
      }

      Panel panel = new Panel(null, null);
      panel.setProperty("layout", new GridLayout(1, 2));
      TextField widthField = new TextField(panel, null);
      widthField.addValidator(new IntegerValidator());
      widthField.setProperty("key", "width");
      TextField heightField = new TextField(panel, null);
      heightField.addValidator(new IntegerValidator());
      heightField.setProperty("key", "height");
      panel.addChild(widthField, null);
      panel.addChild(heightField, null);
      panel.recursiveSetDataModel(dataModel);

      widthField.finalizeConstruction();
      heightField.finalizeConstruction();

      return panel;
    }
View Full Code Here

Examples of org.beryl.gui.widgets.TextField

    public Widget getEditor(Table table, Object value, TableRow row, String key) throws GUIException {
      MapDataModel dataModel = new MapDataModel();
      dataModel.setValue("value", value);

      Panel panel = new Panel(null, null);
      TextField textField = new TextField(panel, null);
      textField.setProperty("key", "value");
      textField.finalizeConstruction();

      panel.addChild(textField, null);
      panel.recursiveSetDataModel(dataModel);

      return panel;
View Full Code Here

Examples of org.beryl.gui.widgets.TextField

          }
        }
      });

      Panel panel = new Panel(null, null);
      TextField textField = new TextField(panel, null);
      textField.setProperty("key", "value_str");
      textField.finalizeConstruction();

      if (type.equals("int"))
        textField.addValidator(new IntegerValidator());
      else if (type.equals("long"))
        textField.addValidator(new LongValidator());
      else if (type.equals("float"))
        textField.addValidator(new FloatValidator());
      else if (type.equals("double"))
        textField.addValidator(new DoubleValidator());
      else
        throw new GUIException("Unknown numeric type");

      panel.addChild(textField, null);
      panel.recursiveSetDataModel(dataModel);
View Full Code Here

Examples of org.beryl.gui.widgets.TextField

    public Widget getEditor(Table table, Object value, TableRow row, String key) throws GUIException {
      MapDataModel dataModel = new MapDataModel();
      dataModel.setValue("value", value);

      Panel panel = new Panel(null, null);
      TextField textField = new TextField(panel, null);
      textField.setProperty("key", "value");
      textField.finalizeConstruction();

      panel.addChild(textField, null);
      panel.recursiveSetDataModel(dataModel);

      return panel;
View Full Code Here

Examples of org.beryl.gui.widgets.TextField

      dataModel.setValue("value", value);
      dataModel.setValue("value_str", value.toString());

      Panel panel = new Panel(null, null);
      TextField textField = new TextField(panel, null);
      textField.setProperty("key", "value_str");
      textField.finalizeConstruction();

      panel.addChild(textField, null);
      panel.recursiveSetDataModel(dataModel);

      return panel;
View Full Code Here

Examples of org.encog.workbench.dialogs.common.TextField

 
  public LoginCloudDialog(Frame owner) {
    super(owner);
    setTitle("Login to Encog Cloud");
    setSize(400,200);
    addProperty(this.network = new TextField("network","Network",true));
    addProperty(this.userID = new TextField("user id","User ID",true));
    addProperty(this.password = new PasswordField("password","Password",true));
    render();
  }
View Full Code Here

Examples of org.graylog2.plugin.configuration.fields.TextField

    }

    @Override
    public ConfigurationRequest getRequestedConfiguration() {
        final ConfigurationRequest configurationRequest = new ConfigurationRequest();
        configurationRequest.addField(new TextField(CK_HOSTNAME, "Destination host", "", "This is the hostname of the destination", ConfigurationField.Optional.NOT_OPTIONAL));
        configurationRequest.addField(new NumberField(CK_PORT, "Destination port", 12201, "This is the port of the destination", ConfigurationField.Optional.NOT_OPTIONAL));
        final Map<String, String> protocols = ImmutableMap.of(
                "TCP", "TCP",
                "UDP", "UDP");
        configurationRequest.addField(new DropdownField(CK_PROTOCOL, "Protocol", "TCP", protocols, "The protocol used to connect", ConfigurationField.Optional.OPTIONAL));
View Full Code Here

Examples of org.graylog2.restclient.lib.plugin.configuration.TextField

        for (Map.Entry<String, Map<String, Object>> c : requestedConfiguration.entrySet()) {
            try {
                String fieldType = (String) c.getValue().get("type");
                switch (fieldType) {
                    case "text":
                        fields.add(new TextField(c));
                        continue;
                    case "number":
                        fields.add(new NumberField(c));
                        continue;
                    case "boolean":
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.