Example usage for com.vaadin.server FontAwesome ANGLE_RIGHT

List of usage examples for com.vaadin.server FontAwesome ANGLE_RIGHT

Introduction

In this page you can find the example usage for com.vaadin.server FontAwesome ANGLE_RIGHT.

Prototype

FontAwesome ANGLE_RIGHT

To view the source code for com.vaadin.server FontAwesome ANGLE_RIGHT.

Click Source Link

Usage

From source file:com.hybridbpm.ui.component.document.DocumentBreadcrumbButton.java

License:Apache License

public DocumentBreadcrumbButton(Document document, ClickListener clickListener) {
    this.document = document;
    setStyleName(ValoTheme.BUTTON_LINK);
    addStyleName("breadcrumbs");
    addStyleName(ValoTheme.BUTTON_SMALL);
    if (document != null) {
        setIcon(FontAwesome.ANGLE_RIGHT);
        setCaption(document.getName());//from   w ww  . j  a  v  a  2 s .  c om
    } else {
        setCaption(Translate.getMessage("breadcrumbsRootButtonCaption"));
    }
    if (clickListener != null) {
        addClickListener(clickListener);
    }
}

From source file:me.uni.emuseo.view.common.paging.PagedTableLayout.java

License:Open Source License

protected void buildNavButtons() {
    prevPageButton = new Button(FontAwesome.ANGLE_LEFT);
    prevPageButton.addClickListener(new ClickListener() {

        private static final long serialVersionUID = -2235461491455250659L;

        @Override/*from w  w  w.j ava 2s .c o m*/
        public void buttonClick(ClickEvent event) {
            goToPage(getCurrentPage() - 1);
        }
    });

    nextPageButton = new Button(FontAwesome.ANGLE_RIGHT);
    nextPageButton.addClickListener(new ClickListener() {

        private static final long serialVersionUID = 277167907625013749L;

        @Override
        public void buttonClick(ClickEvent event) {
            goToPage(getCurrentPage() + 1);
        }
    });

    firstPageButton = new Button(FontAwesome.ANGLE_DOUBLE_LEFT);
    firstPageButton.addClickListener(new ClickListener() {

        private static final long serialVersionUID = 277167907625013750L;

        @Override
        public void buttonClick(ClickEvent event) {
            goToPage(0);
        }
    });
    lastPageButton = new Button(FontAwesome.ANGLE_DOUBLE_RIGHT);
    lastPageButton.addClickListener(new ClickListener() {

        private static final long serialVersionUID = 277167907625013751L;

        @Override
        public void buttonClick(ClickEvent event) {
            goToPage(getPagesCount() - 1);
        }
    });
}

From source file:uk.co.intec.keyDatesApp.components.DateSelector.java

License:Apache License

/**
 * Adds additional navigation buttons for Month view, Week view, Next and
 * Prev/*from   w  w  w.j a v a2  s . c om*/
 */
private void initNavigationButtons() {
    monthButton = new Button("Month view");
    monthButton.addStyleName(ValoTheme.BUTTON_QUIET);
    monthButton.addStyleName(ValoTheme.BUTTON_SMALL);
    monthButton.addClickListener(new ClickListener() {

        private static final long serialVersionUID = 1L;

        /*
         * (non-Javadoc)
         *
         * @see
         * com.vaadin.ui.Button.ClickListener#buttonClick(com.vaadin.ui.
         * Button.ClickEvent)
         */
        @Override
        public void buttonClick(ClickEvent event) {
            switchToMonthView();
        }
    });

    weekButton = new Button("Week view");
    weekButton.addStyleName(ValoTheme.BUTTON_QUIET);
    weekButton.addStyleName(ValoTheme.BUTTON_SMALL);
    weekButton.addClickListener(new ClickListener() {

        private static final long serialVersionUID = 1L;

        /*
         * (non-Javadoc)
         *
         * @see
         * com.vaadin.ui.Button.ClickListener#buttonClick(com.vaadin.ui.
         * Button.ClickEvent)
         */
        @Override
        public void buttonClick(ClickEvent event) {
            // simulate week click
            final WeekClickHandler handler = (WeekClickHandler) getCalLayout().getHandler(WeekClick.EVENT_ID);
            handler.weekClick(new WeekClick(getCalLayout(), calendar.get(GregorianCalendar.WEEK_OF_YEAR),
                    calendar.get(GregorianCalendar.YEAR)));
        }
    });

    prevButton = new Button("Prev");
    prevButton.addStyleName(ValoTheme.BUTTON_FRIENDLY);
    prevButton.setIcon(FontAwesome.ANGLE_LEFT);
    prevButton.addClickListener(new Button.ClickListener() {
        private static final long serialVersionUID = 1L;

        /*
         * (non-Javadoc)
         *
         * @see
         * com.vaadin.ui.Button.ClickListener#buttonClick(com.vaadin.ui.
         * Button.ClickEvent)
         */
        @Override
        public void buttonClick(ClickEvent event) {
            handlePreviousButtonClick();
        }
    });

    nextButton = new Button("Next");
    nextButton.addStyleName(ValoTheme.BUTTON_FRIENDLY);
    nextButton.addStyleName(ValoTheme.BUTTON_ICON_ALIGN_RIGHT);
    nextButton.setIcon(FontAwesome.ANGLE_RIGHT);
    nextButton.addClickListener(new Button.ClickListener() {
        private static final long serialVersionUID = 1L;

        /*
         * (non-Javadoc)
         *
         * @see
         * com.vaadin.ui.Button.ClickListener#buttonClick(com.vaadin.ui.
         * Button.ClickEvent)
         */
        @Override
        public void buttonClick(ClickEvent event) {
            handleNextButtonClick();
        }
    });
}

From source file:uk.co.intec.keyDatesApp.components.Pager.java

License:Apache License

/**
 * Load pages buttons - Prev, page numbers, Next.<br/>
 * <br/>/* w  w  w.j a v  a2 s.c om*/
 * If current page is 3 or less, the first page number displayed will be 1.
 * Otherwise, if available page is less than current page + 2, the first
 * page number will be available pages - 4. Otherwise, the first page number
 * will be current page - 2.
 */
public void loadPagerPagesButtons() {
    getPagerPagesPanel().removeAllComponents();
    if (getWrappedView().getAvailablePages() > 1) {
        final Button pageLink = new Button();
        pageLink.setCaption("Prev");
        pageLink.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED);
        pageLink.addStyleName(ValoTheme.BUTTON_TINY);
        pageLink.setIcon(FontAwesome.ANGLE_LEFT);
        pageLink.addClickListener(new ClickListener() {
            private static final long serialVersionUID = 1L;

            /*
             * (non-Javadoc)
             *
             * @see
             * com.vaadin.ui.Button.ClickListener#buttonClick(com.vaadin.ui.
             * Button.ClickEvent)
             */
            @Override
            public void buttonClick(ClickEvent event) {
                getWrappedView().setCurrentPage(getWrappedView().getCurrentPage() - 1);
                getWrappedView().setStart(getWrappedView().getStart() - getWrappedView().getCount());
                getWrappedView().redrawContents();
            }
        });
        final Label spacer = new Label("|");
        getPagerPagesButtons().put("Prev", pageLink);
        getPagerPagesPanel().addComponents(pageLink, spacer);
    }

    // Buttons for all pages
    int startPageNo = 1;
    if (getWrappedView().getCurrentPage() > 3) {
        if (getWrappedView().getAvailablePages() < (getWrappedView().getCurrentPage() + 2)) {
            startPageNo = getWrappedView().getAvailablePages() - 4;
            if (startPageNo < 1) {
                startPageNo = 1;
            }
        } else {
            startPageNo = getWrappedView().getCurrentPage() - 2;
        }
    }
    for (int i = startPageNo; i <= getWrappedView().getAvailablePages(); i++) {
        final Button pageLink = new Button();
        final int newPageNo = i;
        pageLink.setCaption(Integer.toString(i));
        pageLink.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED);
        pageLink.addStyleName(ValoTheme.BUTTON_TINY);
        pageLink.addClickListener(new ClickListener() {
            private static final long serialVersionUID = 1L;

            /*
             * (non-Javadoc)
             *
             * @see
             * com.vaadin.ui.Button.ClickListener#buttonClick(com.vaadin.ui.
             * Button.ClickEvent)
             */
            @Override
            public void buttonClick(ClickEvent event) {
                getWrappedView().setStart(1 + ((newPageNo - 1) * getWrappedView().getCount()));
                getWrappedView().setCurrentPage(newPageNo);
                getWrappedView().redrawContents();
            }
        });
        getPagerPagesButtons().put(i, pageLink);
        getPagerPagesPanel().addComponent(pageLink);
        if (getWrappedView().getAvailablePages() > 1) {
            final Label spacer = new Label("|");
            getPagerPagesPanel().addComponent(spacer);
        }
    }

    if (getWrappedView().getAvailablePages() > 1) {
        final Button pageLink = new Button();
        pageLink.setCaption("Next");
        pageLink.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED);
        pageLink.addStyleName(ValoTheme.BUTTON_TINY);
        pageLink.addStyleName(ValoTheme.BUTTON_ICON_ALIGN_RIGHT);
        pageLink.setIcon(FontAwesome.ANGLE_RIGHT);
        pageLink.addClickListener(new ClickListener() {
            private static final long serialVersionUID = 1L;

            /*
             * (non-Javadoc)
             *
             * @see
             * com.vaadin.ui.Button.ClickListener#buttonClick(com.vaadin.ui.
             * Button.ClickEvent)
             */
            @Override
            public void buttonClick(ClickEvent event) {
                getWrappedView().setCurrentPage(getWrappedView().getCurrentPage() + 1);
                getWrappedView().setStart(getWrappedView().getStart() + getWrappedView().getCount());
                getWrappedView().redrawContents();
            }
        });
        getPagerPagesButtons().put("Next", pageLink);
        getPagerPagesPanel().addComponents(pageLink);
    }

    updatePagerPagesButtonStyles();
}