You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by bo...@apache.org on 2023/11/30 08:40:51 UTC

(streampipes) 02/03: feat: add text property with options for multiline and placeholders

This is an automated email from the ASF dual-hosted git repository.

bossenti pushed a commit to branch feat-ms-teams-sink
in repository https://gitbox.apache.org/repos/asf/streampipes.git

commit 6821737b90ef4a419e9dc5521cacd92d71462825
Author: bossenti <bo...@posteo.de>
AuthorDate: Thu Nov 30 09:40:08 2023 +0100

    feat: add text property with options for multiline and placeholders
---
 .../org/apache/streampipes/sdk/StaticProperties.java | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/streampipes-sdk/src/main/java/org/apache/streampipes/sdk/StaticProperties.java b/streampipes-sdk/src/main/java/org/apache/streampipes/sdk/StaticProperties.java
index bd9c595cf..a2d6092e2 100644
--- a/streampipes-sdk/src/main/java/org/apache/streampipes/sdk/StaticProperties.java
+++ b/streampipes-sdk/src/main/java/org/apache/streampipes/sdk/StaticProperties.java
@@ -90,6 +90,26 @@ public class StaticProperties {
     return property;
   }
 
+  /**
+   * Creates a FreeTextStaticProperty with the specified configuration options allowing only plaintext as input.
+   *
+   * @param label                    The label for the FreeTextStaticProperty.
+   * @param isMultiLine              {@code true} if the FreeTextStaticProperty should support multiline text,
+   *                                 {@code false} otherwise.
+   * @param arePlaceholdersSupported {@code true} if the FreeTextStaticProperty should support placeholders,
+   *                                 {@code false} otherwise.
+   * @return A configured FreeTextStaticProperty instance.
+   */
+  public static FreeTextStaticProperty stringFreeTextProperty(
+          Label label,
+          boolean isMultiLine,
+          boolean arePlaceholdersSupported) {
+    var property = stringFreeTextProperty(label);
+    property.setMultiLine(isMultiLine);
+    property.setPlaceholdersSupported(arePlaceholdersSupported);
+    return property;
+  }
+
   public static FreeTextStaticProperty integerFreeTextProperty(Label label) {
     return freeTextProperty(label, Datatypes.Integer);
   }