Package com.vaadin.ui

Examples of com.vaadin.ui.NativeButton


        l.addComponent(cb);

        Button btn = new Button("Button");
        l.addComponent(btn);

        NativeButton nbtn = new NativeButton("NativeButton");
        l.addComponent(nbtn);

        CheckBox chkb = new CheckBox("CheckBox");
        l.addComponent(chkb);

        OptionGroup og = createOptionGroup("OptionGroup");
        og.setMultiSelect(false);
        l.addComponent(og);

        final OptionGroup ogm = createOptionGroup("OptionGroup (multiselect)");
        ogm.setMultiSelect(true);
        l.addComponent(ogm);

        btn.addListener(new ClickListener() {

            private int i;

            @Override
            public void buttonClick(ClickEvent event) {
                ogm.addItem("newItem" + i++);

            }
        });

        tf.addListener(focusListener);
        tf.addListener(blurListener);
        df.addListener(focusListener);
        df.addListener(blurListener);
        cb.addListener(focusListener);
        cb.addListener(blurListener);
        btn.addListener(focusListener);
        btn.addListener(blurListener);
        nbtn.addListener(focusListener);
        nbtn.addListener(blurListener);
        chkb.addListener(focusListener);
        chkb.addListener(blurListener);
        og.addListener(focusListener);
        og.addListener(blurListener);
        ogm.addListener(focusListener);
View Full Code Here


public class AccordionPrimaryStylenames extends TestBase {

    @Override
    protected void setup() {
        final Accordion acc = new Accordion();
        acc.addComponent(new NativeButton("First tab"));
        acc.addComponent(new NativeButton("Second tab"));
        acc.setPrimaryStyleName("my-accordion");
        addComponent(acc);

        addComponent(new Button("Set primary stylename",
                new Button.ClickListener() {
View Full Code Here

    @Override
    protected void setup(VaadinRequest request) {
        final Label label1 = new Label("0,0");
        final Label label2 = new Label("0,0");

        Button button1 = new NativeButton("Button1",
                new NativeButton.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        label1.setValue(event.getClientX() + ","
                                + event.getClientY());
                    }
                });
        Button button2 = new NativeButton("Button2",
                new NativeButton.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        label2.setValue(event.getClientX() + ","
                                + event.getClientY());
View Full Code Here

    protected void setup(VaadinRequest request) {
        final TextField delayField = new TextField("Delay (ms)");
        delayField.setConverter(Integer.class);
        delayField.setConvertedValue(1000);

        NativeButton delayButton = new NativeButton("Wait");
        delayButton.addClickListener(new ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                try {
                    Thread.sleep((Integer) delayField.getConvertedValue());
View Full Code Here

    public class ButtonColumnGenerator implements ColumnGenerator {
        @Override
        public Component generateCell(final com.vaadin.ui.Table source,
                final Object itemId, Object columnId) {
            String identifier = "Expand/Collapse";
            Button btnCol = new NativeButton(identifier);
            btnCol.setId("cacheTestButtonToggle-" + itemId);
            btnCol.addClickListener(new Button.ClickListener() {
                @Override
                public void buttonClick(ClickEvent event) {
                    t.setCollapsed(itemId, !t.isCollapsed(itemId));
                }
            });
View Full Code Here

    protected void setup(VaadinRequest request) {
        addComponent(new TextField(null, "TextField"));
        addComponent(new CheckBox("CheckBox"));
        addComponent(new OptionGroup(null,
                Arrays.asList("Option 1", "Option 2")));
        addComponent(new NativeButton("NativeButton"));
    }
View Full Code Here

         * will automatically revert to zero after the following line).
         */
        top.setExpandRatio(status, 1.0F);

        // Playback controls
        Button prev = new NativeButton("Previous");
        Button play = new NativeButton("Play/pause");
        Button next = new NativeButton("Next");
        playback.addComponent(prev);
        playback.addComponent(play);
        playback.addComponent(next);
        // Set spacing between the buttons
        playback.setSpacing(true);

        // Volume controls
        Button mute = new NativeButton("mute");
        Slider vol = new Slider();
        vol.setOrientation(SliderOrientation.HORIZONTAL);
        vol.setWidth("100px");
        Button max = new NativeButton("max");
        volume.addComponent(mute);
        volume.addComponent(vol);
        volume.addComponent(max);

        // Status area
        status.setWidth("80%");
        status.setSpacing(true);

        Button toggleVisualization = new NativeButton("Mode");
        Label timeFromStart = new Label("0:00");

        // We'll need another layout to show currently playing track and
        // progress
        VerticalLayout trackDetails = new VerticalLayout();
        trackDetails.setWidth("100%");
        Label track = new Label("Track Name");
        Label album = new Label("Album Name - Artist");
        track.setWidth(null);
        album.setWidth(null);
        Slider progress = new Slider();
        progress.setOrientation(SliderOrientation.HORIZONTAL);
        progress.setWidth("100%");
        trackDetails.addComponent(track);
        trackDetails.addComponent(album);
        trackDetails.addComponent(progress);
        trackDetails.setComponentAlignment(track, Alignment.TOP_CENTER);
        trackDetails.setComponentAlignment(album, Alignment.TOP_CENTER);

        Label timeToEnd = new Label("-4:46");
        Button jumpToTrack = new NativeButton("Show");

        // Place all components to the status layout and align them properly
        status.addComponent(toggleVisualization);
        status.setComponentAlignment(toggleVisualization, Alignment.MIDDLE_LEFT);
        status.addComponent(timeFromStart);
        status.setComponentAlignment(timeFromStart, Alignment.BOTTOM_LEFT);
        status.addComponent(trackDetails);
        status.addComponent(timeToEnd);
        status.setComponentAlignment(timeToEnd, Alignment.BOTTOM_LEFT);
        status.addComponent(jumpToTrack);
        status.setComponentAlignment(jumpToTrack, Alignment.MIDDLE_LEFT);

        // Then remember to specify the expand ratio
        status.setExpandRatio(trackDetails, 1.0F);

        // View mode buttons
        Button viewAsTable = new NativeButton("Table");
        Button viewAsGrid = new NativeButton("Grid");
        Button coverflow = new NativeButton("Coverflow");
        viewmodes.addComponent(viewAsTable);
        viewmodes.addComponent(viewAsGrid);
        viewmodes.addComponent(coverflow);

        /*
         * That covers the top bar. Now let's move on to the sidebar and track
         * listing
         */

        // We'll need one splitpanel to separate the sidebar and track listing
        HorizontalSplitPanel bottom = new HorizontalSplitPanel();
        rootLayout.addComponent(bottom);

        // The splitpanel is by default 100% x 100%, but we'll need to adjust
        // our main window layout to accomodate the height
        rootLayout.setExpandRatio(bottom, 1.0F);

        // Give the sidebar less space than the listing
        bottom.setSplitPosition(200, Sizeable.UNITS_PIXELS);

        // Let's add some content to the sidebar
        // First, we need a layout to but all components in
        VerticalLayout sidebar = new VerticalLayout();
        sidebar.setSizeFull();
        bottom.setFirstComponent(sidebar);

        /*
         * Then we need some labels and buttons, and an album cover image The
         * labels and buttons go into their own vertical layout, since we want
         * the 'sidebar' layout to be expanding (cover image in the bottom).
         * VerticalLayout is by default 100% wide.
         */
        VerticalLayout selections = new VerticalLayout();
        Label library = new Label("Library");
        Button music = new NativeButton("Music");
        music.setWidth("100%");

        Label store = new Label("Store");
        Button vaadinTunesStore = new NativeButton("VaadinTunes Store");
        vaadinTunesStore.setWidth("100%");
        Button purchased = new NativeButton("Purchased");
        purchased.setWidth("100%");

        Label playlists = new Label("Playlists");
        Button genius = new NativeButton("Geniues");
        genius.setWidth("100%");
        Button recent = new NativeButton("Recently Added");
        recent.setWidth("100%");

        // Lets add them to the 'selections' layout
        selections.addComponent(library);
        selections.addComponent(music);
        selections.addComponent(store);
View Full Code Here

        return cb;
    }

    private Button createButton(String string) {
        NativeButton button = new NativeButton(string);
        css.put(button, string);
        button.addListener(this);
        return button;
    }
View Full Code Here

        VerticalLayout layout = new VerticalLayout();
        layout.setSizeFull();
        LegacyWindow w = new LegacyWindow("", layout);
        setMainWindow(w);
        HorizontalSplitPanel splitPanel = new HorizontalSplitPanel();
        Button button = new NativeButton("A huge button");
        button.setSizeFull();
        TextField textField = new TextField("A small textfield");

        splitPanel.setFirstComponent(button);
        splitPanel.setSecondComponent(textField);
        splitPanel.setSizeFull();
View Full Code Here

        pv.setCaption("A popup view");
        return pv;
    }

    protected TabSheet createSmallTabSheet() {
        return new TabSheet(new Button("Tab1 inside popup"), new NativeButton(
                "Tab 2 inside popup"));
    }
View Full Code Here

TOP

Related Classes of com.vaadin.ui.NativeButton

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.