Example usage for com.vaadin.ui.themes ValoTheme TEXTFIELD_SMALL

List of usage examples for com.vaadin.ui.themes ValoTheme TEXTFIELD_SMALL

Introduction

In this page you can find the example usage for com.vaadin.ui.themes ValoTheme TEXTFIELD_SMALL.

Prototype

String TEXTFIELD_SMALL

To view the source code for com.vaadin.ui.themes ValoTheme TEXTFIELD_SMALL.

Click Source Link

Document

Small size text field.

Usage

From source file:fr.ortec.dsi.pointage.presentation.ihm.view.TextFields.java

License:Apache License

public TextFields() {
    setMargin(true);/*from w w  w .  j a  va  2  s .co  m*/
    setSpacing(true);

    Label h1 = new Label("Text Fields");
    h1.addStyleName(ValoTheme.LABEL_H1);
    addComponent(h1);

    HorizontalLayout row = new HorizontalLayout();
    row.addStyleName(ValoTheme.LAYOUT_HORIZONTAL_WRAPPING);
    addComponent(row);

    TextField tf = new TextField("Normal");
    tf.setIcon(testIcon.get());
    row.addComponent(tf);

    tf = new TextField("Custom color");
    tf.addStyleName("color1");
    row.addComponent(tf);

    tf = new TextField("User Color");
    tf.addStyleName("color2");
    row.addComponent(tf);

    tf = new TextField("Themed");
    tf.addStyleName("color3");
    row.addComponent(tf);

    tf = new TextField("Error");
    tf.setValue("Somethings wrong");
    tf.setComponentError(new UserError("Fix it, now!"));
    row.addComponent(tf);

    tf = new TextField("Error, borderless");
    tf.setValue("Somethings wrong");
    tf.setComponentError(new UserError("Fix it, now!"));
    tf.addStyleName(ValoTheme.TEXTFIELD_BORDERLESS);
    row.addComponent(tf);

    tf = new TextField("Small");
    tf.setValue("Field value");
    tf.addStyleName(ValoTheme.TEXTFIELD_SMALL);
    row.addComponent(tf);

    tf = new TextField("Large");
    tf.setValue("Field value");
    tf.addStyleName(ValoTheme.TEXTFIELD_LARGE);
    tf.setIcon(testIcon.get(true));
    row.addComponent(tf);

    tf = new TextField();
    tf.setValue("Font, no caption");
    tf.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON);
    tf.setIcon(testIcon.get());
    row.addComponent(tf);

    tf = new TextField();
    tf.setValue("Image, no caption");
    tf.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON);
    tf.setIcon(testIcon.get(true, 16));
    row.addComponent(tf);

    CssLayout group = new CssLayout();
    group.addStyleName(ValoTheme.LAYOUT_COMPONENT_GROUP);
    row.addComponent(group);

    Button button = new Button("Do It");
    // button.addStyleName(ValoTheme.BUTTON_PRIMARY);
    group.addComponent(button);

    tf = new TextField("Right-aligned");
    tf.setValue("1,234");
    tf.addStyleName(ValoTheme.TEXTFIELD_ALIGN_RIGHT);
    row.addComponent(tf);

    tf = new TextField("Tiny");
    tf.setValue("Field value");
    tf.addStyleName(ValoTheme.TEXTFIELD_TINY);
    row.addComponent(tf);

    tf = new TextField("Huge");
    tf.setValue("Field value");
    tf.addStyleName(ValoTheme.TEXTFIELD_HUGE);
    row.addComponent(tf);

    h1 = new Label("Text Areas");
    h1.addStyleName(ValoTheme.LABEL_H1);
    addComponent(h1);

    row = new HorizontalLayout();
    row.addStyleName(ValoTheme.LAYOUT_HORIZONTAL_WRAPPING);
    addComponent(row);

    RichTextArea rta = new RichTextArea();
    rta.setValue("<b>Some</b> <i>rich</i> content");
    row.addComponent(rta);

    rta = new RichTextArea("Read-only");
    rta.setValue("<b>Some</b> <i>rich</i> content");
    rta.setReadOnly(true);
    row.addComponent(rta);
}

From source file:no.uib.probe.csf.pr.touch.view.core.SearchingField.java

/**
 * Default constructor to initialize the main attributes.
 *//*from  w w  w.  j  a v  a  2  s .c o m*/
public SearchingField() {
    this.setSpacing(true);
    this.setHeightUndefined();

    HorizontalLayout searchFieldContainerLayout = new HorizontalLayout();
    searchFieldContainerLayout.setWidthUndefined();
    searchFieldContainerLayout.setHeight(100, Unit.PERCENTAGE);
    searchFieldContainerLayout.setSpacing(true);
    TextField searchField = new TextField();
    searchField.setDescription("Search proteins by name or accession");
    searchField.setImmediate(true);
    searchField.setWidth(100, Unit.PIXELS);
    searchField.setHeight(18, Unit.PIXELS);
    searchField.setInputPrompt("Search...");
    searchFieldContainerLayout.addComponent(searchField);
    searchField.setTextChangeTimeout(1500);
    searchField.setStyleName(ValoTheme.TEXTFIELD_SMALL);
    searchField.addStyleName(ValoTheme.TEXTFIELD_TINY);
    final Button b = new Button();
    searchField.setTextChangeEventMode(AbstractTextField.TextChangeEventMode.LAZY);

    searchField.addShortcutListener(new Button.ClickShortcut(b, ShortcutListener.KeyCode.ENTER));

    VerticalLayout searchingBtn = new VerticalLayout();
    searchingBtn.setWidth(22, Unit.PIXELS);
    searchingBtn.setHeight(18, Unit.PIXELS);
    searchingBtn.setStyleName("tablesearchingbtn");
    searchFieldContainerLayout.addComponent(searchingBtn);
    searchFieldContainerLayout.setComponentAlignment(searchingBtn, Alignment.TOP_CENTER);
    this.addComponent(searchFieldContainerLayout);
    this.setComponentAlignment(searchFieldContainerLayout, Alignment.TOP_CENTER);
    searchingCommentLabel = new Label();
    searchingCommentLabel.setWidth(100, Unit.PERCENTAGE);
    searchingCommentLabel.setHeight(23, Unit.PIXELS);
    searchingCommentLabel.addStyleName(ValoTheme.LABEL_BOLD);
    searchingCommentLabel.addStyleName(ValoTheme.LABEL_SMALL);
    searchingCommentLabel.addStyleName(ValoTheme.LABEL_TINY);
    this.addComponent(searchingCommentLabel);
    this.setComponentAlignment(searchingCommentLabel, Alignment.TOP_CENTER);

    searchingBtn.addLayoutClickListener((LayoutEvents.LayoutClickEvent event) -> {
        b.click();
    });
    searchField.addTextChangeListener((FieldEvents.TextChangeEvent event) -> {
        SearchingField.this.textChanged(event.getText());
    });
    b.addClickListener((Button.ClickEvent event) -> {
        SearchingField.this.textChanged(searchField.getValue());
    });

}

From source file:org.eclipse.hawkbit.ui.common.builder.TextFieldBuilder.java

License:Open Source License

@Override
protected TextField createTextComponent() {
    final TextField textField = new TextField();
    textField.addStyleName(ValoTheme.TEXTFIELD_SMALL);
    return textField;
}

From source file:org.eclipse.hawkbit.ui.login.AbstractHawkbitLoginUI.java

License:Open Source License

private void buildPasswordField() {
    password = new PasswordField(i18n.getMessage("label.login.password"));
    password.setIcon(FontAwesome.LOCK);//ww  w .j  a v  a2  s  .  c o m
    password.addStyleName(
            ValoTheme.TEXTFIELD_INLINE_ICON + " " + ValoTheme.TEXTFIELD_SMALL + " " + LOGIN_TEXTFIELD);
    password.setId("login-password");
    if (isDemo && !uiProperties.getDemo().getPassword().isEmpty()) {
        password.setValue(uiProperties.getDemo().getPassword());
    }
}

From source file:org.eclipse.hawkbit.ui.login.AbstractHawkbitLoginUI.java

License:Open Source License

private void buildUserField() {
    username = new TextField(i18n.getMessage("label.login.username"));
    username.setIcon(FontAwesome.USER);/*ww  w . j a v  a 2 s .  c  o m*/
    username.addStyleName(
            ValoTheme.TEXTFIELD_INLINE_ICON + " " + ValoTheme.TEXTFIELD_SMALL + " " + LOGIN_TEXTFIELD);
    username.setId("login-username");
    if (isDemo && !uiProperties.getDemo().getUser().isEmpty()) {
        username.setValue(uiProperties.getDemo().getUser());
    }
}

From source file:org.eclipse.hawkbit.ui.login.AbstractHawkbitLoginUI.java

License:Open Source License

private void buildTenantField() {
    if (multiTenancyIndicator.isMultiTenancySupported()) {
        tenant = new TextField(i18n.getMessage("label.login.tenant"));
        tenant.setIcon(FontAwesome.DATABASE);
        tenant.addStyleName(/*  w w w . j a  v  a 2  s  .  co  m*/
                ValoTheme.TEXTFIELD_INLINE_ICON + " " + ValoTheme.TEXTFIELD_SMALL + " " + LOGIN_TEXTFIELD);
        tenant.addStyleName("uppercase");
        tenant.setId("login-tenant");
    }
}

From source file:org.eclipse.hawkbit.ui.login.LoginView.java

License:Open Source License

private void buildPasswordField() {
    password = new PasswordField(i18n.getMessage("label.login.password"));
    password.setIcon(FontAwesome.LOCK);// w  ww .ja va 2 s  .c om
    password.addStyleName(
            ValoTheme.TEXTFIELD_INLINE_ICON + " " + ValoTheme.TEXTFIELD_SMALL + " " + LOGIN_TEXTFIELD);
    password.setId("login-password");
}

From source file:org.eclipse.hawkbit.ui.login.LoginView.java

License:Open Source License

private void buildUserField() {
    username = new TextField(i18n.getMessage("label.login.username"));
    username.setIcon(FontAwesome.USER);// w  w  w .j  a v a 2  s .  c  o  m
    username.addStyleName(
            ValoTheme.TEXTFIELD_INLINE_ICON + " " + ValoTheme.TEXTFIELD_SMALL + " " + LOGIN_TEXTFIELD);
    username.setId("login-username");
}

From source file:org.jumpmind.metl.ui.views.DeployNavigator.java

License:Open Source License

protected Field<?> buildEditableNavigatorField(Object itemId) {
    if (itemBeingEdited != null && itemBeingEdited.equals(itemId)) {
        final EnableFocusTextField field = new EnableFocusTextField();
        field.addStyleName(ValoTheme.TEXTFIELD_SMALL);
        field.setImmediate(true);//from  w w  w  . ja  va 2  s .  c o  m
        field.addFocusListener(new FocusListener() {

            @Override
            public void focus(FocusEvent event) {
                field.setFocusAllowed(false);
                field.selectAll();
                field.setFocusAllowed(true);
            }
        });
        field.focus();
        field.addShortcutListener(new ShortcutListener("", KeyCode.ESCAPE, null) {

            @Override
            public void handleAction(Object sender, Object target) {
                abortEditingItem();
            }
        });
        field.addShortcutListener(new ShortcutListener("Enter", KeyCode.ENTER, null) {

            private static final long serialVersionUID = 1L;

            @Override
            public void handleAction(Object sender, Object target) {
                finishEditingItem();
            }
        });
        field.addBlurListener(new BlurListener() {
            @Override
            public void blur(BlurEvent event) {
                finishEditingItem();
            }
        });
        return field;
    } else {
        return null;
    }
}

From source file:org.jumpmind.metl.ui.views.DesignNavigator.java

License:Open Source License

protected Field<?> buildEditableNavigatorField(Object itemId) {
    if (itemBeingEdited != null && itemBeingEdited.equals(itemId)) {
        final EnableFocusTextField field = new EnableFocusTextField();
        field.addStyleName(ValoTheme.TEXTFIELD_SMALL);
        field.setImmediate(true);/*from w  w  w.  j  a  v a2s  . c  om*/
        field.setWidth(95, Unit.PERCENTAGE);
        field.addFocusListener(new FocusListener() {

            @Override
            public void focus(FocusEvent event) {
                field.setFocusAllowed(false);
                field.selectAll();
                field.setFocusAllowed(true);
            }
        });
        field.focus();
        field.addShortcutListener(new ShortcutListener("Escape", KeyCode.ESCAPE, null) {

            @Override
            public void handleAction(Object sender, Object target) {
                abortEditingItem();
            }
        });
        field.addValueChangeListener(event -> finishEditingItem());
        field.addBlurListener(event -> finishEditingItem());
        return field;
    } else {
        return null;
    }
}