Search in sources :

Example 41 with Button

use of com.vaadin.ui.Button 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 42 with Button

use of com.vaadin.ui.Button 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 43 with Button

use of com.vaadin.ui.Button 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 44 with Button

use of com.vaadin.ui.Button 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)

Example 45 with Button

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

the class UserDetailPanel method initEditButton.

protected void initEditButton(VerticalLayout actionLayout) {
    Button editButton = new Button(i18nManager.getMessage(Messages.USER_EDIT));
    editButton.addStyleName(Reindeer.BUTTON_SMALL);
    actionLayout.addComponent(editButton);
    editButton.addListener(new ClickListener() {

        public void buttonClick(ClickEvent event) {
            editingDetails = true;
            userDetailsLayout.removeAllComponents();
            // the layout will be populated differently since the 'editingDetails' boolean is set
            populateUserDetails();
        }
    });
}
Also used : Button(com.vaadin.ui.Button) ClickEvent(com.vaadin.ui.Button.ClickEvent) ClickListener(com.vaadin.ui.Button.ClickListener)

Aggregations

Button (com.vaadin.ui.Button)114 ClickEvent (com.vaadin.ui.Button.ClickEvent)72 ClickListener (com.vaadin.ui.Button.ClickListener)64 HorizontalLayout (com.vaadin.ui.HorizontalLayout)33 VerticalLayout (com.vaadin.ui.VerticalLayout)25 Label (com.vaadin.ui.Label)21 Chart (com.vaadin.addon.charts.Chart)8 ListSeries (com.vaadin.addon.charts.model.ListSeries)8 TextField (com.vaadin.ui.TextField)8 SubmitEvent (org.activiti.explorer.ui.event.SubmitEvent)7 Configuration (com.vaadin.addon.charts.model.Configuration)6 LayoutClickEvent (com.vaadin.event.LayoutEvents.LayoutClickEvent)6 LayoutClickListener (com.vaadin.event.LayoutEvents.LayoutClickListener)6 ClaimTaskClickListener (org.activiti.explorer.ui.task.listener.ClaimTaskClickListener)5 ComboBox (com.vaadin.ui.ComboBox)4 FormLayout (com.vaadin.ui.FormLayout)4 Window (com.vaadin.ui.Window)4 SimpleDateFormat (java.text.SimpleDateFormat)4 SubmitEventListener (org.activiti.explorer.ui.event.SubmitEventListener)4 VertexRef (org.opennms.features.topology.api.topo.VertexRef)4