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);
}
use of com.vaadin.ui.Label in project Activiti by Activiti.
the class ChangePasswordPopupWindow method initChangePasswordButton.
protected void initChangePasswordButton() {
errorLabel = new Label(" ", 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();
}
});
}
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);
}
}
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();
}
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);
}
Aggregations