1 /*******************************************************************************
2 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
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
10 * VTT Technical Research Centre of Finland - initial API and implementation
11 *******************************************************************************/
15 package org.simantics.utils.ui;
17 import org.eclipse.swt.layout.GridData;
18 import org.eclipse.swt.layout.GridLayout;
23 * @author Toni Kalajainen
25 public class LayoutUtils {
27 public static GridLayout createNoBorderGridLayout(int numColumns) {
28 return createNoBorderGridLayout(numColumns, true);
31 public static GridLayout createNoBorderGridLayout(int numColumns, boolean makeColumnsEqualWidth) {
32 GridLayout gl = new GridLayout(numColumns, makeColumnsEqualWidth);
39 gl.horizontalSpacing = 0;
40 gl.verticalSpacing = 0;
45 public static GridData createNoBorderGridData() {
46 return new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL
47 | GridData.GRAB_VERTICAL);
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;