]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.utils.ui/src/org/simantics/utils/ui/LayoutUtils.java
Limit the amount of file names shown in the text widget.
[simantics/platform.git] / bundles / org.simantics.utils.ui / src / org / simantics / utils / ui / LayoutUtils.java
1 /*******************************************************************************
2  * Copyright (c) 2007, 2010 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 /*
13  * 4.7.2006
14  */
15 package org.simantics.utils.ui;
16
17 import org.eclipse.swt.layout.GridData;
18 import org.eclipse.swt.layout.GridLayout;
19
20 /**
21  * LayoutUtils
22  * 
23  * @author Toni Kalajainen
24  */
25 public class LayoutUtils {
26
27     public static GridLayout createNoBorderGridLayout(int numColumns) {
28         return createNoBorderGridLayout(numColumns, true);
29     }
30
31     public static GridLayout createNoBorderGridLayout(int numColumns, boolean makeColumnsEqualWidth) {
32         GridLayout gl = new GridLayout(numColumns, makeColumnsEqualWidth);
33         gl.marginBottom = 0;
34         gl.marginLeft = 0;
35         gl.marginTop = 0;
36         gl.marginRight = 0;
37         gl.marginHeight = 0;
38         gl.marginTop = 0;
39         gl.horizontalSpacing = 0;
40         gl.verticalSpacing = 0;
41         gl.marginWidth = 0;
42         return gl;
43     }
44
45     public static GridData createNoBorderGridData() {
46         return new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL
47                 | GridData.GRAB_VERTICAL);
48     }
49
50     public static GridData createNoBorderGridData(int numColumns) {
51         GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL
52                 | GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL);
53         gd.horizontalSpan = numColumns;
54         return gd;
55     }
56
57 }