Search in sources :

Example 96 with Label

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

the class ChangePasswordPopupWindow method initPasswordFields.

protected void initPasswordFields() {
    inputGrid = new GridLayout(2, 2);
    inputGrid.setSpacing(true);
    layout.addComponent(inputGrid);
    layout.setComponentAlignment(inputGrid, Alignment.MIDDLE_CENTER);
    Label newPasswordLabel = new Label(i18nManager.getMessage(Messages.PROFILE_NEW_PASSWORD));
    inputGrid.addComponent(newPasswordLabel);
    passwordField1 = new PasswordField();
    passwordField1.setWidth(150, UNITS_PIXELS);
    inputGrid.addComponent(passwordField1);
    passwordField1.focus();
    Label confirmPasswordLabel = new Label(i18nManager.getMessage(Messages.PROFILE_CONFIRM_PASSWORD));
    inputGrid.addComponent(confirmPasswordLabel);
    passwordField2 = new PasswordField();
    passwordField2.setWidth(150, UNITS_PIXELS);
    inputGrid.addComponent(passwordField2);
}
Also used : GridLayout(com.vaadin.ui.GridLayout) Label(com.vaadin.ui.Label) PasswordField(com.vaadin.ui.PasswordField)

Example 97 with Label

use of com.vaadin.ui.Label 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 98 with Label

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

Example 99 with Label

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

the class ProfilePanel method initUi.

protected void initUi() {
    removeAllComponents();
    addStyleName(Reindeer.PANEL_LIGHT);
    addStyleName(ExplorerLayout.STYLE_PROFILE_LAYOUT);
    setSizeFull();
    // Profile page is a horizontal layout: left we have a panel with the picture, 
    // and one the right there is another panel the about, contact, etc information
    this.profilePanelLayout = new HorizontalLayout();
    profilePanelLayout.setSizeFull();
    setContent(profilePanelLayout);
    // init both panels
    initImagePanel();
    Label emptySpace = new Label(" ", Label.CONTENT_XHTML);
    emptySpace.setWidth(50, UNITS_PIXELS);
    profilePanelLayout.addComponent(emptySpace);
    initInformationPanel();
}
Also used : Label(com.vaadin.ui.Label) HorizontalLayout(com.vaadin.ui.HorizontalLayout)

Example 100 with Label

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

the class FormPopupWindow method initUi.

protected void initUi() {
    VerticalLayout layout = new VerticalLayout();
    layout.setSpacing(true);
    addComponent(layout);
    // Description
    layout.addComponent(new Label(DESCRIPTION));
    // Property table
    propertyTable = new PropertyTable();
    layout.addComponent(propertyTable);
    fillFormFields();
    // Buttons
    HorizontalLayout buttons = new HorizontalLayout();
    buttons.setSpacing(true);
    // Save button
    Button saveButton = new Button(ExplorerApp.get().getI18nManager().getMessage(Messages.BUTTON_SAVE));
    buttons.addComponent(saveButton);
    saveButton.addListener(new Button.ClickListener() {

        private static final long serialVersionUID = -2906886872414089331L;

        public void buttonClick(ClickEvent event) {
            FormDefinition form = createForm();
            formModel.addForm(taskItemId, form);
            close();
        }
    });
    // Delete button
    Button deleteButton = new Button(ExplorerApp.get().getI18nManager().getMessage(Messages.BUTTON_DELETE));
    buttons.addComponent(deleteButton);
    deleteButton.addListener(new Button.ClickListener() {

        private static final long serialVersionUID = 5267967369680365653L;

        public void buttonClick(ClickEvent event) {
            formModel.removeForm(taskItemId);
            close();
        }
    });
    layout.addComponent(new Label(""));
    layout.addComponent(buttons);
}
Also used : PropertyTable(org.activiti.explorer.ui.process.simple.editor.table.PropertyTable) Button(com.vaadin.ui.Button) ClickEvent(com.vaadin.ui.Button.ClickEvent) Label(com.vaadin.ui.Label) VerticalLayout(com.vaadin.ui.VerticalLayout) FormDefinition(org.activiti.workflow.simple.definition.form.FormDefinition) HorizontalLayout(com.vaadin.ui.HorizontalLayout)

Aggregations

Label (com.vaadin.ui.Label)158 HorizontalLayout (com.vaadin.ui.HorizontalLayout)45 PrettyTimeLabel (org.activiti.explorer.ui.custom.PrettyTimeLabel)40 VerticalLayout (com.vaadin.ui.VerticalLayout)33 Embedded (com.vaadin.ui.Embedded)29 Button (com.vaadin.ui.Button)18 GridLayout (com.vaadin.ui.GridLayout)17 Link (com.vaadin.ui.Link)14 ClickEvent (com.vaadin.ui.Button.ClickEvent)13 Table (com.vaadin.ui.Table)13 ClickListener (com.vaadin.ui.Button.ClickListener)11 TextField (com.vaadin.ui.TextField)10 Item (com.vaadin.data.Item)9 ExternalResource (com.vaadin.server.ExternalResource)9 StreamResource (com.vaadin.terminal.StreamResource)8 PostConstruct (javax.annotation.PostConstruct)8 ValueChangeEvent (com.vaadin.data.Property.ValueChangeEvent)6 ExternalResource (com.vaadin.terminal.ExternalResource)6 Component (com.vaadin.ui.Component)6 Panel (com.vaadin.ui.Panel)5