Search in sources :

Example 11 with SubmitEvent

use of org.activiti.explorer.ui.event.SubmitEvent 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 12 with SubmitEvent

use of org.activiti.explorer.ui.event.SubmitEvent 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)

Aggregations

SubmitEvent (org.activiti.explorer.ui.event.SubmitEvent)12 ClickEvent (com.vaadin.ui.Button.ClickEvent)8 ClickListener (com.vaadin.ui.Button.ClickListener)8 Button (com.vaadin.ui.Button)7 SubmitEventListener (org.activiti.explorer.ui.event.SubmitEventListener)6 SelectUsersPopupWindow (org.activiti.explorer.ui.custom.SelectUsersPopupWindow)4 Form (com.vaadin.ui.Form)2 PasswordField (com.vaadin.ui.PasswordField)2 TextField (com.vaadin.ui.TextField)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 ValueChangeEvent (com.vaadin.data.Property.ValueChangeEvent)1 ValueChangeListener (com.vaadin.data.Property.ValueChangeListener)1 InvalidValueException (com.vaadin.data.Validator.InvalidValueException)1 CheckBox (com.vaadin.ui.CheckBox)1 HorizontalLayout (com.vaadin.ui.HorizontalLayout)1 Label (com.vaadin.ui.Label)1 VerticalLayout (com.vaadin.ui.VerticalLayout)1 Attachment (org.activiti.engine.task.Attachment)1 LoggedInUser (org.activiti.explorer.identity.LoggedInUser)1