Search in sources :

Example 66 with Button

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

the class TaskTable method generateActionButtons.

protected HorizontalLayout generateActionButtons(Object taskItemId) {
    HorizontalLayout actionButtons = new HorizontalLayout();
    FormDefinition form = taskFormModel.getForm(taskItemId);
    Button formButton = new Button(form == null ? i18nManager.getMessage(Messages.PROCESS_EDITOR_TASK_FORM_CREATE) : i18nManager.getMessage(Messages.PROCESS_EDITOR_TASK_FORM_EDIT));
    formButton.addListener(new ShowFormClickListener(taskFormModel, taskItemId));
    formButton.setData(taskItemId);
    actionButtons.addComponent(formButton);
    Button deleteTaskButton = new Button("-");
    deleteTaskButton.setData(taskItemId);
    deleteTaskButton.addListener(new DeleteTaskClickListener(this));
    actionButtons.addComponent(deleteTaskButton);
    Button addTaskButton = new Button("+");
    addTaskButton.setData(taskItemId);
    addTaskButton.addListener(new AddTaskClickListener(this));
    actionButtons.addComponent(addTaskButton);
    return actionButtons;
}
Also used : ShowFormClickListener(org.activiti.explorer.ui.process.simple.editor.listener.ShowFormClickListener) Button(com.vaadin.ui.Button) DeleteTaskClickListener(org.activiti.explorer.ui.process.simple.editor.listener.DeleteTaskClickListener) FormDefinition(org.activiti.workflow.simple.definition.form.FormDefinition) HorizontalLayout(com.vaadin.ui.HorizontalLayout) AddTaskClickListener(org.activiti.explorer.ui.process.simple.editor.listener.AddTaskClickListener)

Example 67 with Button

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

the class ChangePasswordPopupWindow method initChangePasswordButton.

protected void initChangePasswordButton() {
    errorLabel = new Label("&nbsp", Label.CONTENT_XHTML);
    errorLabel.addStyleName(Reindeer.LABEL_SMALL);
    errorLabel.addStyleName(ExplorerLayout.STYLE_LABEL_RED);
    layout.addComponent(errorLabel);
    Button changePasswordButton = new Button(i18nManager.getMessage(Messages.PASSWORD_CHANGE));
    layout.addComponent(changePasswordButton);
    layout.setComponentAlignment(changePasswordButton, Alignment.MIDDLE_CENTER);
    changePasswordButton.addListener(new ClickListener() {

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

Example 68 with Button

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

the class ProfilePanel method initEditProfileButton.

protected Button initEditProfileButton() {
    Button editProfileButton = new Button(i18nManager.getMessage(Messages.PROFILE_EDIT));
    editProfileButton.setIcon(Images.EDIT);
    editProfileButton.addListener(new ClickListener() {

        public void buttonClick(ClickEvent event) {
            editable = true;
            initUi();
        }
    });
    return editProfileButton;
}
Also used : Button(com.vaadin.ui.Button) ClickEvent(com.vaadin.ui.Button.ClickEvent) ClickListener(com.vaadin.ui.Button.ClickListener)

Example 69 with Button

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

the class ProfilePanel method initSaveProfileButton.

protected Button initSaveProfileButton() {
    Button saveProfileButton = new Button(i18nManager.getMessage(Messages.PROFILE_SAVE));
    saveProfileButton.setIcon(Images.SAVE);
    saveProfileButton.addListener(new ClickListener() {

        public void buttonClick(ClickEvent event) {
            user.setFirstName((String) firstNameField.getValue());
            user.setLastName((String) lastNameField.getValue());
            user.setEmail((String) emailField.getValue());
            identityService.saveUser(user);
            identityService.setUserInfo(user.getId(), Constants.USER_INFO_JOB_TITLE, jobTitleField.getValue().toString());
            if (birthDateField.getValue() != null && !"".equals(birthDateField.getValue().toString())) {
                identityService.setUserInfo(user.getId(), Constants.USER_INFO_BIRTH_DATE, new SimpleDateFormat(Constants.DEFAULT_DATE_FORMAT).format(birthDateField.getValue()));
            }
            identityService.setUserInfo(user.getId(), Constants.USER_INFO_LOCATION, locationField.getValue().toString());
            identityService.setUserInfo(user.getId(), Constants.USER_INFO_PHONE, phoneField.getValue().toString());
            identityService.setUserInfo(user.getId(), Constants.USER_INFO_TWITTER, twitterField.getValue().toString());
            identityService.setUserInfo(user.getId(), Constants.USER_INFO_SKYPE, skypeField.getValue().toString());
            // UI
            editable = false;
            loadProfileData();
            initUi();
        }
    });
    return saveProfileButton;
}
Also used : Button(com.vaadin.ui.Button) ClickEvent(com.vaadin.ui.Button.ClickEvent) SimpleDateFormat(java.text.SimpleDateFormat) ClickListener(com.vaadin.ui.Button.ClickListener)

Example 70 with Button

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

the class ProfilePanel method initAboutSection.

protected void initAboutSection() {
    // Header
    HorizontalLayout header = new HorizontalLayout();
    header.setWidth(100, UNITS_PERCENTAGE);
    header.addStyleName(ExplorerLayout.STYLE_DETAIL_BLOCK);
    infoPanelLayout.addComponent(header);
    Label aboutLabel = createProfileHeader(infoPanelLayout, i18nManager.getMessage(Messages.PROFILE_ABOUT));
    header.addComponent(aboutLabel);
    header.setExpandRatio(aboutLabel, 1.0f);
    // only show edit/save buttons if current user matches
    if (isCurrentLoggedInUser) {
        Button actionButton = null;
        if (!editable) {
            actionButton = initEditProfileButton();
        } else {
            actionButton = initSaveProfileButton();
        }
        header.addComponent(actionButton);
        header.setComponentAlignment(actionButton, Alignment.MIDDLE_RIGHT);
    }
    // 'About' fields
    GridLayout aboutLayout = createInfoSectionLayout(2, 4);
    // Name
    if (!editable && (isDefined(user.getFirstName()) || isDefined(user.getLastName()))) {
        addProfileEntry(aboutLayout, i18nManager.getMessage(Messages.PROFILE_NAME), user.getFirstName() + " " + user.getLastName());
    } else if (editable) {
        firstNameField = new TextField();
        firstNameField.focus();
        addProfileInputField(aboutLayout, i18nManager.getMessage(Messages.PROFILE_FIRST_NAME), firstNameField, user.getFirstName());
        lastNameField = new TextField();
        addProfileInputField(aboutLayout, i18nManager.getMessage(Messages.PROFILE_LAST_NAME), lastNameField, user.getLastName());
    }
    // Job title
    if (!editable && isDefined(jobTitle)) {
        addProfileEntry(aboutLayout, i18nManager.getMessage(Messages.PROFILE_JOBTITLE), jobTitle);
    } else if (editable) {
        jobTitleField = new TextField();
        addProfileInputField(aboutLayout, i18nManager.getMessage(Messages.PROFILE_JOBTITLE), jobTitleField, jobTitle);
    }
    // Birthdate
    if (!editable && isDefined(birthDate)) {
        addProfileEntry(aboutLayout, i18nManager.getMessage(Messages.PROFILE_BIRTHDATE), birthDate);
    } else if (editable) {
        birthDateField = new DateField();
        birthDateField.setDateFormat(Constants.DEFAULT_DATE_FORMAT);
        birthDateField.setResolution(DateField.RESOLUTION_DAY);
        try {
            birthDateField.setValue(new SimpleDateFormat(Constants.DEFAULT_DATE_FORMAT).parse(birthDate));
        }// do nothing
         catch (Exception e) {
        }
        addProfileInputField(aboutLayout, i18nManager.getMessage(Messages.PROFILE_BIRTHDATE), birthDateField, null);
    }
    // Location
    if (!editable && isDefined(location)) {
        addProfileEntry(aboutLayout, i18nManager.getMessage(Messages.PROFILE_LOCATION), location);
    } else if (editable) {
        locationField = new TextField();
        addProfileInputField(aboutLayout, i18nManager.getMessage(Messages.PROFILE_LOCATION), locationField, location);
    }
}
Also used : GridLayout(com.vaadin.ui.GridLayout) Button(com.vaadin.ui.Button) Label(com.vaadin.ui.Label) TextField(com.vaadin.ui.TextField) DateField(com.vaadin.ui.DateField) SimpleDateFormat(java.text.SimpleDateFormat) HorizontalLayout(com.vaadin.ui.HorizontalLayout)

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