Project

General

Profile

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

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

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

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

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

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

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

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

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

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

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

    
139
}
(28-28/47)