de.matthiasmann.twl
Class DebugHook

java.lang.Object
  extended by de.matthiasmann.twl.DebugHook

public class DebugHook
extends java.lang.Object

The debug hook class can be used to retrieve more detailed information about missing themes or parameters.


Constructor Summary
DebugHook()
           
 
Method Summary
 void afterApplyTheme(Widget widget)
           
 void beforeApplyTheme(Widget widget)
           
static DebugHook getDebugHook()
          Returns the currently active debug hook for this thread.
 void guiLayoutValidated(int iterations, java.util.Collection<Widget> loop)
          Called when GUI has validated the layout tree
static DebugHook installHook(DebugHook hook)
          Installs a new debug hook.
 void missingChildTheme(ThemeInfo parent, java.lang.String theme)
           
 void missingImage(java.lang.String name)
           
 void missingParameter(ParameterMap map, java.lang.String paramName, java.lang.String parentDescription, java.lang.Class<?> dataType)
           
 void missingTheme(java.lang.String themePath)
           
 void replacingWithDifferentType(ParameterMap map, java.lang.String paramName, java.lang.Class<?> oldType, java.lang.Class<?> newType, java.lang.String parentDescription)
           
 void usingFallbackTheme(java.lang.String themePath)
          Called when wildcard resolution failed to find a theme and the fallback theme was specified
 void wrongParameterType(ParameterList map, int idx, java.lang.Class<?> expectedType, java.lang.Class<?> foundType, java.lang.String parentDescription)
           
 void wrongParameterType(ParameterMap map, java.lang.String paramName, java.lang.Class<?> expectedType, java.lang.Class<?> foundType, java.lang.String parentDescription)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DebugHook

public DebugHook()
Method Detail

getDebugHook

public static DebugHook getDebugHook()
Returns the currently active debug hook for this thread.

Returns:
the debug hook. Never null.

installHook

public static DebugHook installHook(DebugHook hook)
Installs a new debug hook.

Parameters:
hook - the new debug hook
Returns:
the previous debug hook
Throws:
java.lang.NullPointerException - if hook is null

beforeApplyTheme

public void beforeApplyTheme(Widget widget)

afterApplyTheme

public void afterApplyTheme(Widget widget)

missingTheme

public void missingTheme(java.lang.String themePath)

missingChildTheme

public void missingChildTheme(ThemeInfo parent,
                              java.lang.String theme)

missingParameter

public void missingParameter(ParameterMap map,
                             java.lang.String paramName,
                             java.lang.String parentDescription,
                             java.lang.Class<?> dataType)

wrongParameterType

public void wrongParameterType(ParameterMap map,
                               java.lang.String paramName,
                               java.lang.Class<?> expectedType,
                               java.lang.Class<?> foundType,
                               java.lang.String parentDescription)

wrongParameterType

public void wrongParameterType(ParameterList map,
                               int idx,
                               java.lang.Class<?> expectedType,
                               java.lang.Class<?> foundType,
                               java.lang.String parentDescription)

replacingWithDifferentType

public void replacingWithDifferentType(ParameterMap map,
                                       java.lang.String paramName,
                                       java.lang.Class<?> oldType,
                                       java.lang.Class<?> newType,
                                       java.lang.String parentDescription)

missingImage

public void missingImage(java.lang.String name)

guiLayoutValidated

public void guiLayoutValidated(int iterations,
                               java.util.Collection<Widget> loop)
Called when GUI has validated the layout tree

Parameters:
iterations - the number of iterations required to solve layout
loop - the widgets involved in a layout loop if the layout could not be solved - is null if layout was solved

usingFallbackTheme

public void usingFallbackTheme(java.lang.String themePath)
Called when wildcard resolution failed to find a theme and the fallback theme was specified

Parameters:
themePath - the requested theme name