Search in sources :

Example 11 with CheckBox

use of com.vaadin.ui.CheckBox 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));
        }
    };
}
Also used : ValueChangeEvent(com.vaadin.data.Property.ValueChangeEvent) ValueChangeListener(com.vaadin.data.Property.ValueChangeListener) Form(com.vaadin.ui.Form) CheckBox(com.vaadin.ui.CheckBox) ClickEvent(com.vaadin.ui.Button.ClickEvent) TextField(com.vaadin.ui.TextField) PasswordField(com.vaadin.ui.PasswordField) HashMap(java.util.HashMap) Map(java.util.Map) ClickListener(com.vaadin.ui.Button.ClickListener) SubmitEvent(org.activiti.explorer.ui.event.SubmitEvent)

Example 12 with CheckBox

use of com.vaadin.ui.CheckBox in project Activiti by Activiti.

the class TaskTable method getSteps.

public List<HumanStepDefinition> getSteps() {
    List<HumanStepDefinition> steps = new ArrayList<HumanStepDefinition>();
    for (Object itemId : getItemIds()) {
        Item item = getItem(itemId);
        HumanStepDefinition humanStepDefinition = new HumanStepDefinition();
        String name = (String) item.getItemProperty(ID_NAME).getValue();
        if (name != null && name.length() > 0) {
            humanStepDefinition.setName(name);
        }
        String assignee = (String) ((ComboBox) item.getItemProperty(ID_ASSIGNEE).getValue()).getValue();
        if (assignee != null && assignee.length() > 0) {
            humanStepDefinition.setAssignee(assignee);
        }
        String groups = (String) ((ComboBox) item.getItemProperty("groups").getValue()).getValue();
        List<String> candidateGroups = new ArrayList<String>();
        if (groups != null && groups.length() > 0) {
            for (String group : groups.split(",")) {
                candidateGroups.add(group.trim());
            }
        }
        humanStepDefinition.setCandidateGroups(candidateGroups);
        String description = (String) ((TextField) item.getItemProperty(ID_DESCRIPTION).getValue()).getValue();
        if (description != null && description.length() > 0) {
            humanStepDefinition.setDescription(description);
        }
        humanStepDefinition.setStartsWithPrevious((boolean) ((CheckBox) item.getItemProperty(ID_START_WITH_PREVIOUS).getValue()).booleanValue());
        FormDefinition formDefinition = taskFormModel.getForm(itemId);
        humanStepDefinition.setForm(formDefinition);
        steps.add(humanStepDefinition);
    }
    return steps;
}
Also used : Item(com.vaadin.data.Item) HumanStepDefinition(org.activiti.workflow.simple.definition.HumanStepDefinition) CheckBox(com.vaadin.ui.CheckBox) ArrayList(java.util.ArrayList) FormDefinition(org.activiti.workflow.simple.definition.form.FormDefinition)

Example 13 with CheckBox

use of com.vaadin.ui.CheckBox in project Activiti by Activiti.

the class ChangeProcessSuspensionStatePopupWindow method addIncludeProcessInstancesSection.

protected void addIncludeProcessInstancesSection(boolean suspend) {
    verticalLayout.addComponent(new Label("&nbsp", Label.CONTENT_XHTML));
    verticalLayout.addComponent(new Label("&nbsp", Label.CONTENT_XHTML));
    includeProcessInstancesCheckBox = new CheckBox(suspend ? i18nManager.getMessage(Messages.PROCESS_SUSPEND_POPUP_INCLUDE_PROCESS_INSTANCES_DESCRIPTION) : i18nManager.getMessage(Messages.PROCESS_ACTIVATE_POPUP_INCLUDE_PROCESS_INSTANCES_DESCRIPTION), true);
    verticalLayout.addComponent(includeProcessInstancesCheckBox);
}
Also used : CheckBox(com.vaadin.ui.CheckBox) Label(com.vaadin.ui.Label)

Example 14 with CheckBox

use of com.vaadin.ui.CheckBox in project Activiti by Activiti.

the class BooleanFormPropertyRenderer method getPropertyField.

@Override
public Field getPropertyField(FormProperty formProperty) {
    CheckBox checkBox = new CheckBox(getPropertyLabel(formProperty));
    checkBox.setRequired(formProperty.isRequired());
    checkBox.setEnabled(formProperty.isWritable());
    if (formProperty.getValue() != null) {
        Boolean value = new Boolean(Boolean.parseBoolean(formProperty.getValue()));
        checkBox.setValue(value);
    }
    return checkBox;
}
Also used : CheckBox(com.vaadin.ui.CheckBox)

Aggregations

CheckBox (com.vaadin.ui.CheckBox)14 Item (com.vaadin.data.Item)3 ValueChangeEvent (com.vaadin.data.Property.ValueChangeEvent)3 ValueChangeListener (com.vaadin.data.Property.ValueChangeListener)3 TextField (com.vaadin.ui.TextField)3 ClickEvent (com.vaadin.ui.Button.ClickEvent)2 ClickListener (com.vaadin.ui.Button.ClickListener)2 ComboBox (com.vaadin.ui.ComboBox)2 HorizontalLayout (com.vaadin.ui.HorizontalLayout)2 Label (com.vaadin.ui.Label)2 Property (com.vaadin.data.Property)1 FieldEvents (com.vaadin.event.FieldEvents)1 Button (com.vaadin.ui.Button)1 DateField (com.vaadin.ui.DateField)1 Form (com.vaadin.ui.Form)1 PasswordField (com.vaadin.ui.PasswordField)1 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1