public class WidgetBrowserAspect
extends java.lang.Object
To activate the Widget Browser feature the Java property "widgetbrowser" must be defined,
for example using the -D option for the Java application launcher.
The class displays the Widget Browser main window for each drawn Window
.
Modifier and Type | Field and Description |
---|---|
private java.util.Map<TopLevelWindow<?>,WidgetBrowser> |
activeBrowsers
Map of active Widget Browsers.
|
Constructor and Description |
---|
WidgetBrowserAspect() |
Modifier and Type | Method and Description |
---|---|
private void |
handleHighlightWidget(Widget<?> widget)
Highlights the supplied widget when a related active Widget Browser exists,
the widget is visible and it is selected to be highlighted in the Widget Browser.
|
private void |
handleStartWidgetBrowser(TopLevelWindow<?> window)
The method creates and shows new Widget Browser main window.
|
private void |
highlightWidget(Widget<?> widget)
Highlights the supplied widget when the widget is visible.
|
void |
onWidgetDrawn(Widget widget)
This method is called on every
Widget.draw() method and serves as the main
integration entry-point into the widget drawing facility. |
private java.util.Map<TopLevelWindow<?>,WidgetBrowser> activeBrowsers
public void onWidgetDrawn(Widget widget)
Widget.draw()
method and serves as the main
integration entry-point into the widget drawing facility.
For production-quality code, this class can be omitted from AdpectJ compilation to remove the Widget Browser overhead.
Note that the advice is intentionally defined with "call" join point. The reason is
for this is so that the function is called only once for the whole Widget.draw()
hierarchy and not for every override.
widget
- The target on which the Widget.draw()
method is called.private void handleStartWidgetBrowser(TopLevelWindow<?> window)
window
- The TopLevelWindow
instance for which new Widget Browser is being started.private void handleHighlightWidget(Widget<?> widget)
widget
- The widget to be highlighted.private void highlightWidget(Widget<?> widget)
widget
- The widget to be highlighted.