1 11 package org.eclipse.ui.forms.widgets; 12 13 import org.eclipse.swt.SWT; 14 import org.eclipse.swt.graphics.Point; 15 16 25 public final class TableWrapData { 26 29 public static final int LEFT = 1 << 1; 30 31 34 public static final int CENTER = 1 << 2; 35 36 39 public static final int RIGHT = 1 << 3; 40 41 44 public static final int TOP = 1 << 4; 45 46 49 public static final int MIDDLE = 1 << 5; 50 51 54 public static final int BOTTOM = 1 << 6; 55 56 59 public static final int FILL = 1 << 7; 60 61 67 public static final int FILL_GRAB = 1 << 8; 68 69 72 public int colspan = 1; 73 74 77 public int rowspan = 1; 78 79 82 public int align = LEFT; 83 84 87 public int valign = TOP; 88 89 92 public int indent = 0; 93 94 97 public int maxWidth = SWT.DEFAULT; 98 99 102 public int maxHeight = SWT.DEFAULT; 103 104 107 public int heightHint = SWT.DEFAULT; 108 109 113 public boolean grabHorizontal; 114 115 121 public boolean grabVertical; 122 123 int childIndex; 124 125 boolean isItemData = true; 126 127 int compWidth; 128 129 Point compSize; 130 131 134 public TableWrapData() { 135 } 136 137 144 public TableWrapData(int align) { 145 this(align, TOP, 1, 1); 146 } 147 148 156 public TableWrapData(int align, int valign) { 157 this(align, valign, 1, 1); 158 } 159 160 173 public TableWrapData(int align, int valign, int rowspan, int colspan) { 174 if (align != LEFT && align != CENTER && align != RIGHT && align != FILL 175 && align != FILL_GRAB) 176 SWT.error(SWT.ERROR_INVALID_ARGUMENT, null, "align"); if (valign != TOP && valign != MIDDLE && valign != BOTTOM 178 && valign != FILL && valign != FILL_GRAB) 179 SWT.error(SWT.ERROR_INVALID_ARGUMENT, null, "valign"); if (rowspan < 1) 181 SWT.error(SWT.ERROR_INVALID_ARGUMENT, null, "rowspan"); if (colspan < 1) 183 SWT.error(SWT.ERROR_INVALID_ARGUMENT, null, "colspan"); if (align == FILL_GRAB) { 185 this.align = FILL; 186 grabHorizontal = true; 187 } else 188 this.align = align; 189 if (valign == FILL_GRAB) { 190 this.valign = FILL; 191 grabVertical = true; 192 } else 193 this.valign = valign; 194 this.rowspan = rowspan; 195 this.colspan = colspan; 196 } 197 } 198 | Popular Tags |