propertyJSON.put("required", property.isRequired()); propertyJSON.put("readable", property.isReadable()); propertyJSON.put("writable", property.isWritable());
@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; }
public Field getPropertyField(FormProperty formProperty) { ComboBox comboBox = new ComboBox(getPropertyLabel(formProperty)); comboBox.setRequired(formProperty.isRequired()); comboBox.setRequiredError(getMessage(Messages.FORM_FIELD_REQUIRED, getPropertyLabel(formProperty))); comboBox.setEnabled(formProperty.isWritable());
public Field getPropertyField(FormProperty formProperty) { ComboBox comboBox = new MonthCombobox(getPropertyLabel(formProperty)); comboBox.setRequired(formProperty.isRequired()); comboBox.setRequiredError(getMessage(Messages.FORM_FIELD_REQUIRED, getPropertyLabel(formProperty))); comboBox.setEnabled(formProperty.isWritable()); // Fill combobox I18nManager i18nManager = ExplorerApp.get().getI18nManager(); for (int i=0; i<12; i++) { comboBox.addItem(i); comboBox.setItemCaption(i, i18nManager.getMessage(Messages.MONTH_PREFIX + i)); } // Select first comboBox.setNullSelectionAllowed(false); Calendar cal = Calendar.getInstance(); comboBox.select(cal.get(Calendar.MONTH)); return comboBox; }
@Override public Field getPropertyField(FormProperty formProperty) { // Writable string PopupDateField dateField = new PopupDateField(getPropertyLabel(formProperty)); String datePattern = (String) formProperty.getType().getInformation("datePattern"); dateField.setDateFormat(datePattern); dateField.setRequired(formProperty.isRequired()); dateField.setRequiredError(getMessage(Messages.FORM_FIELD_REQUIRED, getPropertyLabel(formProperty))); dateField.setEnabled(formProperty.isWritable()); if (formProperty.getValue() != null) { // Try parsing the current value SimpleDateFormat dateFormat = new SimpleDateFormat(datePattern); try { Date date = dateFormat.parse(formProperty.getValue()); dateField.setValue(date); } catch (ParseException e) { // TODO: what happens if current value is illegal date? } } return dateField; }
@Override public Field getPropertyField(FormProperty formProperty) { TextField textField = new TextField(getPropertyLabel(formProperty)); textField.setRequired(formProperty.isRequired()); textField.setEnabled(formProperty.isWritable()); textField.setRequiredError(getMessage(Messages.FORM_FIELD_REQUIRED, getPropertyLabel(formProperty))); if (formProperty.getValue() != null) { textField.setValue(formProperty.getValue()); } return textField; }
@Override public Field getPropertyField(FormProperty formProperty) { SelectUserField selectUserField = new SelectUserField(getPropertyLabel(formProperty)); selectUserField.setRequired(formProperty.isRequired()); selectUserField.setRequiredError(getMessage(Messages.FORM_FIELD_REQUIRED, getPropertyLabel(formProperty))); selectUserField.setEnabled(formProperty.isWritable()); if (formProperty.getValue() != null) { selectUserField.setValue(formProperty.getValue()); } return selectUserField; }
@Override public Field getPropertyField(FormProperty formProperty) { final TextField textField = new TextField(getPropertyLabel(formProperty)); textField.setRequired(formProperty.isRequired()); textField.setEnabled(formProperty.isWritable()); textField.setRequiredError(getMessage(Messages.FORM_FIELD_REQUIRED, getPropertyLabel(formProperty))); if (formProperty.getValue() != null) { textField.setValue(formProperty.getValue()); } // Add validation of numeric value textField.addValidator(new DoubleValidator("Value must be a double")); textField.setImmediate(true); return textField; }
@Override public Field getPropertyField(FormProperty formProperty) { final TextField textField = new TextField(getPropertyLabel(formProperty)); textField.setRequired(formProperty.isRequired()); textField.setEnabled(formProperty.isWritable()); textField.setRequiredError(getMessage(Messages.FORM_FIELD_REQUIRED, getPropertyLabel(formProperty))); if (formProperty.getValue() != null) { textField.setValue(formProperty.getValue()); } // Add validation of numeric value textField.addValidator(new LongValidator("Value must be a long")); textField.setImmediate(true); return textField; }
public Field getPropertyField(FormProperty formProperty) { ComboBox comboBox = new ComboBox(getPropertyLabel(formProperty)); comboBox.setRequired(formProperty.isRequired()); comboBox.setRequiredError(getMessage(Messages.FORM_FIELD_REQUIRED, getPropertyLabel(formProperty))); comboBox.setEnabled(formProperty.isWritable()); List<ProcessDefinition> processDefinitions = ProcessEngines.getDefaultProcessEngine() .getRepositoryService() .createProcessDefinitionQuery() .orderByProcessDefinitionName().asc() .orderByProcessDefinitionVersion().asc() .list(); for (ProcessDefinition processDefinition : processDefinitions) { comboBox.addItem(processDefinition.getId()); String name = processDefinition.getName() + " (v" + processDefinition.getVersion() + ")"; comboBox.setItemCaption(processDefinition.getId(), name); } // Select first if (!processDefinitions.isEmpty()) { comboBox.setNullSelectionAllowed(false); comboBox.select(processDefinitions.get(0).getId()); } return comboBox; }
restFormProp.setRequired(formProp.isRequired()); restFormProp.setWritable(formProp.isWritable()); if ("enum".equals(restFormProp.getType())) {