diff options
Diffstat (limited to 'simple/simple-http/src/test/java/org/simpleframework/http/socket/table/WebSocketTableColumnStyle.java')
-rw-r--r-- | simple/simple-http/src/test/java/org/simpleframework/http/socket/table/WebSocketTableColumnStyle.java | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/simple/simple-http/src/test/java/org/simpleframework/http/socket/table/WebSocketTableColumnStyle.java b/simple/simple-http/src/test/java/org/simpleframework/http/socket/table/WebSocketTableColumnStyle.java new file mode 100644 index 0000000..f514295 --- /dev/null +++ b/simple/simple-http/src/test/java/org/simpleframework/http/socket/table/WebSocketTableColumnStyle.java @@ -0,0 +1,35 @@ +package org.simpleframework.http.socket.table; + +public class WebSocketTableColumnStyle { + + private final String template; + private final String caption; + private final String name; + private final boolean sortable; + private final boolean resizable; + + public WebSocketTableColumnStyle(String name, String caption, String template, boolean resizable, boolean sortable) { + this.name = name; + this.caption = caption; + this.template = template; + this.resizable = resizable; + this.sortable = sortable; + } + + public String createStyle() { + StringBuilder builder = new StringBuilder(); + WebSocketValueEncoder encoder = new WebSocketValueEncoder(); + + builder.append(name); + builder.append(","); + builder.append(encoder.encode(caption)); + builder.append(","); + builder.append(encoder.encode(template)); + builder.append(","); + builder.append(resizable); + builder.append(","); + builder.append(sortable); + + return builder.toString(); + } +} |