Search in sources :

Example 31 with ClickEvent

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

the class GroupSelectionPopupWindow method initSelectButton.

protected void initSelectButton() {
    final Button selectButton = new Button(i18nManager.getMessage(Messages.USER_SELECT_GROUPS));
    addComponent(selectButton);
    ((VerticalLayout) getContent()).setComponentAlignment(selectButton, Alignment.BOTTOM_RIGHT);
    selectButton.addListener(new ClickListener() {

        public void buttonClick(ClickEvent event) {
            fireEvent(new SubmitEvent(selectButton, SubmitEvent.SUBMITTED));
            close();
        }
    });
}
Also used : Button(com.vaadin.ui.Button) ClickEvent(com.vaadin.ui.Button.ClickEvent) VerticalLayout(com.vaadin.ui.VerticalLayout) ClickListener(com.vaadin.ui.Button.ClickListener) SubmitEvent(org.activiti.explorer.ui.event.SubmitEvent)

Example 32 with ClickEvent

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

the class NewGroupPopupWindow method initCreateButton.

protected void initCreateButton() {
    HorizontalLayout buttonLayout = new HorizontalLayout();
    buttonLayout.setWidth(100, UNITS_PERCENTAGE);
    form.getFooter().setWidth(100, UNITS_PERCENTAGE);
    form.getFooter().addComponent(buttonLayout);
    Button createButton = new Button(i18nManager.getMessage(Messages.GROUP_CREATE));
    buttonLayout.addComponent(createButton);
    buttonLayout.setComponentAlignment(createButton, Alignment.BOTTOM_RIGHT);
    createButton.addListener(new ClickListener() {

        public void buttonClick(ClickEvent event) {
            handleFormSubmit();
        }
    });
}
Also used : Button(com.vaadin.ui.Button) ClickEvent(com.vaadin.ui.Button.ClickEvent) ClickListener(com.vaadin.ui.Button.ClickListener) HorizontalLayout(com.vaadin.ui.HorizontalLayout)

Example 33 with ClickEvent

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

the class NewUserPopupWindow method initCreateButton.

protected void initCreateButton() {
    HorizontalLayout buttonLayout = new HorizontalLayout();
    buttonLayout.setWidth(100, UNITS_PERCENTAGE);
    form.getFooter().setWidth(100, UNITS_PERCENTAGE);
    form.getFooter().addComponent(buttonLayout);
    Button createButton = new Button(i18nManager.getMessage(Messages.USER_CREATE));
    buttonLayout.addComponent(createButton);
    buttonLayout.setComponentAlignment(createButton, Alignment.BOTTOM_RIGHT);
    createButton.addListener(new ClickListener() {

        public void buttonClick(ClickEvent event) {
            handleFormSubmit();
        }
    });
}
Also used : Button(com.vaadin.ui.Button) ClickEvent(com.vaadin.ui.Button.ClickEvent) ClickListener(com.vaadin.ui.Button.ClickListener) HorizontalLayout(com.vaadin.ui.HorizontalLayout)

Example 34 with ClickEvent

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

the class UserDetailPanel method initSaveButton.

protected void initSaveButton(VerticalLayout actionLayout) {
    Button saveButton = new Button(i18nManager.getMessage(Messages.USER_SAVE));
    saveButton.addStyleName(Reindeer.BUTTON_SMALL);
    actionLayout.addComponent(saveButton);
    saveButton.addListener(new ClickListener() {

        public void buttonClick(ClickEvent event) {
            String originalFirstName = user.getFirstName();
            String originalLastName = user.getLastName();
            // Change data
            user.setFirstName(firstNameField.getValue().toString());
            user.setLastName(lastNameField.getValue().toString());
            user.setEmail(emailField.getValue().toString());
            if (passwordField.getValue() != null && !"".equals(passwordField.getValue().toString())) {
                user.setPassword(passwordField.getValue().toString());
            }
            identityService.saveUser(user);
            // Refresh detail panel
            editingDetails = false;
            userDetailsLayout.removeAllComponents();
            populateUserDetails();
            // Refresh task list (only if name was changed)
            if (nameChanged(originalFirstName, originalLastName)) {
                userPage.notifyUserChanged(user.getId());
            }
        }
    });
}
Also used : Button(com.vaadin.ui.Button) ClickEvent(com.vaadin.ui.Button.ClickEvent) ClickListener(com.vaadin.ui.Button.ClickListener)

Example 35 with ClickEvent

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

the class UserDetailPanel method initAddGroupsButton.

protected void initAddGroupsButton(HorizontalLayout groupHeader) {
    Button addRelatedContentButton = new Button();
    addRelatedContentButton.addStyleName(ExplorerLayout.STYLE_ADD);
    groupHeader.addComponent(addRelatedContentButton);
    groupHeader.setComponentAlignment(addRelatedContentButton, Alignment.MIDDLE_RIGHT);
    addRelatedContentButton.addListener(new ClickListener() {

        private static final long serialVersionUID = 1L;

        public void buttonClick(ClickEvent event) {
            final GroupSelectionPopupWindow selectionPopup = new GroupSelectionPopupWindow(identityService, user.getId());
            selectionPopup.addListener(new SubmitEventListener() {

                private static final long serialVersionUID = 1L;

                protected void submitted(SubmitEvent event) {
                    Set<String> selectedGroups = selectionPopup.getSelectedGroupIds();
                    if (!selectedGroups.isEmpty()) {
                        for (String groupId : selectedGroups) {
                            identityService.createMembership(user.getId(), groupId);
                        }
                        notifyMembershipChanged();
                    }
                }

                protected void cancelled(SubmitEvent event) {
                }
            });
            ExplorerApp.get().getViewManager().showPopupWindow(selectionPopup);
        }
    });
}
Also used : Button(com.vaadin.ui.Button) SubmitEventListener(org.activiti.explorer.ui.event.SubmitEventListener) ClickEvent(com.vaadin.ui.Button.ClickEvent) ClickListener(com.vaadin.ui.Button.ClickListener) SubmitEvent(org.activiti.explorer.ui.event.SubmitEvent)

Aggregations

ClickEvent (com.vaadin.ui.Button.ClickEvent)68 ClickListener (com.vaadin.ui.Button.ClickListener)66 Button (com.vaadin.ui.Button)63 HorizontalLayout (com.vaadin.ui.HorizontalLayout)17 Label (com.vaadin.ui.Label)13 VerticalLayout (com.vaadin.ui.VerticalLayout)8 SubmitEvent (org.activiti.explorer.ui.event.SubmitEvent)8 LayoutClickEvent (com.vaadin.event.LayoutEvents.LayoutClickEvent)7 LayoutClickListener (com.vaadin.event.LayoutEvents.LayoutClickListener)7 ValueChangeEvent (com.vaadin.data.Property.ValueChangeEvent)5 ValueChangeListener (com.vaadin.data.Property.ValueChangeListener)4 TextField (com.vaadin.ui.TextField)4 Map (java.util.Map)4 ProcessDefinition (org.activiti.engine.repository.ProcessDefinition)4 ClaimTaskClickListener (org.activiti.explorer.ui.task.listener.ClaimTaskClickListener)4 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)3 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)3 ExternalResource (com.vaadin.terminal.ExternalResource)3 Form (com.vaadin.ui.Form)3 URL (java.net.URL)3