GUI Commands User GuideVersion 2.1 |
||
DebuggingDebuging GroupsGUI Commands provides a debug mode that makes it easy to identify group members that
haven't been resolved by the group. To activate the debug mode simply set the
the system property
# Setting the debug property from the command line
-Dcom.pietschy.command.debugGroups=true
The following shows the debug example from the online demo. Missing commands are displayed in red for easy identification. Activating Debug Mode ProgramaticallyIt is also possible to manually achieve the same result without setting the sytem property.
To do this you need to configure the
// create install the debug version of the group member factory
GroupMemberFactory factory = new DebugGroupMemberFactory();
GuiCommands.defaults().setGroupMemberFactory(factory);
The factory must be configured before any groups are created. Debugging CommandContainersThe CommandContainer container = ...; container.debugState(System.out); The following is an example of the output generated from the debug example in the online demo.
CommandContainer@13627328(binding=DebugDemo@1828223)
actionCommands[save, debug-container-state]
delegates[]
groups[debug.menu]
properties[]
parent---
CommandContainer@11374012(binding=DemoFrame@2254042)
actionCommands[paste-from-clipboard, command-four,
SwingWorkerDemo.selector, UndoDemo.selector,
command-three, exit, show-config, command-two,
DebugDemo.selector, FaceDemo.selector, command-one,
cut-to-clipboard, redo, print, ToggleDemo.selector,
DelegateDemo.selector, undo, WelcomePanel.selector,
copy-to-clipboard, GroupDemo.selector]
delegates[]
groups[help-menu, view-menu, main-menu, download-menu,
demo-selector-group, edit-menu, file-menu, main-toolbar]
properties[glassPaneStrategy, delegateMediator, undoContext]
parent---
GlobalCommandContainer@3430385(binding=null)
actionCommands[view-license, new-window, buy-now, download-library,
help-about]
delegates[]
groups[]
properties[]
|
||