Top Description Inners Fields Constructors Methods
org.eclipse.swt.internal

public Class WidgetSpy

extends Object
Class Inheritance
Imports
java.util.*, .List, org.eclipse.swt.widgets.*

Helper class to allow widget creation and disposal monitoring

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
WidgetSpy.NonDisposedWidgetTracker

Default implementation simply collects all created and not disposed widgets

public static interface
WidgetSpy.WidgetTracker

Custom callback to register widget creation / disposal

Field Summary

Modifier and TypeField and Description
private static final WidgetSpy
public static boolean
isEnabled

Flag to prevent Widget from entering this class during debugging, if tracking of creation and disposal is not enabled.

private WidgetSpy.WidgetTracker

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static WidgetSpy
public void
setWidgetTracker(WidgetSpy.WidgetTracker
notified when a widget is created or disposed. Use null to disable tracking. The tracker will be notified of widgets created and disposed after setting the tracker.
tracker
)

Enables tracking of Widget object creation and disposal.

public void
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

instanceback to summary
private static final WidgetSpy instance
isEnabledback to summary
public static boolean isEnabled

Flag to prevent Widget from entering this class during debugging, if tracking of creation and disposal is not enabled.

widgetTrackerback to summary
private WidgetSpy.WidgetTracker widgetTracker

Constructor Detail

WidgetSpyback to summary
private WidgetSpy()

Method Detail

getInstanceback to summary
public static WidgetSpy getInstance()
setWidgetTrackerback to summary
public void setWidgetTracker(WidgetSpy.WidgetTracker tracker)

Enables tracking of Widget object creation and disposal.

Warning

the tracker will be called from the UI thread. Do not block it and do not throw any exceptions.

Parameters
tracker:WidgetSpy.WidgetTracker

notified when a widget is created or disposed. Use null to disable tracking. The tracker will be notified of widgets created and disposed after setting the tracker.

widgetCreatedback to summary
public void widgetCreated(Widget widget)
widgetDisposedback to summary
public void widgetDisposed(Widget widget)
org.eclipse.swt.internal back to summary

public Class WidgetSpy.NonDisposedWidgetTracker

extends Object
implements WidgetTracker
Class Inheritance
All Implemented Interfaces
org.eclipse.swt.internal.WidgetSpy.WidgetTracker

Default implementation simply collects all created and not disposed widgets

Field Summary

Modifier and TypeField and Description
private final Map<Widget, Error>
private final Set<Class<? extends Widget>>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
public Map<Widget, Error>
private boolean
isTracked(Widget widget)

public void
setTrackedTypes(List<Class<? extends Widget>> types)

public void
setTrackingEnabled(boolean enabled)

public void
public void
public void
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

nonDisposedWidgetsback to summary
private final Map<Widget, Error> nonDisposedWidgets
trackedTypesback to summary
private final Set<Class<? extends Widget>> trackedTypes

Constructor Detail

NonDisposedWidgetTrackerback to summary
public NonDisposedWidgetTracker()

Method Detail

clearNonDisposedWidgetsback to summary
private void clearNonDisposedWidgets()
getNonDisposedWidgetsback to summary
public Map<Widget, Error> getNonDisposedWidgets()
isTrackedback to summary
private boolean isTracked(Widget widget)
setTrackedTypesback to summary
public void setTrackedTypes(List<Class<? extends Widget>> types)
setTrackingEnabledback to summary
public void setTrackingEnabled(boolean enabled)
startTrackingback to summary
public void startTracking()
stopTrackingback to summary
public void stopTracking()
widgetCreatedback to summary
public void widgetCreated(Widget widget)

Overrides default org.eclipse.swt.internal.WidgetSpy.WidgetTracker.widgetCreated.

Annotations
@Override
widgetDisposedback to summary
public void widgetDisposed(Widget widget)

Overrides default org.eclipse.swt.internal.WidgetSpy.WidgetTracker.widgetDisposed.

Annotations
@Override
org.eclipse.swt.internal back to summary

public Interface WidgetSpy.WidgetTracker

Known Direct Implementers
org.eclipse.swt.internal.WidgetSpy.NonDisposedWidgetTracker

Custom callback to register widget creation / disposal

Method Summary

Modifier and TypeMethod and Description
public default void
public default void

Method Detail

widgetCreatedback to summary
public default void widgetCreated(Widget widget)
widgetDisposedback to summary
public default void widgetDisposed(Widget widget)