Sync git svn branch with SVN repository r33334.
[simantics/platform.git] / bundles / org.simantics.browsing.ui.nattable / src / org / simantics / browsing / ui / nattable / GENatTableThemeConfiguration.java
1 package org.simantics.browsing.ui.nattable;\r
2 \r
3 import org.eclipse.core.runtime.FileLocator;\r
4 import org.eclipse.core.runtime.Path;\r
5 import org.eclipse.nebula.widgets.nattable.painter.cell.BackgroundPainter;\r
6 import org.eclipse.nebula.widgets.nattable.painter.cell.TextPainter;\r
7 import org.eclipse.nebula.widgets.nattable.painter.cell.decorator.PaddingDecorator;\r
8 import org.eclipse.nebula.widgets.nattable.style.theme.ModernNatTableThemeConfiguration;\r
9 import org.eclipse.nebula.widgets.nattable.tree.painter.IndentedTreeImagePainter;\r
10 import org.eclipse.nebula.widgets.nattable.tree.painter.TreeImagePainter;\r
11 import org.eclipse.nebula.widgets.nattable.ui.util.CellEdgeEnum;\r
12 import org.eclipse.nebula.widgets.nattable.util.GUIHelper;\r
13 \r
14 public class GENatTableThemeConfiguration extends ModernNatTableThemeConfiguration{\r
15         \r
16         public GENatTableThemeConfiguration(GETreeData treeData, int style) {\r
17                 super();\r
18                 this.oddRowBgColor = GUIHelper.getColor(250, 250, 250);\r
19                 this.defaultCellPainter =\r
20                                 new GEStyler(treeData,\r
21                         new GEIconPainter(\r
22                                 new PaddingDecorator(\r
23                                         new TextPainter(),\r
24                                         0,\r
25                                         5,\r
26                                         0,\r
27                                         5,\r
28                                         false)));\r
29                 \r
30                  TreeImagePainter treeImagePainter =\r
31                         new TreeImagePainter(\r
32                                 false,\r
33                                 GUIHelper.getImage("right"), //$NON-NLS-1$\r
34                                 GUIHelper.getImage("right_down"), //$NON-NLS-1$\r
35                                 GUIHelper.getImageByURL("transparent", \r
36                                                 FileLocator.find(Activator.getDefault().getBundle(), \r
37                                                 new Path("images/transparent.png"), null))); //$NON-NLS-1$\r
38                 this.treeStructurePainter =\r
39                         new BackgroundPainter(\r
40                                 new PaddingDecorator(\r
41                                         new IndentedTreeImagePainter(\r
42                                                 10,\r
43                                                 null,\r
44                                                 CellEdgeEnum.LEFT,\r
45                                                 treeImagePainter,\r
46                                                 false,\r
47                                                 2,\r
48                                                 true),\r
49                                         0,\r
50                                         5,\r
51                                         0,\r
52                                         5,\r
53                                         false));\r
54                 TreeImagePainter treeSelectionImagePainter =\r
55                         new TreeImagePainter(\r
56                                 false,\r
57                                 GUIHelper.getImage("right_inv"), //$NON-NLS-1$\r
58                                 GUIHelper.getImage("right_down_inv"), //$NON-NLS-1$\r
59                                 GUIHelper.getImageByURL("transparent", \r
60                                                 FileLocator.find(Activator.getDefault().getBundle(), \r
61                                                 new Path("images/transparent.png"), null))); //$NON-NLS-1$\r
62                 this.treeStructureSelectionPainter =\r
63                         new BackgroundPainter(\r
64                                 new PaddingDecorator(\r
65                                         new IndentedTreeImagePainter(\r
66                                                 10,\r
67                                                 null,\r
68                                                 CellEdgeEnum.LEFT,\r
69                                                 treeSelectionImagePainter,\r
70                                                 false,\r
71                                                 2,\r
72                                                 true),\r
73                                         0,\r
74                                         5,\r
75                                         0,\r
76                                         5,\r
77                                         false));\r
78         }\r
79 \r
80 }\r