Package com.vaadin.ui

Examples of com.vaadin.ui.ColorPicker


    /**
     * Creates a background color select dialog
     */
    private Component createBackgroundColorSelect() {
        ColorPicker bgColor = new ColorPicker("Background", Color.WHITE);
        bgColor.setWidth("110px");
        bgColor.setCaption("Background");
        bgColor.addColorChangeListener(new ColorChangeListener() {

            @Override
            public void colorChanged(ColorChangeEvent event) {

                // Get the new background color
View Full Code Here


     * Create a text color selction dialog
     */
    private Component createTextColorSelect() {

        // Colorpicker for changing text color
        ColorPicker textColor = new ColorPicker("Color", Color.BLACK);
        textColor.setWidth("110px");
        textColor.setCaption("Color");
        textColor.addColorChangeListener(new ColorChangeListener() {

            @Override
            public void colorChanged(ColorChangeEvent event) {

                // Get the new text color
View Full Code Here

                optLayout);
        layoutLeft.addComponent(optPanel);

        HorizontalLayout layout1 = createHorizontalLayout();

        colorpicker1 = new ColorPicker("Foreground", foregroundColor);
        colorpicker1.setHtmlContentAllowed(true);
        colorpicker1.addColorChangeListener(this);
        colorpicker1.setId("colorpicker1");
        layout1.addComponent(colorpicker1);
        layout1.setComponentAlignment(colorpicker1, Alignment.MIDDLE_CENTER);

        colorpicker2 = new ColorPicker("Background", backgroundColor);
        colorpicker2.addColorChangeListener(this);
        colorpicker2.setId("colorpicker2");
        layout1.addComponent(colorpicker2);
        layout1.setComponentAlignment(colorpicker2, Alignment.MIDDLE_CENTER);

        Panel panel1 = new Panel(
                "Button-like colorpicker with current color and CSS code",
                layout1);
        layoutLeft.addComponent(panel1);

        HorizontalLayout layout2 = createHorizontalLayout();

        colorpicker3 = new ColorPicker("Foreground", foregroundColor);
        colorpicker3.addColorChangeListener(this);
        colorpicker3.setWidth("120px");
        colorpicker3.setCaption("Foreground");
        colorpicker3.setId("colorpicker3");
        layout2.addComponent(colorpicker3);
        layout2.setComponentAlignment(colorpicker3, Alignment.MIDDLE_CENTER);

        colorpicker4 = new ColorPicker("Background", backgroundColor);
        colorpicker4.addColorChangeListener(this);
        colorpicker4.setWidth("120px");
        colorpicker4.setCaption("Background");
        colorpicker4.setId("colorpicker4");
        layout2.addComponent(colorpicker4);
View Full Code Here

    }

    private int shadeButtonCounter = 1;

    private void addShadeButton(Color color, HorizontalLayout layout) {
        AbstractColorPicker colorPicker = new ColorPicker(color.toString(),
                color);
        colorPicker.setDefaultCaptionEnabled(false);
        colorPicker.setWidth("41px");
        colorPicker.setId("shadebutton_" + shadeButtonCounter);
        layout.addComponent(colorPicker);
        layout.setComponentAlignment(colorPicker, Alignment.MIDDLE_CENTER);

        ++shadeButtonCounter;
    }
View Full Code Here

        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);
    }
View Full Code Here

TOP

Related Classes of com.vaadin.ui.ColorPicker

Copyright © 2018 www.massapicom. 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.