]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.document.swt.core/src/org/simantics/document/swt/core/bean/ColumnsBean.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.document.swt.core / src / org / simantics / document / swt / core / bean / ColumnsBean.java
1 package org.simantics.document.swt.core.bean;
2
3 import java.io.IOException;
4
5 import org.simantics.browsing.ui.Column.Align;
6 import org.simantics.databoard.Bindings;
7 import org.simantics.databoard.binding.Binding;
8 import org.simantics.databoard.binding.error.BindingException;
9 import org.simantics.databoard.parser.repository.DataValueRepository;
10
11 public class ColumnsBean {
12
13         public static final Binding BINDING = Bindings.getBindingUnchecked(ColumnsBean.class);
14
15         public ColumnBean[] columns;
16         
17         public static void main(String[] args) {
18                 
19                 System.err.println(BINDING.type().toSingleLineString());
20                 
21                 ColumnBean b1 = new ColumnBean();
22                 b1.alignment = "CENTER";
23                 b1.grab = false;
24                 b1.key = "k";
25                 b1.label = "l";
26                 b1.tooltip = "t";
27                 b1.weight = 1;
28                 b1.width = 2;
29                 
30                 ColumnBean b2 = new ColumnBean();
31                 b2.alignment = "LEFT";
32                 b2.grab = true;
33                 b2.key = "k2";
34                 b2.label = "l2";
35                 b2.tooltip = "t2";
36                 b2.weight = 3;
37                 b2.width = 4;
38
39                 ColumnBean[] cbs = { b1, b2 };
40                 
41                 ColumnsBean bean = new ColumnsBean();
42                 bean.columns = cbs;
43                 
44                 try {
45                         BINDING.printValue(bean, System.out, new DataValueRepository(), true);
46                 } catch (IOException e) {
47                         // TODO Auto-generated catch block
48                         e.printStackTrace();
49                 } catch (BindingException e) {
50                         // TODO Auto-generated catch block
51                         e.printStackTrace();
52                 }
53                 
54         }
55         
56 }