public static void recursiveMouseTrackListener(
     Control c, MouseTrackListener listener, boolean includeListened) {
   if (includeListened
       || (c.getListeners(SWT.MouseEnter).length == 0
           || c.getListeners(SWT.MouseExit).length == 0
           || c.getListeners(SWT.MouseHover).length == 0)) c.addMouseTrackListener(listener);
   if (c instanceof Composite)
     for (Control child : ((Composite) c).getChildren())
       recursiveMouseTrackListener(child, listener, includeListened);
 }
 public static void recursiveMouseListener(
     Control c, MouseListener listener, boolean includeListened) {
   if (includeListened
       || (!(c instanceof Hyperlink)
           && (c.getListeners(SWT.MouseUp).length == 0
               || c.getListeners(SWT.MouseDown).length == 0
               || c.getListeners(SWT.MouseDoubleClick).length == 0))) c.addMouseListener(listener);
   if (c instanceof Composite)
     for (Control child : ((Composite) c).getChildren())
       recursiveMouseListener(child, listener, includeListened);
 }
Beispiel #3
0
 public void forceControlEvent(Control ctrl) {
   for (Listener lst : ctrl.getListeners(SWT.Resize)) {
     if (lst instanceof ControlListener) {
       ControlListener clst = (ControlListener) lst;
       clst.controlResized(null);
     }
   }
 }