Codota Logo
AbstractRenderFormDelegate
Code IndexAdd Codota to your IDE (free)

How to use
AbstractRenderFormDelegate
in
org.camunda.bpm.engine.impl.form.engine

Best Java code snippets using org.camunda.bpm.engine.impl.form.engine.AbstractRenderFormDelegate (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
LocalDateTime l =
  • Codota Iconnew LocalDateTime()
  • Codota IconLocalDateTime.now()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseLocalDateTime(text)
  • Smart code suggestions by Codota
}
origin: camunda/camunda-bpm-platform

protected void renderSelectBox(FormField formField, HtmlDocumentBuilder documentBuilder) {
 HtmlElementWriter selectBox = new HtmlElementWriter(SELECT_ELEMENT, false);
 addCommonFormFieldAttributes(formField, selectBox);
 // <select ...>
 documentBuilder.startElement(selectBox);
 // <option ...>
 renderSelectOptions(formField, documentBuilder);
 // </select>
 documentBuilder.endElement();
}
origin: camunda/camunda-bpm-platform

protected void renderInputField(FormField formField, HtmlDocumentBuilder documentBuilder) {
 HtmlElementWriter inputField = new HtmlElementWriter(INPUT_ELEMENT, true);
 addCommonFormFieldAttributes(formField, inputField);
 String inputType = !isBoolean(formField) ? TEXT_INPUT_TYPE : CHECKBOX_INPUT_TYPE;
 inputField.attribute(TYPE_ATTRIBUTE, inputType);
 // add default value
 Object defaultValue = formField.getDefaultValue();
 if(defaultValue != null) {
  inputField.attribute(VALUE_ATTRIBUTE, defaultValue.toString());
 }
 // <input ... />
 documentBuilder.startElement(inputField).endElement();
}
origin: camunda/camunda-bpm-platform

protected void renderFormField(FormField formField, HtmlDocumentBuilder documentBuilder) {
 // start group
 HtmlElementWriter divElement = new HtmlElementWriter(DIV_ELEMENT)
   .attribute(CLASS_ATTRIBUTE, FORM_GROUP_CLASS);
 documentBuilder.startElement(divElement);
 String formFieldId = formField.getId();
 String formFieldLabel = formField.getLabel();
 // write label
 if (formFieldLabel != null && !formFieldLabel.isEmpty()) {
  HtmlElementWriter labelElement = new HtmlElementWriter(LABEL_ELEMENT)
    .attribute(FOR_ATTRIBUTE, formFieldId)
    .textContent(formFieldLabel);
  // <label for="...">...</label>
  documentBuilder.startElement(labelElement).endElement();
 }
 // render form control
 if(isEnum(formField)) {
  // <select ...>
  renderSelectBox(formField, documentBuilder);
 } else if (isDate(formField)){
  renderDatePicker(formField, documentBuilder);
 } else {
  // <input ...>
  renderInputField(formField, documentBuilder);
 }
 renderInvalidMessageElement(formField, documentBuilder);
 // end group
 documentBuilder.endElement();
}
origin: camunda/camunda-bpm-platform

protected void renderInvalidMessageElement(FormField formField, HtmlDocumentBuilder documentBuilder) {
 HtmlElementWriter divElement = new HtmlElementWriter(DIV_ELEMENT);
 String formFieldId = formField.getId();
 String ifExpression = String.format(INVALID_EXPRESSION + " && " + DIRTY_EXPRESSION, formFieldId, formFieldId);
 divElement
   .attribute(NG_IF_ATTRIBUTE, ifExpression)
   .attribute(CLASS_ATTRIBUTE, HAS_ERROR_CLASS);
 // <div ng-if="....$invalid && ....$dirty"...>
 documentBuilder.startElement(divElement);
 if (!isDate(formField)) {
  renderInvalidValueMessage(formField, documentBuilder);
  renderInvalidTypeMessage(formField, documentBuilder);
 } else {
  renderInvalidDateMessage(formField, documentBuilder);
 }
 documentBuilder.endElement();
}
origin: camunda/camunda-bpm-platform

protected void addCommonFormFieldAttributes(FormField formField, HtmlElementWriter formControl) {
 String typeName = formField.getTypeName();
 if (isEnum(formField) || isDate(formField)) {
  typeName = StringFormType.TYPE_NAME;
 }
 typeName = typeName.substring(0, 1).toUpperCase() + typeName.substring(1);
 String formFieldId = formField.getId();
 formControl
   .attribute(CLASS_ATTRIBUTE, FORM_CONTROL_CLASS)
   .attribute(NAME_ATTRIBUTE, formFieldId)
   .attribute(CAM_VARIABLE_TYPE_ATTRIBUTE, typeName)
   .attribute(CAM_VARIABLE_NAME_ATTRIBUTE, formFieldId);
 // add validation constraints
 for (FormFieldValidationConstraint constraint : formField.getValidationConstraints()) {
  String constraintName = constraint.getName();
  String configuration = (String) constraint.getConfiguration();
  formControl.attribute(constraintName, configuration);
 }
}
origin: camunda/camunda-bpm-platform

protected void renderDatePicker(FormField formField, HtmlDocumentBuilder documentBuilder) {
 boolean isReadOnly = isReadOnly(formField);
 HtmlElementWriter inputField = createInputField(formField);
origin: camunda/camunda-bpm-platform

protected HtmlElementWriter createInputField(FormField formField) {
 HtmlElementWriter inputField = new HtmlElementWriter(INPUT_ELEMENT, true);
 addCommonFormFieldAttributes(formField, inputField);
 inputField.attribute(TYPE_ATTRIBUTE, TEXT_INPUT_TYPE);
 return inputField;
}
origin: camunda/camunda-bpm-platform

protected void renderInvalidTypeMessage(FormField formField, HtmlDocumentBuilder documentBuilder) {
 HtmlElementWriter divElement = new HtmlElementWriter(DIV_ELEMENT);
 String formFieldId = formField.getId();
 String expression = String.format(TYPE_ERROR_EXPRESSION, formFieldId);
 String typeName = formField.getTypeName();
 if (isEnum(formField)) {
  typeName = StringFormType.TYPE_NAME;
 }
 divElement
   .attribute(NG_SHOW_ATTRIBUTE, expression)
   .attribute(CLASS_ATTRIBUTE, HELP_BLOCK_CLASS)
   .textContent(String.format(TYPE_FIELD_MESSAGE, typeName));
 documentBuilder
   .startElement(divElement)
   .endElement();
}
origin: camunda/camunda-bpm-platform

protected String renderFormData(FormData formData) {
 if(formData == null
   || (formData.getFormFields() == null || formData.getFormFields().isEmpty())
   && (formData.getFormProperties() == null || formData.getFormProperties().isEmpty())) {
  return null;
 } else {
  HtmlElementWriter formElement = new HtmlElementWriter(FORM_ELEMENT)
    .attribute(NAME_ATTRIBUTE, GENERATED_FORM_NAME)
    .attribute(ROLE_ATTRIBUTE, FORM_ROLE);
  HtmlDocumentBuilder documentBuilder = new HtmlDocumentBuilder(formElement);
  // render fields
  for (FormField formField : formData.getFormFields()) {
   renderFormField(formField, documentBuilder);
  }
  // render deprecated form properties
  for (FormProperty formProperty : formData.getFormProperties()) {
   renderFormField(new FormPropertyAdapter(formProperty), documentBuilder);
  }
  // end document element
  documentBuilder.endElement();
  return documentBuilder.getHtmlString();
 }
}
origin: camunda/camunda-bpm-platform

protected void renderInvalidMessageElement(FormField formField, HtmlDocumentBuilder documentBuilder) {
 HtmlElementWriter divElement = new HtmlElementWriter(DIV_ELEMENT);
 String formFieldId = formField.getId();
 String ifExpression = String.format(INVALID_EXPRESSION + " && " + DIRTY_EXPRESSION, formFieldId, formFieldId);
 divElement
   .attribute(NG_IF_ATTRIBUTE, ifExpression)
   .attribute(CLASS_ATTRIBUTE, HAS_ERROR_CLASS);
 // <div ng-if="....$invalid && ....$dirty"...>
 documentBuilder.startElement(divElement);
 if (!isDate(formField)) {
  renderInvalidValueMessage(formField, documentBuilder);
  renderInvalidTypeMessage(formField, documentBuilder);
 } else {
  renderInvalidDateMessage(formField, documentBuilder);
 }
 documentBuilder.endElement();
}
origin: camunda/camunda-bpm-platform

protected void addCommonFormFieldAttributes(FormField formField, HtmlElementWriter formControl) {
 String typeName = formField.getTypeName();
 if (isEnum(formField) || isDate(formField)) {
  typeName = StringFormType.TYPE_NAME;
 }
 typeName = typeName.substring(0, 1).toUpperCase() + typeName.substring(1);
 String formFieldId = formField.getId();
 formControl
   .attribute(CLASS_ATTRIBUTE, FORM_CONTROL_CLASS)
   .attribute(NAME_ATTRIBUTE, formFieldId)
   .attribute(CAM_VARIABLE_TYPE_ATTRIBUTE, typeName)
   .attribute(CAM_VARIABLE_NAME_ATTRIBUTE, formFieldId);
 // add validation constraints
 for (FormFieldValidationConstraint constraint : formField.getValidationConstraints()) {
  String constraintName = constraint.getName();
  String configuration = (String) constraint.getConfiguration();
  formControl.attribute(constraintName, configuration);
 }
}
origin: camunda/camunda-bpm-platform

protected void renderDatePicker(FormField formField, HtmlDocumentBuilder documentBuilder) {
 boolean isReadOnly = isReadOnly(formField);
 HtmlElementWriter inputField = createInputField(formField);
origin: camunda/camunda-bpm-platform

protected HtmlElementWriter createInputField(FormField formField) {
 HtmlElementWriter inputField = new HtmlElementWriter(INPUT_ELEMENT, true);
 addCommonFormFieldAttributes(formField, inputField);
 inputField.attribute(TYPE_ATTRIBUTE, TEXT_INPUT_TYPE);
 return inputField;
}
origin: camunda/camunda-bpm-platform

protected void renderInvalidTypeMessage(FormField formField, HtmlDocumentBuilder documentBuilder) {
 HtmlElementWriter divElement = new HtmlElementWriter(DIV_ELEMENT);
 String formFieldId = formField.getId();
 String expression = String.format(TYPE_ERROR_EXPRESSION, formFieldId);
 String typeName = formField.getTypeName();
 if (isEnum(formField)) {
  typeName = StringFormType.TYPE_NAME;
 }
 divElement
   .attribute(NG_SHOW_ATTRIBUTE, expression)
   .attribute(CLASS_ATTRIBUTE, HELP_BLOCK_CLASS)
   .textContent(String.format(TYPE_FIELD_MESSAGE, typeName));
 documentBuilder
   .startElement(divElement)
   .endElement();
}
origin: camunda/camunda-bpm-platform

protected String renderFormData(FormData formData) {
 if(formData == null
   || (formData.getFormFields() == null || formData.getFormFields().isEmpty())
   && (formData.getFormProperties() == null || formData.getFormProperties().isEmpty())) {
  return null;
 } else {
  HtmlElementWriter formElement = new HtmlElementWriter(FORM_ELEMENT)
    .attribute(NAME_ATTRIBUTE, GENERATED_FORM_NAME)
    .attribute(ROLE_ATTRIBUTE, FORM_ROLE);
  HtmlDocumentBuilder documentBuilder = new HtmlDocumentBuilder(formElement);
  // render fields
  for (FormField formField : formData.getFormFields()) {
   renderFormField(formField, documentBuilder);
  }
  // render deprecated form properties
  for (FormProperty formProperty : formData.getFormProperties()) {
   renderFormField(new FormPropertyAdapter(formProperty), documentBuilder);
  }
  // end document element
  documentBuilder.endElement();
  return documentBuilder.getHtmlString();
 }
}
origin: camunda/camunda-bpm-platform

protected void renderFormField(FormField formField, HtmlDocumentBuilder documentBuilder) {
 // start group
 HtmlElementWriter divElement = new HtmlElementWriter(DIV_ELEMENT)
   .attribute(CLASS_ATTRIBUTE, FORM_GROUP_CLASS);
 documentBuilder.startElement(divElement);
 String formFieldId = formField.getId();
 String formFieldLabel = formField.getLabel();
 // write label
 if (formFieldLabel != null && !formFieldLabel.isEmpty()) {
  HtmlElementWriter labelElement = new HtmlElementWriter(LABEL_ELEMENT)
    .attribute(FOR_ATTRIBUTE, formFieldId)
    .textContent(formFieldLabel);
  // <label for="...">...</label>
  documentBuilder.startElement(labelElement).endElement();
 }
 // render form control
 if(isEnum(formField)) {
  // <select ...>
  renderSelectBox(formField, documentBuilder);
 } else if (isDate(formField)){
  renderDatePicker(formField, documentBuilder);
 } else {
  // <input ...>
  renderInputField(formField, documentBuilder);
 }
 renderInvalidMessageElement(formField, documentBuilder);
 // end group
 documentBuilder.endElement();
}
origin: org.camunda.bpm/camunda-engine

protected void renderInvalidMessageElement(FormField formField, HtmlDocumentBuilder documentBuilder) {
 HtmlElementWriter divElement = new HtmlElementWriter(DIV_ELEMENT);
 String formFieldId = formField.getId();
 String ifExpression = String.format(INVALID_EXPRESSION + " && " + DIRTY_EXPRESSION, formFieldId, formFieldId);
 divElement
   .attribute(NG_IF_ATTRIBUTE, ifExpression)
   .attribute(CLASS_ATTRIBUTE, HAS_ERROR_CLASS);
 // <div ng-if="....$invalid && ....$dirty"...>
 documentBuilder.startElement(divElement);
 if (!isDate(formField)) {
  renderInvalidValueMessage(formField, documentBuilder);
  renderInvalidTypeMessage(formField, documentBuilder);
 } else {
  renderInvalidDateMessage(formField, documentBuilder);
 }
 documentBuilder.endElement();
}
origin: camunda/camunda-bpm-platform

protected void renderSelectBox(FormField formField, HtmlDocumentBuilder documentBuilder) {
 HtmlElementWriter selectBox = new HtmlElementWriter(SELECT_ELEMENT, false);
 addCommonFormFieldAttributes(formField, selectBox);
 // <select ...>
 documentBuilder.startElement(selectBox);
 // <option ...>
 renderSelectOptions(formField, documentBuilder);
 // </select>
 documentBuilder.endElement();
}
origin: camunda/camunda-bpm-platform

protected void renderInputField(FormField formField, HtmlDocumentBuilder documentBuilder) {
 HtmlElementWriter inputField = new HtmlElementWriter(INPUT_ELEMENT, true);
 addCommonFormFieldAttributes(formField, inputField);
 String inputType = !isBoolean(formField) ? TEXT_INPUT_TYPE : CHECKBOX_INPUT_TYPE;
 inputField.attribute(TYPE_ATTRIBUTE, inputType);
 // add default value
 Object defaultValue = formField.getDefaultValue();
 if(defaultValue != null) {
  inputField.attribute(VALUE_ATTRIBUTE, defaultValue.toString());
 }
 // <input ... />
 documentBuilder.startElement(inputField).endElement();
}
origin: org.camunda.bpm/camunda-engine

protected void addCommonFormFieldAttributes(FormField formField, HtmlElementWriter formControl) {
 String typeName = formField.getTypeName();
 if (isEnum(formField) || isDate(formField)) {
  typeName = StringFormType.TYPE_NAME;
 }
 typeName = typeName.substring(0, 1).toUpperCase() + typeName.substring(1);
 String formFieldId = formField.getId();
 formControl
   .attribute(CLASS_ATTRIBUTE, FORM_CONTROL_CLASS)
   .attribute(NAME_ATTRIBUTE, formFieldId)
   .attribute(CAM_VARIABLE_TYPE_ATTRIBUTE, typeName)
   .attribute(CAM_VARIABLE_NAME_ATTRIBUTE, formFieldId);
 // add validation constraints
 for (FormFieldValidationConstraint constraint : formField.getValidationConstraints()) {
  String constraintName = constraint.getName();
  String configuration = (String) constraint.getConfiguration();
  formControl.attribute(constraintName, configuration);
 }
}
org.camunda.bpm.engine.impl.form.engineAbstractRenderFormDelegate

Most used methods

  • addCommonFormFieldAttributes
  • createInputField
  • isBoolean
  • isDate
  • isEnum
  • isReadOnly
  • renderDatePicker
  • renderFormField
  • renderInputField
  • renderInvalidDateMessage
  • renderInvalidMessageElement
  • renderInvalidTypeMessage
  • renderInvalidMessageElement,
  • renderInvalidTypeMessage,
  • renderInvalidValueMessage,
  • renderSelectBox,
  • renderSelectOptions

Popular in Java

  • Finding current android device location
  • runOnUiThread (Activity)
  • onRequestPermissionsResult (Fragment)
  • addToBackStack (FragmentTransaction)
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • StringTokenizer (java.util)
    The string tokenizer class allows an application to break a string into tokens. The tokenization met
  • Vector (java.util)
    The Vector class implements a growable array of objects. Like an array, it contains components that
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement.A servlet is a small Java program that runs within
  • JTable (javax.swing)
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now