Skip to content

Commit

Permalink
URL widget type
Browse files Browse the repository at this point in the history
  • Loading branch information
teosarca committed Jun 12, 2017
1 parent 62ace33 commit 787c9ef
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
@ApiModel("widget-type")
public enum JSONLayoutWidgetType
{
Text, LongText, Password
Text, LongText, Link, Password

, Date, Time, DateTime

Expand Down Expand Up @@ -66,6 +66,7 @@ public static JSONLayoutWidgetType fromNullable(DocumentFieldWidgetType widgetTy
private static final Map<DocumentFieldWidgetType, JSONLayoutWidgetType> widgetType2json = ImmutableMap.<DocumentFieldWidgetType, JSONLayoutWidgetType> builder()
.put(DocumentFieldWidgetType.Text, JSONLayoutWidgetType.Text)
.put(DocumentFieldWidgetType.LongText, JSONLayoutWidgetType.LongText)
.put(DocumentFieldWidgetType.URL, JSONLayoutWidgetType.Link)
.put(DocumentFieldWidgetType.Password, JSONLayoutWidgetType.Password)
.put(DocumentFieldWidgetType.Date, JSONLayoutWidgetType.Date)
.put(DocumentFieldWidgetType.Time, JSONLayoutWidgetType.Time)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public enum DocumentFieldWidgetType
// Text
Text(LayoutAlign.Left, String.class) //
, LongText(LayoutAlign.Left, String.class) //
, URL(LayoutAlign.Left, String.class) //
, Password(LayoutAlign.Left, String.class) //

//
Expand Down Expand Up @@ -128,7 +129,7 @@ public final boolean isNumeric()

public final boolean isText()
{
return this == Text || this == LongText || this == Password;
return this == Text || this == LongText || this == URL || this == Password;
}

public final boolean isButton()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@ else if (isPassword(columnName, displayType))
{
return DocumentFieldWidgetType.Password;
}
else if(displayType == DisplayType.URL)
{
return DocumentFieldWidgetType.URL;
}
else if (DisplayType.isText(displayType))
{
return DocumentFieldWidgetType.Text;
Expand Down

0 comments on commit 787c9ef

Please sign in to comment.