]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/widgets/Composite.java
Merge "Font property for DIA.TextElement"
[simantics/platform.git] / bundles / org.simantics.browsing.ui.swt / src / org / simantics / browsing / ui / swt / widgets / Composite.java
1 /*******************************************************************************
2  * Copyright (c) 2007, 2012 Association for Decentralized Information Management
3  * in Industry THTH ry.
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution, and is available at
7  * http://www.eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  *     VTT Technical Research Centre of Finland - initial API and implementation
11  *******************************************************************************/
12 package org.simantics.browsing.ui.swt.widgets;
13
14 import java.util.concurrent.atomic.AtomicBoolean;
15
16 import org.eclipse.swt.widgets.Control;
17 import org.eclipse.swt.widgets.Layout;
18 import org.simantics.browsing.ui.swt.widgets.impl.WidgetSupport;
19 import org.simantics.db.management.ISessionContext;
20
21 public class Composite extends WidgetImpl {
22
23     final private org.eclipse.swt.widgets.Composite composite;
24
25     public Composite(org.eclipse.swt.widgets.Composite parent, WidgetSupport support, int style) {
26         super(support);
27         composite = new org.eclipse.swt.widgets.Composite(parent, style);
28         support.register(this);
29     }
30
31     public org.eclipse.swt.widgets.Composite getWidget() {
32         return composite;
33     }
34
35     @Override
36     public Control getControl() {
37         return composite;
38     }
39
40     private AtomicBoolean inputDisposed;
41
42     @Override
43     public void setInput(ISessionContext context, Object input) {
44
45         if (this.inputDisposed != null)
46             this.inputDisposed.set(true);
47         
48     }
49
50         public void setLayout(Layout layout) {
51                 composite.setLayout(layout);
52         }
53     
54 }