Example usage for com.vaadin.ui Button setIcon

List of usage examples for com.vaadin.ui Button setIcon

Introduction

In this page you can find the example usage for com.vaadin.ui Button setIcon.

Prototype

@Override
public void setIcon(Resource icon) 

Source Link

Document

Sets the component's icon.

Usage

From source file:org.escidoc.browser.ui.view.helpers.FolderChildrenVH.java

License:Open Source License

private Button showDelete(final ResourceModel child) {
    Button edit = new Button();
    edit.setStyleName(BaseTheme.BUTTON_LINK);
    edit.setDescription(ViewConstants.PROPERTY_DELETE);
    edit.setIcon(new ThemeResource("images/wpzoom/trash.png"));
    edit.addListener(new Button.ClickListener() {
        @Override/*  w w  w  .  j  a  v a 2s  .  c  o  m*/
        public void buttonClick(ClickEvent event) {
            folderController.getRouter().getMainWindow().showNotification(
                    "Not yet Implemented " + child.getId(), Notification.TYPE_HUMANIZED_MESSAGE);

        }
    });
    return edit;
}

From source file:org.escidoc.browser.ui.view.helpers.FolderChildrenVH.java

License:Open Source License

private Button showShare(final ResourceModel child) {
    Button edit = new Button();
    edit.setStyleName(BaseTheme.BUTTON_LINK);
    edit.setDescription(ViewConstants.PROPERTY_SHARE);
    edit.setIcon(new ThemeResource("images/wpzoom/share.png"));
    edit.addListener(new Button.ClickListener() {
        @Override/*from w w w .  j  a  v  a  2s  .c  om*/
        public void buttonClick(ClickEvent event) {
            folderController.getRouter().getMainWindow().showNotification(
                    "Not yet Implemented " + child.getId(), Notification.TYPE_HUMANIZED_MESSAGE);

        }
    });
    return edit;
}

From source file:org.escidoc.browser.ui.view.helpers.FolderChildrenVH.java

License:Open Source License

private Button downloadShow(final ResourceModel child) {
    Button edit = new Button();
    edit.setStyleName(BaseTheme.BUTTON_LINK);
    edit.setDescription(ViewConstants.PROPERTY_DOWNLOAD);
    edit.setIcon(new ThemeResource("images/wpzoom/eye.png"));
    edit.addListener(new Button.ClickListener() {
        @Override//from ww  w  . j a  va2 s.co m
        public void buttonClick(ClickEvent event) {
            folderController.getRouter().getMainWindow().showNotification(
                    "Not yet Implemented " + child.getId(), Notification.TYPE_HUMANIZED_MESSAGE);

        }
    });
    return edit;
}

From source file:org.escidoc.browser.ui.view.helpers.ItemComponentsView.java

License:Open Source License

private Button createDownloadLink(final Component comp) {
    final Button link = new Button();
    link.setStyleName(BaseTheme.BUTTON_LINK);
    link.setIcon(createEmbeddedImage(comp));
    link.addListener(new Button.ClickListener() {

        private static final long serialVersionUID = 651483473875504715L;

        @Override/*  ww w . j  av  a2  s. co  m*/
        public void buttonClick(@SuppressWarnings("unused") final ClickEvent event) {
            mainWindow.open(
                    new ExternalResource(serviceLocation.getEscidocUri() + comp.getContent().getXLinkHref(),
                            comp.getProperties().getMimeType()),
                    "_new");
        }
    });
    return link;
}

From source file:org.escidoc.browser.ui.view.WikiPageView.java

License:Open Source License

private Button showDelete(final ResourceModel child) {
    Button edit = new Button();
    edit.setStyleName(BaseTheme.BUTTON_LINK);
    edit.setDescription(ViewConstants.PROPERTY_DELETE);
    edit.setIcon(new ThemeResource("images/wpzoom/trash.png"));
    edit.addListener(new Button.ClickListener() {
        @Override/*from  w w  w  .jav  a 2 s  . c o m*/
        public void buttonClick(ClickEvent event) {
            MessageBox mb = new MessageBox(router.getMainWindow().getWindow(), "Are you sure?",
                    MessageBox.Icon.QUESTION, "Do you really want to continue?",
                    new MessageBox.ButtonConfig(MessageBox.ButtonType.YES, "Yes"),
                    new MessageBox.ButtonConfig(MessageBox.ButtonType.NO, "No"));
            mb.show(new MessageBox.EventListener() {
                private static final long serialVersionUID = 1L;

                @Override
                public void buttonClicked(ButtonType buttonType) {
                    if (buttonType.equals(MessageBox.ButtonType.YES)) {
                        controller.deleteItem();
                    }
                }
            });

        }
    });
    return edit;
}

From source file:org.escidoc.browser.ui.view.WikiPageView.java

License:Open Source License

private Button showShare(final ResourceModel child) {
    Button edit = new Button();
    edit.setStyleName(BaseTheme.BUTTON_LINK);
    edit.setDescription(ViewConstants.PROPERTY_SHARE);
    edit.setIcon(new ThemeResource("images/wpzoom/share.png"));
    edit.addListener(new Button.ClickListener() {
        @Override/*from w  w w .j  a va 2s .  c om*/
        public void buttonClick(ClickEvent event) {
            controller.getRouter().getMainWindow().showNotification("Not yet Implemented " + child.getId(),
                    Notification.TYPE_HUMANIZED_MESSAGE);

        }
    });
    return edit;
}

From source file:org.escidoc.browser.ui.view.WikiPageView.java

License:Open Source License

private Button showShare(Version version) {
    Button edit = new Button();
    edit.setStyleName(BaseTheme.BUTTON_LINK);
    edit.setDescription(ViewConstants.PROPERTY_SHARE);
    edit.setIcon(new ThemeResource("images/wpzoom/share.png"));
    edit.addListener(new Button.ClickListener() {
        @Override//  ww w.  ja v a2  s  .  co m
        public void buttonClick(ClickEvent event) {
            controller.getRouter().getMainWindow().showNotification("Not yet Implemented ",
                    Notification.TYPE_HUMANIZED_MESSAGE);

        }
    });
    return edit;
}

From source file:org.escidoc.browser.ui.view.WikiPageView.java

License:Open Source License

private Button downloadShow(final ResourceModel child) {
    Button edit = new Button();
    edit.setStyleName(BaseTheme.BUTTON_LINK);
    edit.setDescription(ViewConstants.PROPERTY_DOWNLOAD);
    edit.setIcon(new ThemeResource("images/wpzoom/eye.png"));
    edit.addListener(new Button.ClickListener() {
        @Override//from   w w w.  j av a 2 s  .c om
        public void buttonClick(ClickEvent event) {
            try {
                router.getMainWindow().open(
                        new ExternalResource(buildUri(controller.getMetadata(ViewConstants.WIKIPAGEMD))),
                        "_blank");
            } catch (EscidocClientException e) {
                controller.getRouter().getMainWindow().showNotification(
                        "No content to download! Could it be that this Wiki is empty!?",
                        Notification.TYPE_HUMANIZED_MESSAGE);
            }

        }
    });
    return edit;
}