private void setFont(Composite composite, Font font) {
   for (Control control : composite.getChildren()) {
     if (control instanceof Composite) {
       setFont((Composite) control, font);
     } else {
       control.setFont(font);
       control.setSize(control.computeSize(SWT.DEFAULT, SWT.DEFAULT));
     }
   }
 }
예제 #2
0
 protected void setSize(Control control, Object size) {
   Point point = null;
   if (size != null) {
     if (size instanceof Point) {
       point = (Point) size;
     } else if (size instanceof List) {
       point = PointConverter.getInstance().parse((List<?>) size);
     }
     control.setSize(point);
   }
 }
 public static void resize(Control ctrl) {
   Point ns = ctrl.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
   Point cs = ctrl.getSize();
   if (!cs.equals(ns)) ctrl.setSize(ns);
 }