use of com.vaadin.ui.TextField in project Activiti by Activiti.
the class TaskTable method addTaskRow.
protected Object addTaskRow(Object previousTaskItemId, String taskName, String taskAssignee, String taskGroups, String taskDescription, Boolean startWithPrevious) {
Object newItemId = null;
if (previousTaskItemId == null) {
// add at the end of list
newItemId = addItem();
} else {
newItemId = addItemAfter(previousTaskItemId);
}
Item newItem = getItem(newItemId);
// name
newItem.getItemProperty(ID_NAME).setValue(taskName == null ? "my task" : taskName);
// assignee
ComboBox assigneeComboBox = new ComboBox();
assigneeComboBox.setNullSelectionAllowed(true);
try {
for (User user : ProcessEngines.getDefaultProcessEngine().getIdentityService().createUserQuery().orderByUserFirstName().asc().list()) {
assigneeComboBox.addItem(user.getId());
assigneeComboBox.setItemCaption(user.getId(), user.getFirstName() + " " + user.getLastName());
}
} catch (Exception e) {
// Don't do anything. Will be an empty dropdown.
}
if (taskAssignee != null) {
assigneeComboBox.select(taskAssignee);
}
newItem.getItemProperty(ID_ASSIGNEE).setValue(assigneeComboBox);
// groups
ComboBox groupComboBox = new ComboBox();
groupComboBox.setNullSelectionAllowed(true);
try {
for (Group group : ProcessEngines.getDefaultProcessEngine().getIdentityService().createGroupQuery().orderByGroupName().asc().list()) {
groupComboBox.addItem(group.getId());
groupComboBox.setItemCaption(group.getId(), group.getName());
}
} catch (Exception e) {
// Don't do anything. Will be an empty dropdown.
}
if (taskGroups != null) {
groupComboBox.select(taskGroups);
}
newItem.getItemProperty(ID_GROUPS).setValue(groupComboBox);
// description
TextField descriptionTextField = new TextField();
descriptionTextField.setColumns(16);
descriptionTextField.setRows(1);
if (taskDescription != null) {
descriptionTextField.setValue(taskDescription);
}
newItem.getItemProperty(ID_DESCRIPTION).setValue(descriptionTextField);
// concurrency
CheckBox startWithPreviousCheckBox = new CheckBox(i18nManager.getMessage(Messages.PROCESS_EDITOR_TASK_START_WITH_PREVIOUS));
startWithPreviousCheckBox.setValue(startWithPrevious == null ? false : startWithPrevious);
newItem.getItemProperty(ID_START_WITH_PREVIOUS).setValue(startWithPreviousCheckBox);
// actions
newItem.getItemProperty(ID_ACTIONS).setValue(generateActionButtons(newItemId));
return newItemId;
}
use of com.vaadin.ui.TextField in project Activiti by Activiti.
the class AccountSelectionPopup method initImapComponent.
protected void initImapComponent() {
imapForm = new Form();
imapForm.setDescription(i18nManager.getMessage(Messages.IMAP_DESCRIPTION));
final TextField imapServer = new TextField(i18nManager.getMessage(Messages.IMAP_SERVER));
imapForm.getLayout().addComponent(imapServer);
final TextField imapPort = new TextField(i18nManager.getMessage(Messages.IMAP_PORT));
imapPort.setWidth(30, UNITS_PIXELS);
// Default imap port (non-ssl)
imapPort.setValue(143);
imapForm.getLayout().addComponent(imapPort);
final CheckBox useSSL = new CheckBox(i18nManager.getMessage(Messages.IMAP_SSL));
useSSL.setValue(false);
useSSL.setImmediate(true);
imapForm.getLayout().addComponent(useSSL);
useSSL.addListener(new ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
imapPort.setValue(((Boolean) useSSL.getValue()) ? 993 : 143);
}
});
final TextField imapUserName = new TextField(i18nManager.getMessage(Messages.IMAP_USERNAME));
imapForm.getLayout().addComponent(imapUserName);
final PasswordField imapPassword = new PasswordField(i18nManager.getMessage(Messages.IMAP_PASSWORD));
imapForm.getLayout().addComponent(imapPassword);
// Matching listener
imapClickListener = new ClickListener() {
public void buttonClick(ClickEvent event) {
Map<String, Object> accountDetails = createAccountDetails("imap", imapUserName.getValue().toString(), imapPassword.getValue().toString(), "server", imapServer.getValue().toString(), "port", imapPort.getValue().toString(), "ssl", imapPort.getValue().toString());
fireEvent(new SubmitEvent(AccountSelectionPopup.this, SubmitEvent.SUBMITTED, accountDetails));
}
};
}
use of com.vaadin.ui.TextField 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.TextField in project Activiti by Activiti.
the class FileAttachmentEditorComponent method initName.
protected void initName() {
TextField nameField = new TextField(i18nManager.getMessage(Messages.RELATED_CONTENT_NAME));
nameField.focus();
nameField.setRequired(true);
nameField.setRequiredError(i18nManager.getMessage(Messages.RELATED_CONTENT_NAME_REQUIRED));
nameField.setWidth(100, UNITS_PERCENTAGE);
form.addField("name", nameField);
}
use of com.vaadin.ui.TextField in project Activiti by Activiti.
the class UrlAttachmentEditorComponent method initName.
protected void initName() {
TextField nameField = new TextField(i18nManager.getMessage(Messages.RELATED_CONTENT_NAME));
nameField.setWidth(100, UNITS_PERCENTAGE);
addField("name", nameField);
}
Aggregations