use of com.vaadin.ui.TextArea in project Activiti by Activiti.
the class TaskDetailPanel method initDescription.
protected void initDescription(HorizontalLayout layout) {
final CssLayout descriptionLayout = new CssLayout();
descriptionLayout.setWidth(100, UNITS_PERCENTAGE);
layout.addComponent(descriptionLayout);
layout.setExpandRatio(descriptionLayout, 1.0f);
layout.setComponentAlignment(descriptionLayout, Alignment.MIDDLE_LEFT);
String descriptionText = null;
if (task.getDescription() != null && !"".equals(task.getDescription())) {
descriptionText = task.getDescription();
} else {
descriptionText = i18nManager.getMessage(Messages.TASK_NO_DESCRIPTION);
}
final Label descriptionLabel = new Label(descriptionText);
descriptionLabel.addStyleName(ExplorerLayout.STYLE_CLICKABLE);
descriptionLayout.addComponent(descriptionLabel);
descriptionLayout.addListener(new LayoutClickListener() {
public void layoutClick(LayoutClickEvent event) {
if (event.getClickedComponent() != null && event.getClickedComponent().equals(descriptionLabel)) {
// layout for textarea + ok button
final VerticalLayout editLayout = new VerticalLayout();
editLayout.setSpacing(true);
// textarea
final TextArea descriptionTextArea = new TextArea();
descriptionTextArea.setNullRepresentation("");
descriptionTextArea.setWidth(100, UNITS_PERCENTAGE);
descriptionTextArea.setValue(task.getDescription());
editLayout.addComponent(descriptionTextArea);
// ok button
Button okButton = new Button(i18nManager.getMessage(Messages.BUTTON_OK));
editLayout.addComponent(okButton);
editLayout.setComponentAlignment(okButton, Alignment.BOTTOM_RIGHT);
// replace
descriptionLayout.replaceComponent(descriptionLabel, editLayout);
// When OK is clicked -> update task data + ui
okButton.addListener(new ClickListener() {
public void buttonClick(ClickEvent event) {
// Update data
task.setDescription(descriptionTextArea.getValue().toString());
taskService.saveTask(task);
// Update UI
descriptionLabel.setValue(task.getDescription());
descriptionLayout.replaceComponent(editLayout, descriptionLabel);
}
});
}
}
});
}
use of com.vaadin.ui.TextArea in project Activiti by Activiti.
the class NewCasePopupWindow method initForm.
protected void initForm() {
form = new Form();
form.setValidationVisibleOnCommit(true);
form.setImmediate(true);
addComponent(form);
// name
nameField = new TextField(i18nManager.getMessage(Messages.TASK_NAME));
nameField.focus();
nameField.setRequired(true);
nameField.setRequiredError(i18nManager.getMessage(Messages.TASK_NAME_REQUIRED));
form.addField("name", nameField);
// description
descriptionArea = new TextArea(i18nManager.getMessage(Messages.TASK_DESCRIPTION));
descriptionArea.setColumns(25);
form.addField("description", descriptionArea);
// duedate
dueDateField = new DateField(i18nManager.getMessage(Messages.TASK_DUEDATE));
dueDateField.setResolution(DateField.RESOLUTION_DAY);
form.addField("duedate", dueDateField);
// priority
priorityComboBox = new PriorityComboBox(i18nManager);
form.addField("priority", priorityComboBox);
}
use of com.vaadin.ui.TextArea in project Activiti by Activiti.
the class DescriptionComponent method initLayoutClickListener.
protected void initLayoutClickListener() {
addListener(new LayoutClickListener() {
public void layoutClick(LayoutClickEvent event) {
if (event.getClickedComponent() != null && event.getClickedComponent().equals(descriptionLabel)) {
// textarea
final TextArea descriptionTextArea = new TextArea();
descriptionTextArea.setWidth(100, UNITS_PERCENTAGE);
descriptionTextArea.setValue(task.getDescription());
editLayout.addComponent(descriptionTextArea);
// ok button
Button okButton = new Button(i18nManager.getMessage(Messages.BUTTON_OK));
editLayout.addComponent(okButton);
editLayout.setComponentAlignment(okButton, Alignment.BOTTOM_RIGHT);
// replace
replaceComponent(descriptionLabel, editLayout);
// When OK is clicked -> update task data + ui
okButton.addListener(new ClickListener() {
public void buttonClick(ClickEvent event) {
// Update data
task.setDescription(descriptionTextArea.getValue().toString());
taskService.saveTask(task);
// Update UI
descriptionLabel.setValue(task.getDescription());
replaceComponent(editLayout, descriptionLabel);
}
});
}
}
});
}
use of com.vaadin.ui.TextArea in project Activiti by Activiti.
the class NewModelPopupWindow method addFields.
protected void addFields() {
formLayout = new GridLayout(2, 3);
formLayout.setSpacing(true);
formLayout.addComponent(new Label(i18nManager.getMessage(Messages.TASK_NAME)));
nameTextField = new TextField();
nameTextField.setWidth(25, Sizeable.UNITS_EM);
nameTextField.focus();
formLayout.addComponent(nameTextField);
formLayout.addComponent(new Label(i18nManager.getMessage(Messages.TASK_DESCRIPTION)));
descriptionTextArea = new TextArea();
descriptionTextArea.setRows(8);
descriptionTextArea.setWidth(25, Sizeable.UNITS_EM);
descriptionTextArea.addStyleName(ExplorerLayout.STYLE_TEXTAREA_NO_RESIZE);
formLayout.addComponent(descriptionTextArea);
Label editorLabel = new Label(i18nManager.getMessage(Messages.PROCESS_EDITOR_CHOICE));
formLayout.addComponent(editorLabel);
formLayout.setComponentAlignment(editorLabel, Alignment.MIDDLE_LEFT);
selectEditorComponent = new SelectEditorComponent();
formLayout.addComponent(selectEditorComponent);
addComponent(formLayout);
// Some empty space
Label emptySpace = new Label(" ", Label.CONTENT_XHTML);
addComponent(emptySpace);
}
use of com.vaadin.ui.TextArea in project Activiti by Activiti.
the class UrlAttachmentEditorComponent method initDescription.
protected void initDescription() {
TextArea descriptionField = new TextArea(i18nManager.getMessage(Messages.RELATED_CONTENT_DESCRIPTION));
descriptionField.setWidth(100, UNITS_PERCENTAGE);
descriptionField.setHeight(100, UNITS_PIXELS);
addField("description", descriptionField);
}
Aggregations