import org.eclipse.swt.events.VerifyEvent;
import org.eclipse.swt.events.VerifyListener;
import org.eclipse.swt.graphics.Resource;
+import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Table;
}
} while (!treeStack.isEmpty());
}
+
+ /**
+ * set grid layout data of Control.
+ * If values of heightHint, widthHint, horizontalSpan, verticalSpan is -1, this method does not change value of them.
+ *
+ * @param c target control to which grid layout data is set.
+ * @param heightHint height of the control
+ * @param widthHint width of the control
+ * @param horizontalSpan the number of column cells that control will take up.
+ * @param verticalSpan the number of row cells that control will take up.
+ * @param style style of the control
+ * @author Ho Namkoong {@literal <ho.namkoong@samsung.com>} (S-Core)
+ */
+ public static void setGridLayoutData(Control c, int heightHint, int widthHint, int horizontalSpan, int verticalSpan, int style) {
+ GridData gd = new GridData(style);
+ if(heightHint != -1) {
+ gd.heightHint = heightHint;
+ }
+ if(widthHint != -1) {
+ gd.widthHint = widthHint;
+ }
+ if(horizontalSpan != -1) {
+ gd.horizontalSpan = horizontalSpan;
+ }
+ if(verticalSpan != -1) {
+ gd.verticalSpan = verticalSpan;
+ }
+ c.setLayoutData(gd);
+ }
}