com.vaadin.v7.ui.TextField.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(8.6k)|赞(0)|评价(0)|浏览(161)

本文整理了Java中com.vaadin.v7.ui.TextField.<init>()方法的一些代码示例,展示了TextField.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TextField.<init>()方法的具体详情如下:
包路径:com.vaadin.v7.ui.TextField
类名称:TextField
方法名:<init>

TextField.<init>介绍

[英]Constructs an empty TextField with no caption.
[中]构造一个没有标题的空TextField

代码示例

代码示例来源:origin: de.mhus.lib/mhu-lib-vaadin

protected Field<?> createFieldForType(Class<?> type) {
//        if (type == Boolean.class || type == boolean.class) {
//            return new CheckBox();
//        } else {
      return new TextField();
//        }
  }

代码示例来源:origin: OpenNMS/opennms

@Override
  public Field<?> createField(Container container, Object itemId, Object propertyId, Component uiContext) {
    if (propertyId.equals("decodes")) {
      final TextField field = new TextField();
      field.setConverter(new DecodeListConverter());
      return field;
    }
    return super.createField(container, itemId, propertyId, uiContext);
  }
});

代码示例来源:origin: OpenNMS/opennms

@Override
  public Field<?> createField(Container container, Object itemId, Object propertyId, Component uiContext) {
    if (propertyId.equals("vbvalues")) {
      final TextField field = new TextField();
      field.setConverter(new CsvListConverter());
      return field;
    }
    return super.createField(container, itemId, propertyId, uiContext);
  }
});

代码示例来源:origin: OpenNMS/opennms

public AbstractField<String> getComponent(CriteriaBuilderHelper criteriaBuilderHelper) {
    TextField textField = new TextField();
    textField.setCaption("Value");
    textField.setStyleName("small");
    textField.setDescription("Value");
    return textField;
  }
},

代码示例来源:origin: OpenNMS/opennms

public AbstractField<String> getComponent(CriteriaBuilderHelper criteriaBuilderHelper) {
    TextField textField = new TextField();
    textField.setCaption("Text value");
    textField.setStyleName("small");
    textField.setDescription("Text value");
    return textField;
  }
},

代码示例来源:origin: OpenNMS/opennms

public AbstractField<String> getComponent(CriteriaBuilderHelper criteriaBuilderHelper) {
    TextField textField = new TextField();
    textField.setCaption("Integer value");
    textField.setStyleName("small");
    textField.setDescription("Integer value");
    return textField;
  }
};

代码示例来源:origin: info.magnolia.ui/magnolia-ui-framework-compatibility

@Override
  public Object answer(InvocationOnMock inv) throws Throwable {
    final Object[] args = inv.getArguments();
    final EditorCallback callback = (EditorCallback) args[3];
    final Item item = (Item) args[0];
    Property property = new TextField();
    property.setValue(versionName);
    item.addItemProperty(ShowVersionsAction.VersionName.PROPERTY_NAME_VERSION_NAME, property);
    callback.onSuccess("commit");
    return null;
  }
}).when(formDialogPresenter).start(any(Item.class), any(FormDialogDefinition.class), any(UiContext.class), any(EditorCallback.class), any(ContentConnector.class));

代码示例来源:origin: com.vaadin/vaadin-compatibility-server

private ColorPickerPreview() {
  setStyleName("v-colorpicker-preview");
  field = new TextField();
  field.setImmediate(true);
  field.setSizeFull();
  field.setStyleName("v-colorpicker-preview-textfield");
  field.setData(this);
  field.addValueChangeListener(this);
  addComponent(field);
}

代码示例来源:origin: info.magnolia.activation/magnolia-module-activation

private Field<String> createKeyLengthTextField() {
  String caption = i18n.translate("key.length");
  final TextField field = new TextField(caption);
  field.setDescription(caption);
  field.setMaxLength(4);
  field.setRequired(true);
  field.addStyleName("required");
  field.setWidth(100, Unit.PERCENTAGE);
  // force plain input
  field.setColumns(0);
  return field;
}

代码示例来源:origin: info.magnolia.ui/magnolia-ui-framework-compatibility

@Override
protected BeanItem<?> getItem() {
  BeanItem<?> item = super.getItem();
  Property property = new TextField();
  property.setValue(version);
  item.addItemProperty(VersionName.PROPERTY_NAME_VERSION_NAME, property);
  return item;
}

代码示例来源:origin: OpenNMS/opennms

final TextField field = new TextField();
field.setImmediate(true);
field.setRequired(true);
final TextField field = new TextField();
field.setImmediate(true);
field.setRequired(true);

代码示例来源:origin: tepi/FilteringTable

private AbstractField<?> createTextField(Object propertyId) {
  final TextField textField = new TextField();
  if (owner.getFilterDecorator() != null) {
    if (owner.getFilterDecorator().isTextFilterImmediate(propertyId)) {
      textField.addTextChangeListener(new TextChangeListener() {
        @Override
        public void textChange(TextChangeEvent event) {
          textField.setValue(event.getText());
        }
      });
      textField.setTextChangeTimeout(owner.getFilterDecorator().getTextChangeTimeout(propertyId));
    }
    if (owner.getFilterDecorator().getAllItemsVisibleString() != null) {
      textField.setInputPrompt(owner.getFilterDecorator().getAllItemsVisibleString());
    }
  }
  textField.setNullRepresentation("");
  texts.put(textField, propertyId);
  return textField;
}

代码示例来源:origin: info.magnolia.ui/magnolia-ui-framework-compatibility

@Test
public void validationSuccedsIfNotRequiredSubFieldIsEmpty() throws Exception {
  // GIVEN
  createField();
  // add new non mandatory text field
  TextField textField = new TextField();
  textField.setValue("");
  addSubField(textField);
  // WHEN
  boolean isValid = multiField.isValid();
  // THEN
  assertTrue(isValid);
}

代码示例来源:origin: info.magnolia.ui/magnolia-ui-framework-compatibility

@Test
public void validationSuccedsIfRequiredSubFieldIsNotEmpty() throws Exception {
  // GIVEN
  definition.setRequired(true);
  createField();
  // add new mandatory text field
  TextField textField = new TextField();
  textField.setValue("foo");
  addSubField(textField);
  // WHEN
  boolean isValid = multiField.isValid();
  // THEN
  assertTrue(isValid);
}

代码示例来源:origin: info.magnolia.ui/magnolia-ui-framework-compatibility

@Test
public void validationSuccedsIfSubFieldValidatorPasses() throws Exception {
  // GIVEN
  createField();
  // add text field with valid email text
  TextField textField = new TextField();
  textField.addValidator(EMAIL_VALIDATOR);
  textField.setValue("foo@magnolia-cms.com");
  addSubField(textField);
  // WHEN
  boolean isValid = multiField.isValid();
  // THEN
  assertTrue(isValid);
}

代码示例来源:origin: OpenNMS/opennms

@Override
  public Field<?> createField(Container container, Object itemId, Object propertyId, Component uiContext) {
    if (propertyId.equals("mename")) {
      final ComboBox field = new ComboBox();
      field.setSizeFull();
      field.setRequired(true);
      field.setImmediate(true);
      field.setNullSelectionAllowed(false);
      field.setNewItemsAllowed(false);
      field.addItem(Maskelement.TAG_UEI);
      field.addItem(Maskelement.TAG_SOURCE);
      field.addItem(Maskelement.TAG_NODEID);
      field.addItem(Maskelement.TAG_HOST);
      field.addItem(Maskelement.TAG_INTERFACE);
      field.addItem(Maskelement.TAG_SNMPHOST);
      field.addItem(Maskelement.TAG_SERVICE);
      field.addItem(Maskelement.TAG_SNMP_EID);
      field.addItem(Maskelement.TAG_SNMP_SPECIFIC);
      field.addItem(Maskelement.TAG_SNMP_GENERIC);
      field.addItem(Maskelement.TAG_SNMP_COMMUNITY);
      return field;
    }
    if (propertyId.equals("mevalues")) {
      final TextField field = new TextField();
      field.setConverter(new CsvListConverter());
      return field;
    }
    return super.createField(container, itemId, propertyId, uiContext);
  }
});

代码示例来源:origin: info.magnolia.ui/magnolia-ui-framework-compatibility

@Test
public void validationFailsIfRequiredSubFieldIsEmpty() throws Exception {
  // GIVEN
  definition.setRequired(true);
  createField();
  // add new mandatory text field
  TextField textField = new TextField();
  textField.setValue("");
  addSubField(textField);
  // WHEN
  boolean isValid = multiField.isValid();
  // THEN
  assertFalse(isValid);
}

代码示例来源:origin: info.magnolia.ui/magnolia-ui-framework-compatibility

@Test
public void validationFailsIfSubFieldValidatorFails() throws Exception {
  // GIVEN
  createField();
  // add required text field with invalid email text
  TextField textField = new TextField();
  textField.setRequired(true);
  textField.addValidator(EMAIL_VALIDATOR);
  textField.setValue("foo");
  addSubField(textField);
  // WHEN
  boolean isValid = multiField.isValid();
  // THEN
  assertFalse(isValid);
}

代码示例来源:origin: info.magnolia.ui/magnolia-ui-framework-compatibility

@Test
public void preventSwitchingLocaleWhenFormIsInValid() throws Exception {
  // GIVEN
  formViewer.setCurrentLocale(Locale.ENGLISH);
  formViewer.setAvailableLocales(new ArrayList<Locale>() {{
    add(Locale.ENGLISH);
    add(Locale.GERMAN);
  }});
  // Add an invalid form.
  TextField requiredTextField = new TextField();
  requiredTextField.setRequired(true);
  FormSection formSection = mock(FormSection.class);
  when(formSection.iterator()).thenReturn(new ArrayList<Component>() {{
    add(requiredTextField);
  }}.iterator());
  formViewer.addFormSection("", formSection);
  // WHEN
  // Try to switch the language.
  formViewer.setCurrentLocale(Locale.GERMAN);
  // THEN
  // Should stay the same.
  assertEquals(Locale.ENGLISH, getLanguageSelector(formViewer).getValue());
}

代码示例来源:origin: OpenNMS/opennms

addStyleName("dialog");
ueiBase = new TextField("UEI Base");
ueiBase.setNullSettingAllowed(false);
ueiBase.setWidth("100%");

相关文章