Class SwtDebug


  • public class SwtDebug
    extends java.lang.Object
    Helpful utilities for debugging SWT.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  SwtDebug.ObjectIsNull
      Sentinel class for null objects.
    • Constructor Summary

      Constructors 
      Constructor Description
      SwtDebug()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static ImmutableMap<java.lang.Integer,​java.lang.String> allEvents()
      Returns a map from the SWT event code to its name, for all SWT events.
      static void dumpEvent​(java.lang.String name, DropTargetEvent e)
      Dumps the given SWT event to System.out.
      static void dumpEvent​(java.lang.String name, DropTargetEvent e, StringPrinter to)
      Dumps the given SWT event to the given StringPrinter.
      static void dumpEvent​(java.lang.String name, Event e)
      Dumps the given SWT event to System.out.
      static void dumpEvent​(java.lang.String name, Event e, StringPrinter to)
      Dumps the given SWT event to the given StringPrinter.
      static void dumpEvents​(java.lang.String name, Widget widget)
      Dumps all events from the given widget to System.out.
      static void dumpEvents​(java.lang.String name, Widget widget, StringPrinter to)
      Dumps all events from the given widget to the given StringPrinter.
      static void dumpEvents​(java.lang.String name, Widget widget, StringPrinter to, java.lang.Integer... toSubscribe)
      Dumps the given events on the widget to the given StringPrinter.
      static void dumpEvents​(java.lang.String name, Widget widget, StringPrinter to, java.util.Collection<java.lang.Integer> toSubscribe)
      Dumps the given events on the widget to the given StringPrinter.
      static void dumpEvents​(java.lang.String name, Widget widget, StringPrinter to, java.util.stream.Stream<java.lang.Integer> events)
      Dumps the given events on the widget to the given StringPrinter.
      static DropTargetListener dumpEventsDropListener()
      A DropTargetListener which dumps events.
      static java.lang.String eventType​(int type)
      Returns the name for the given SWT `eventType`.
      static java.lang.String eventType​(Event event)
      Returns the name for the given SWT `event`.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SwtDebug

        public SwtDebug()
    • Method Detail

      • dumpEvent

        public static void dumpEvent​(java.lang.String name,
                                     @Nullable
                                     DropTargetEvent e)
        Dumps the given SWT event to System.out.
      • dumpEvent

        public static void dumpEvent​(java.lang.String name,
                                     @Nullable
                                     DropTargetEvent e,
                                     StringPrinter to)
        Dumps the given SWT event to the given StringPrinter.
      • dumpEventsDropListener

        public static DropTargetListener dumpEventsDropListener()
        A DropTargetListener which dumps events.
      • dumpEvent

        public static void dumpEvent​(java.lang.String name,
                                     @Nullable
                                     Event e)
        Dumps the given SWT event to System.out.
      • dumpEvent

        public static void dumpEvent​(java.lang.String name,
                                     @Nullable
                                     Event e,
                                     StringPrinter to)
        Dumps the given SWT event to the given StringPrinter.
      • dumpEvents

        public static void dumpEvents​(java.lang.String name,
                                      Widget widget)
        Dumps all events from the given widget to System.out.
      • dumpEvents

        public static void dumpEvents​(java.lang.String name,
                                      Widget widget,
                                      StringPrinter to)
        Dumps all events from the given widget to the given StringPrinter.
      • dumpEvents

        public static void dumpEvents​(java.lang.String name,
                                      Widget widget,
                                      StringPrinter to,
                                      java.lang.Integer... toSubscribe)
        Dumps the given events on the widget to the given StringPrinter.
      • dumpEvents

        public static void dumpEvents​(java.lang.String name,
                                      Widget widget,
                                      StringPrinter to,
                                      java.util.Collection<java.lang.Integer> toSubscribe)
        Dumps the given events on the widget to the given StringPrinter.
      • dumpEvents

        public static void dumpEvents​(java.lang.String name,
                                      Widget widget,
                                      StringPrinter to,
                                      java.util.stream.Stream<java.lang.Integer> events)
        Dumps the given events on the widget to the given StringPrinter.
      • eventType

        public static java.lang.String eventType​(Event event)
        Returns the name for the given SWT `event`.
      • eventType

        public static java.lang.String eventType​(int type)
        Returns the name for the given SWT `eventType`.
      • allEvents

        public static ImmutableMap<java.lang.Integer,​java.lang.String> allEvents()
        Returns a map from the SWT event code to its name, for all SWT events.