use of com.vaadin.ui.HorizontalLayout in project Activiti by Activiti.
the class AbstractProcessDefinitionDetailPanel method initUi.
protected void initUi() {
setSizeFull();
addStyleName(Reindeer.LAYOUT_WHITE);
detailPanelLayout = new VerticalLayout();
detailPanelLayout.setWidth(100, UNITS_PERCENTAGE);
detailPanelLayout.setMargin(true);
setDetailContainer(detailPanelLayout);
// All details about the process definition
initHeader();
detailContainer = new HorizontalLayout();
detailContainer.addStyleName(Reindeer.PANEL_LIGHT);
detailPanelLayout.addComponent(detailContainer);
detailContainer.setSizeFull();
initActions(parentPage);
initProcessDefinitionInfo();
}
use of com.vaadin.ui.HorizontalLayout 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;
}
use of com.vaadin.ui.HorizontalLayout 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.HorizontalLayout 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.HorizontalLayout 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