comparison org.eclipse.jface/src/org/eclipse/jface/viewers/ColumnPixelData.d @ 12:bc29606a740c

Added dwt-addons in original directory structure of eclipse.org
author Frank Benoit <benoit@tionex.de>
date Sat, 14 Mar 2009 18:23:29 +0100
parents
children
comparison
equal deleted inserted replaced
11:43904fec5dca 12:bc29606a740c
1 /*******************************************************************************
2 * Copyright (c) 2000, 2008 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * IBM Corporation - initial API and implementation
10 * Port to the D programming language:
11 * Frank Benoit <benoit@tionex.de>
12 *******************************************************************************/
13 module org.eclipse.jface.viewers.ColumnPixelData;
14
15 import java.lang.all;
16
17 import org.eclipse.jface.viewers.ColumnLayoutData;
18
19 import org.eclipse.core.runtime.Assert;
20
21 /**
22 * Describes the width of a table column in pixels, and
23 * whether the column is resizable.
24 * <p>
25 * This class may be instantiated; it is not intended to be subclassed.
26 * </p>
27 * @noextend This class is not intended to be subclassed by clients.
28 */
29 public class ColumnPixelData : ColumnLayoutData {
30
31 /**
32 * The column's width in pixels.
33 */
34 public int width;
35
36 /**
37 * Whether to allocate extra width to the column to account for
38 * trim taken by the column itself.
39 * The default is <code>false</code> for backwards compatibility, but
40 * the recommended practice is to specify <code>true</code>, and
41 * specify the desired width for the content of the column, rather
42 * than adding a fudge factor to the specified width.
43 *
44 * @since 3.1
45 */
46 public bool addTrim = false;
47
48 /**
49 * Creates a resizable column width of the given number of pixels.
50 *
51 * @param widthInPixels the width of column in pixels
52 */
53 public this(int widthInPixels) {
54 this(widthInPixels, true, false);
55 }
56
57 /**
58 * Creates a column width of the given number of pixels.
59 *
60 * @param widthInPixels the width of column in pixels
61 * @param resizable <code>true</code> if the column is resizable,
62 * and <code>false</code> if size of the column is fixed
63 */
64 public this(int widthInPixels, bool resizable) {
65 this(widthInPixels, resizable, false);
66 }
67
68 /**
69 * Creates a column width of the given number of pixels.
70 *
71 * @param widthInPixels
72 * the width of column in pixels
73 * @param resizable
74 * <code>true</code> if the column is resizable, and
75 * <code>false</code> if size of the column is fixed
76 * @param addTrim
77 * <code>true</code> to allocate extra width to the column to
78 * account for trim taken by the column itself,
79 * <code>false</code> to use the given width exactly
80 * @since 3.1
81 */
82 public this(int widthInPixels, bool resizable, bool addTrim) {
83 super(resizable);
84 Assert.isTrue(widthInPixels >= 0);
85 this.width = widthInPixels;
86 this.addTrim = addTrim;
87 }
88 }