Programming Tutorials Browser Tutorials Articles Struts Tutorials Hibernate Tutorials

  Tutorial: GUI-Commands

Commands are decoupled from Swing in that they implement a standard public void execute() that can be called without the need of an ActionEvent. This facilitates the use of commands in macros and scripts. The CommandListener interface allows interested

Tutorial Details:

Standard faces are provided for button, menu, toolbar and html. Other faces can be defined at will.
All buttons/menus etc are produced using Factories allowing the easy use of custom button implementations.
CommandGroups allow the creation of menu items, popup menus, toolbars, toggle buttons (with drop down menus) consisting of other commands (and/or groups).
Groups can add other groups either as sub menus, or as \'inline\' members. Inline members are added at the current group level and not as a sub menu.
Groups can be programatically modified at runtime with all buttons/menus being updated appropriately. Any changes made to the group can reset back to the default. This is useful for having dynamic menus build on top of a standard base menu.
It is possible to specify the \"expansion point\" for groups. Any new groups members added at runtime will be added at the position of the expansion point.
The expansion point intelligently includes separators as required.
Toggle commands and toggle groups are implemented.
Toggle commands produce JCheckboxMenuItems when used alone and JRadioButtonMenuItems when part of an exclusive group.
Toggle commands can veto a selection/deselection request when standalone or part of an exclusive group.
A hint mechanism is provided to allow \"once off\" parameters to be passed to a command on execution. All hints are automatically cleared after execution.
Commands are highly customizable and can control any aspect of the buttons it produces (for example commands have a visible property, setting it to false hides all buttons that the command creates).
Command loading is a callback scheme with a default implementation, subclasses can override to implement custom features.
A simple CommandHyperlinkListener allows commands to be embeded in HTML (JEditorPane) and executed when clicked. The listener provides static method for producing the URL and allows for hints to be specified.
Features new to the 1.1 release:

Faces can now extend another face. Eg
Faces can be defined in a global section and shared by multiple commands.
Made it easy to create commands and faces programatically.
Improved the internal design and made it easier to create custom implementations of GroupCommands and ExclusiveGroupCommands.
Added support for Undo/Redo.


 

Read Tutorial at: Click here to view the tutorial

Rate Tutorial:
GUI-Commands

View Tutorial:
GUI-Commands

Related Tutorials:

Site navigation
 

 

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2006. All rights reserved.