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);
}
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);
}
}
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);
}
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);
}
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);
}
Aggregations