Search in sources :

Example 6 with LoggedInUser

use of org.activiti.explorer.identity.LoggedInUser 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 7 with LoggedInUser

use of org.activiti.explorer.identity.LoggedInUser in project Activiti by Activiti.

the class ExplorerApp method close.

/**
   *  Required to support multiple browser windows/tabs, 
   *  see http://vaadin.com/web/joonas/wiki/-/wiki/Main/Supporting%20Multible%20Tabs
   */
//  public Window getWindow(String name) {
//    Window window = super.getWindow(name);
//    if (window == null) {
//      window = new Window("Activiti Explorer");
//      window.setName(name);
//      addWindow(window);
//      window.open(new ExternalResource(window.getURL()));
//    }
//
//    return window;
//  }
@Override
public void close() {
    final LoggedInUser theUser = getLoggedInUser();
    // Clear the logged in user
    setUser(null);
    // Call loginhandler
    getLoginHandler().logout(theUser);
    invalidatedSession = false;
    super.close();
}
Also used : LoggedInUser(org.activiti.explorer.identity.LoggedInUser)

Aggregations

LoggedInUser (org.activiti.explorer.identity.LoggedInUser)7 Group (org.activiti.engine.identity.Group)2 Action (com.vaadin.event.Action)1 Handler (com.vaadin.event.Action.Handler)1 ShortcutAction (com.vaadin.event.ShortcutAction)1 Button (com.vaadin.ui.Button)1 ClickEvent (com.vaadin.ui.Button.ClickEvent)1 ClickListener (com.vaadin.ui.Button.ClickListener)1 MenuBar (com.vaadin.ui.MenuBar)1 Command (com.vaadin.ui.MenuBar.Command)1 MenuItem (com.vaadin.ui.MenuBar.MenuItem)1 User (org.activiti.engine.identity.User)1 Task (org.activiti.engine.task.Task)1 LoggedInUserImpl (org.activiti.explorer.identity.LoggedInUserImpl)1 ToolbarEntry (org.activiti.explorer.ui.custom.ToolbarEntry)1 ToolbarCommand (org.activiti.explorer.ui.custom.ToolbarEntry.ToolbarCommand)1 ToolbarPopupEntry (org.activiti.explorer.ui.custom.ToolbarPopupEntry)1 SubmitEvent (org.activiti.explorer.ui.event.SubmitEvent)1 ChangePasswordPopupWindow (org.activiti.explorer.ui.profile.ChangePasswordPopupWindow)1 ArchivedListQuery (org.activiti.explorer.ui.task.data.ArchivedListQuery)1