Search in sources :

Example 16 with GridLayout

use of com.vaadin.ui.GridLayout 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 17 with GridLayout

use of com.vaadin.ui.GridLayout 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 18 with GridLayout

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

the class SimpleTableEditor method initUi.

@Override
protected void initUi() {
    super.initUi();
    setSizeFull();
    // Hide the column on the left side
    grid.setColumnExpandRatio(0, 0f);
    mainLayout = new DetailPanel();
    setDetailComponent(mainLayout);
    // Editor
    editorGrid = new GridLayout(2, 7);
    editorGrid.setSizeFull();
    editorGrid.setMargin(true);
    editorGrid.setColumnExpandRatio(0, 1.0f);
    editorGrid.setColumnExpandRatio(1, 9.0f);
    editorGrid.setSpacing(true);
    mainLayout.addComponent(editorGrid);
    initNameField(editorGrid);
    initDescriptionField(editorGrid);
    initTaskTable(editorGrid);
    initButtons(editorGrid);
    toolBar.setActiveEntry(KEY_EDITOR);
}
Also used : GridLayout(com.vaadin.ui.GridLayout) DetailPanel(org.activiti.explorer.ui.custom.DetailPanel)

Example 19 with GridLayout

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

the class SavedReportDetailPanel method initHeader.

protected void initHeader() {
    GridLayout details = new GridLayout(2, 2);
    details.setWidth(100, UNITS_PERCENTAGE);
    details.addStyleName(ExplorerLayout.STYLE_TITLE_BLOCK);
    details.setSpacing(true);
    details.setMargin(false, false, true, false);
    details.setColumnExpandRatio(1, 1.0f);
    detailPanelLayout.addComponent(details);
    // Image
    Embedded image = new Embedded(null, Images.REPORT_50);
    details.addComponent(image, 0, 0, 0, 1);
    // Name
    Label nameLabel = new Label(SavedReportListItem.getReportDisplayName(historicProcessInstance));
    nameLabel.addStyleName(Reindeer.LABEL_H2);
    details.addComponent(nameLabel, 1, 0);
    // Properties
    HorizontalLayout propertiesLayout = new HorizontalLayout();
    propertiesLayout.setSpacing(true);
    details.addComponent(propertiesLayout);
    // Created Time
    String createLabel = i18nManager.getMessage(Messages.REPORTING_CREATE_TIME, new HumanTime(i18nManager).format(historicProcessInstance.getEndTime()));
    Label versionLabel = new Label(createLabel);
    versionLabel.addStyleName(ExplorerLayout.STYLE_PROCESS_HEADER_START_TIME);
    propertiesLayout.addComponent(versionLabel);
}
Also used : HumanTime(org.activiti.explorer.util.time.HumanTime) GridLayout(com.vaadin.ui.GridLayout) Label(com.vaadin.ui.Label) Embedded(com.vaadin.ui.Embedded) HorizontalLayout(com.vaadin.ui.HorizontalLayout)

Example 20 with GridLayout

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

the class SubTaskComponent method initSubTasksLayout.

protected void initSubTasksLayout() {
    subTaskLayout = new GridLayout();
    subTaskLayout.setColumns(3);
    subTaskLayout.addStyleName(ExplorerLayout.STYLE_TASK_SUBTASKS_LIST);
    subTaskLayout.setWidth(99, UNITS_PERCENTAGE);
    subTaskLayout.setColumnExpandRatio(2, 1.0f);
    subTaskLayout.setSpacing(true);
    layout.addComponent(subTaskLayout);
}
Also used : GridLayout(com.vaadin.ui.GridLayout)

Aggregations

GridLayout (com.vaadin.ui.GridLayout)36 Label (com.vaadin.ui.Label)21 Embedded (com.vaadin.ui.Embedded)9 HorizontalLayout (com.vaadin.ui.HorizontalLayout)9 TextField (com.vaadin.ui.TextField)7 PrettyTimeLabel (org.activiti.explorer.ui.custom.PrettyTimeLabel)6 Panel (com.vaadin.ui.Panel)4 Button (com.vaadin.ui.Button)3 PasswordField (com.vaadin.ui.PasswordField)3 VerticalLayout (com.vaadin.ui.VerticalLayout)3 ComboBox (com.vaadin.ui.ComboBox)2 Component (com.vaadin.ui.Component)2 DateField (com.vaadin.ui.DateField)2 Link (com.vaadin.ui.Link)2 TextArea (com.vaadin.ui.TextArea)2 Window (com.vaadin.ui.Window)2 Test (org.junit.Test)2 DefaultPmoBasedSectionFactory (org.linkki.core.ui.section.DefaultPmoBasedSectionFactory)2 CorpusBrowserPanel (annis.gui.CorpusBrowserPanel)1 MetaDataPanel (annis.gui.MetaDataPanel)1