Example usage for com.vaadin.ui ColorPicker setTextfieldVisibility

List of usage examples for com.vaadin.ui ColorPicker setTextfieldVisibility

Introduction

In this page you can find the example usage for com.vaadin.ui ColorPicker setTextfieldVisibility.

Prototype

public void setTextfieldVisibility(boolean visible) 

Source Link

Document

Sets the visibility of the CSS color code text field.

Usage

From source file:com.cavisson.gui.dashboard.components.controls.ColorPickers.java

License:Apache License

public ColorPickers() {
    setMargin(true);//from  w w w  .  ja va 2 s  .c  om

    Label h1 = new Label("Color Pickers");
    h1.addStyleName("h1");
    addComponent(h1);

    HorizontalLayout row = new HorizontalLayout();
    row.addStyleName("wrapping");
    row.setSpacing(true);
    addComponent(row);

    TestIcon testIcon = new TestIcon(40);

    ColorPicker cp = new ColorPicker();
    cp.setDefaultCaptionEnabled(true);
    cp.setIcon(testIcon.get());
    cp.setColor(new Color(138, 73, 115));
    row.addComponent(cp);

    cp = new ColorPicker();
    cp.setPopupStyle(PopupStyle.POPUP_SIMPLE);
    cp.setTextfieldVisibility(true);
    row.addComponent(cp);
}