use of com.vaadin.ui.TextField in project linkki by linkki-framework.
the class AddressFields2 method createTextField.
// end::addressFields-methodBinding[]
private static TextField createTextField(String caption) {
TextField tf = new TextField(caption);
tf.setNullRepresentation("");
return tf;
}
use of com.vaadin.ui.TextField in project linkki by linkki-framework.
the class ComponentFactory method newReadOnlyTextField.
public static TextField newReadOnlyTextField(String value, int columns) {
TextField field = newReadOnlyTextField(value);
field.setColumns(columns);
return field;
}
use of com.vaadin.ui.TextField in project linkki by linkki-framework.
the class ComponentFactory method newReadOnlyTextField.
public static TextField newReadOnlyTextField(String value) {
TextField field = newTextfield();
field.setValue(value);
field.setReadOnly(true);
return field;
}
use of com.vaadin.ui.TextField in project linkki by linkki-framework.
the class BindingContextTest method testBind_BoundComponentsAreMadeImmediate.
@Test
public void testBind_BoundComponentsAreMadeImmediate() {
setUpPmo();
TextField field = new TextField();
BindingDefinition fieldDefintion = mock(BindingDefinition.class);
when(fieldDefintion.required()).thenReturn(RequiredType.REQUIRED);
when(fieldDefintion.enabled()).thenReturn(EnabledType.ENABLED);
when(fieldDefintion.visible()).thenReturn(VisibleType.VISIBLE);
ElementDescriptor fieldDescriptor = new ElementDescriptor(fieldDefintion, "value", Void.class, new ArrayList<>());
// Precondition
assertThat(field.isImmediate(), is(false));
context.bind(pmo, fieldDescriptor, new LabelComponentWrapper(field));
assertThat(field.isImmediate(), is(true));
}
use of com.vaadin.ui.TextField in project Activiti by Activiti.
the class ProfilePanel method initContactSection.
protected void initContactSection() {
Label header = createProfileHeader(infoPanelLayout, i18nManager.getMessage(Messages.PROFILE_CONTACT));
header.addStyleName(ExplorerLayout.STYLE_H3);
header.addStyleName(ExplorerLayout.STYLE_DETAIL_BLOCK);
infoPanelLayout.addComponent(header);
GridLayout contactLayout = createInfoSectionLayout(2, 4);
// Email
if (!editable && isDefined(user.getEmail())) {
addProfileEntry(contactLayout, i18nManager.getMessage(Messages.PROFILE_EMAIL), user.getEmail());
} else if (editable) {
emailField = new TextField();
addProfileInputField(contactLayout, i18nManager.getMessage(Messages.PROFILE_EMAIL), emailField, user.getEmail());
}
// Phone
if (!editable && isDefined(phone)) {
addProfileEntry(contactLayout, i18nManager.getMessage(Messages.PROFILE_PHONE), phone);
} else if (editable) {
phoneField = new TextField();
addProfileInputField(contactLayout, i18nManager.getMessage(Messages.PROFILE_PHONE), phoneField, phone);
}
// Twitter
if (!editable && isDefined(twitterName)) {
Link twitterLink = new Link(twitterName, new ExternalResource("http://www.twitter.com/" + twitterName));
addProfileEntry(contactLayout, i18nManager.getMessage(Messages.PROFILE_TWITTER), twitterLink);
} else if (editable) {
twitterField = new TextField();
addProfileInputField(contactLayout, i18nManager.getMessage(Messages.PROFILE_TWITTER), twitterField, twitterName);
}
// Skype
if (!editable && isDefined(skypeId)) {
// The skype entry shows the name + skype icon, laid out in a small grid
GridLayout skypeLayout = new GridLayout(2, 1);
skypeLayout.setSpacing(true);
skypeLayout.setSizeUndefined();
Label skypeIdLabel = new Label(skypeId);
skypeIdLabel.setSizeUndefined();
skypeLayout.addComponent(skypeIdLabel);
addProfileEntry(contactLayout, i18nManager.getMessage(Messages.PROFILE_SKYPE), skypeLayout);
} else if (editable) {
skypeField = new TextField();
addProfileInputField(contactLayout, i18nManager.getMessage(Messages.PROFILE_SKYPE), skypeField, skypeId);
}
}
Aggregations