Search in sources :

Example 91 with Button

use of com.vaadin.ui.Button in project Activiti by Activiti.

the class SelectUsersPopupWindow method initSelectMyselfButton.

protected void initSelectMyselfButton(HorizontalLayout searchLayout) {
    final LoggedInUser loggedInUser = ExplorerApp.get().getLoggedInUser();
    if (ignoredUserIds == null || !ignoredUserIds.contains(loggedInUser.getId())) {
        Button meButton = new Button(i18nManager.getMessage(Messages.PEOPLE_SELECT_MYSELF));
        meButton.setIcon(Images.USER_16);
        searchLayout.addComponent(meButton);
        searchLayout.setComponentAlignment(meButton, Alignment.MIDDLE_LEFT);
        if (multiSelect) {
            meButton.addListener(new ClickListener() {

                public void buttonClick(ClickEvent event) {
                    selectUser(loggedInUser.getId(), loggedInUser.getFullName());
                }
            });
        } else {
            meButton.addListener(new ClickListener() {

                public void buttonClick(ClickEvent event) {
                    addMatchingUser(loggedInUser.getId(), loggedInUser.getFullName());
                    matchingUsersTable.select(loggedInUser.getId());
                    fireEvent(new SubmitEvent(doneButton, SubmitEvent.SUBMITTED));
                    close();
                }
            });
        }
    }
}
Also used : Button(com.vaadin.ui.Button) ClickEvent(com.vaadin.ui.Button.ClickEvent) LoggedInUser(org.activiti.explorer.identity.LoggedInUser) ClickListener(com.vaadin.ui.Button.ClickListener) SubmitEvent(org.activiti.explorer.ui.event.SubmitEvent)

Example 92 with Button

use of com.vaadin.ui.Button in project Activiti by Activiti.

the class SelectUsersPopupWindow method initDoneButton.

protected void initDoneButton() {
    doneButton = new Button("Done");
    doneButton.addListener(new ClickListener() {

        public void buttonClick(ClickEvent event) {
            // Fire event such that depending UI's can be updated
            fireEvent(new SubmitEvent(doneButton, SubmitEvent.SUBMITTED));
            // close popup window
            close();
        }
    });
    addComponent(doneButton);
    windowLayout.setComponentAlignment(doneButton, Alignment.MIDDLE_RIGHT);
}
Also used : Button(com.vaadin.ui.Button) ClickEvent(com.vaadin.ui.Button.ClickEvent) ClickListener(com.vaadin.ui.Button.ClickListener) SubmitEvent(org.activiti.explorer.ui.event.SubmitEvent)

Example 93 with Button

use of com.vaadin.ui.Button in project Activiti by Activiti.

the class TabbedSelectionWindow method initActions.

protected void initActions() {
    okButton = new Button(i18nManager.getMessage(Messages.BUTTON_OK));
    selectedComponentLayout.addComponent(okButton, 0, 1);
    okButton.setEnabled(false);
    okButton.addListener(new ClickListener() {

        private static final long serialVersionUID = 1L;

        public void buttonClick(ClickEvent event) {
            listeners.get(currentSelection).buttonClick(event);
            close();
        }
    });
    selectedComponentLayout.setComponentAlignment(okButton, Alignment.BOTTOM_RIGHT);
}
Also used : Button(com.vaadin.ui.Button) ClickEvent(com.vaadin.ui.Button.ClickEvent) ClickListener(com.vaadin.ui.Button.ClickListener)

Example 94 with Button

use of com.vaadin.ui.Button in project Activiti by Activiti.

the class UrlAttachmentRenderer method getOverviewComponent.

public Component getOverviewComponent(final Attachment attachment, final RelatedContentComponent parent) {
    // instead of showing popup with details.
    if (attachment.getDescription() != null && !"".equals(attachment.getDescription())) {
        Button attachmentLink = new Button(attachment.getName());
        attachmentLink.addStyleName(Reindeer.BUTTON_LINK);
        attachmentLink.addListener(new ClickListener() {

            private static final long serialVersionUID = 1L;

            public void buttonClick(ClickEvent event) {
                parent.showAttachmentDetail(attachment);
            }
        });
        return attachmentLink;
    } else {
        return new Link(attachment.getName(), new ExternalResource(attachment.getUrl()));
    }
}
Also used : Button(com.vaadin.ui.Button) ClickEvent(com.vaadin.ui.Button.ClickEvent) ExternalResource(com.vaadin.terminal.ExternalResource) ClickListener(com.vaadin.ui.Button.ClickListener) Link(com.vaadin.ui.Link)

Aggregations

Button (com.vaadin.ui.Button)94 ClickEvent (com.vaadin.ui.Button.ClickEvent)63 ClickListener (com.vaadin.ui.Button.ClickListener)61 HorizontalLayout (com.vaadin.ui.HorizontalLayout)26 Label (com.vaadin.ui.Label)19 VerticalLayout (com.vaadin.ui.VerticalLayout)13 LayoutClickEvent (com.vaadin.event.LayoutEvents.LayoutClickEvent)7 LayoutClickListener (com.vaadin.event.LayoutEvents.LayoutClickListener)7 SubmitEvent (org.activiti.explorer.ui.event.SubmitEvent)7 ClaimTaskClickListener (org.activiti.explorer.ui.task.listener.ClaimTaskClickListener)5 ValueChangeEvent (com.vaadin.data.Property.ValueChangeEvent)4 TextField (com.vaadin.ui.TextField)4 SubmitEventListener (org.activiti.explorer.ui.event.SubmitEventListener)4 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)3 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)3 Item (com.vaadin.data.Item)3 ValueChangeListener (com.vaadin.data.Property.ValueChangeListener)3 ExternalResource (com.vaadin.terminal.ExternalResource)3 ComboBox (com.vaadin.ui.ComboBox)3 FormLayout (com.vaadin.ui.FormLayout)3