Project

General

Profile

Download (3.15 KB) Statistics
| Branch: | Tag: | Revision:
1
// $Id$
2
/**
3
* Copyright (C) 2009 EDIT
4
* European Distributed Institute of Taxonomy 
5
* http://www.e-taxonomy.eu
6
* 
7
* The contents of this file are subject to the Mozilla Public License Version 1.1
8
* See LICENSE.TXT at the top of this package for the full license terms.
9
*/
10
package eu.etaxonomy.taxeditor.ui.element;
11

    
12
import org.eclipse.ui.forms.widgets.TableWrapData;
13
import org.eclipse.ui.forms.widgets.TableWrapLayout;
14

    
15
/**
16
 * @author n.hoffmann
17
 * @date Jan 25, 2012
18
 *
19
 */
20
public class LayoutConstants {
21

    
22
	/**
23
	 * <p>
24
	 * LAYOUT
25
	 * </p>
26
	 * 
27
	 * @return a {@link org.eclipse.ui.forms.widgets.TableWrapLayout} object.
28
	 */
29
	public static final TableWrapLayout LAYOUT() {
30
		return LayoutConstants.LAYOUT(1, false);
31
	}
32

    
33
	/**
34
	 * <p>
35
	 * LAYOUT
36
	 * </p>
37
	 * 
38
	 * @param columns
39
	 *            a int.
40
	 * @param equalWidth
41
	 *            a boolean.
42
	 * @return a {@link org.eclipse.ui.forms.widgets.TableWrapLayout} object.
43
	 */
44
	public static final TableWrapLayout LAYOUT(int columns, boolean equalWidth) {
45
		TableWrapLayout layout = new TableWrapLayout();
46
		layout.topMargin = 0;
47
		layout.rightMargin = 0;
48
		layout.bottomMargin = 0;
49
		layout.leftMargin = 0;
50
		layout.numColumns = columns;
51
		layout.makeColumnsEqualWidth = equalWidth;
52
		layout.verticalSpacing = 0;
53
		layout.horizontalSpacing = 0;
54
		return layout;
55
	}
56

    
57
	/**
58
	 * <p>
59
	 * FILL
60
	 * </p>
61
	 * 
62
	 * @return a {@link org.eclipse.ui.forms.widgets.TableWrapData} object.
63
	 */
64
	public static final TableWrapData FILL() {
65
		return LayoutConstants.FILL(1, 1);
66
	}
67

    
68
	/**
69
	 * <p>
70
	 * FILL
71
	 * </p>
72
	 * 
73
	 * @param horizontalSpan
74
	 *            a int.
75
	 * @param verticalSpan
76
	 *            a int.
77
	 * @return a {@link org.eclipse.ui.forms.widgets.TableWrapData} object.
78
	 */
79
	public static final TableWrapData FILL(int horizontalSpan, int verticalSpan) {
80
		TableWrapData layoutData = new TableWrapData(TableWrapData.FILL_GRAB,
81
				TableWrapData.FILL_GRAB);
82
		layoutData.colspan = horizontalSpan;
83
		layoutData.rowspan = verticalSpan;
84
		return layoutData;
85
	}
86

    
87
	/**
88
	 * <p>
89
	 * LEFT
90
	 * </p>
91
	 * 
92
	 * @return a {@link org.eclipse.ui.forms.widgets.TableWrapData} object.
93
	 */
94
	public static final TableWrapData LEFT() {
95
		return new TableWrapData(TableWrapData.LEFT, TableWrapData.TOP);
96
	}
97

    
98
	/**
99
	 * <p>
100
	 * RIGHT
101
	 * </p>
102
	 * 
103
	 * @return a {@link org.eclipse.ui.forms.widgets.TableWrapData} object.
104
	 */
105
	public static final TableWrapData RIGHT() {
106
		return new TableWrapData(TableWrapData.RIGHT, TableWrapData.TOP);
107
	}
108

    
109
	/**
110
	 * <p>
111
	 * FILL_HORIZONTALLY
112
	 * </p>
113
	 * 
114
	 * @return a {@link org.eclipse.ui.forms.widgets.TableWrapData} object.
115
	 */
116
	public static final TableWrapData FILL_HORIZONTALLY() {
117
		return LayoutConstants.FILL_HORIZONTALLY(1, 1);
118
	}
119

    
120
	/**
121
	 * <p>
122
	 * FILL_HORIZONTALLY
123
	 * </p>
124
	 * 
125
	 * @param horizontalSpan
126
	 *            a int.
127
	 * @param verticalSpan
128
	 *            a int.
129
	 * @return a {@link org.eclipse.ui.forms.widgets.TableWrapData} object.
130
	 */
131
	public static final TableWrapData FILL_HORIZONTALLY(int horizontalSpan,
132
			int verticalSpan) {
133
		TableWrapData layoutData = new TableWrapData(TableWrapData.FILL_GRAB,
134
				TableWrapData.TOP);
135
		layoutData.colspan = horizontalSpan;
136
		layoutData.rowspan = verticalSpan;
137
		return layoutData;
138
	}
139

    
140
}
(25-25/36)