]> gerrit.simantics Code Review - simantics/platform.git/blob
66dcb2844014dbce059e7f6f4291d61b2072621a
[simantics/platform.git] /
1 package org.simantics.views.swt.loader;
2
3 import org.simantics.db.Resource;
4 import org.simantics.db.exception.DatabaseException;
5 import org.simantics.db.layer0.variable.Variable;
6 import org.simantics.scenegraph.ParentNode;
7 import org.simantics.scenegraph.loader.ScenegraphLoader;
8 import org.simantics.views.swt.client.base.ISWTViewNode;
9 import org.simantics.views.swt.client.impl.SWTScrolledComposite;
10
11 public class ScrolledCompositeLoader implements ScenegraphLoader {
12
13         final private Resource configuration;
14         
15         public ScrolledCompositeLoader(Resource configuration) {
16                 this.configuration = configuration;
17         }
18         
19         @Override
20         public ISWTViewNode create(ParentNode<ISWTViewNode> parent, Variable context) throws DatabaseException {
21                 
22                 SWTScrolledComposite node = parent.addNode(SWTScrolledComposite.class);
23                 
24                 node.setLayoutData(LoaderUtils.getGridData(configuration));
25                 node.setLayout(LoaderUtils.getLayout(configuration));
26                 node.setStyle(LoaderUtils.getStyle(configuration));
27                 
28                 return node;
29
30         }
31
32 }