|
||||
General Documentation
|
Miscellaneous ItemsThere are a few conveniences that have been added to the XmlPanel to make development a little easier. This section describes some of these "shortcuts" that have been added. Getting Components By Name
Every Consider the following XML that creates a panel with a single button in it. Notice that the name can be set in the XML, since it is just a simple setter method on the object:
This code can be used to setup the panel and all is fine. That is, until the developer needs to get at the button to programmatically do something with it. For example, there may come a point in the application where the button should be set as disabled. How can a handle to the button object currently in the panel be retrieved?
To help with these scenarios, the XmlPanel has a
While this example is simplistic, the concept becomes useful with larger and deeply nested panels. Components will be found in the root panel and any subpanel inside of it. ActionListener Panel
XmlPanel extends
This allows action listeners to be installed directly on the panel, and then are not needed on the
buttons themselves. This allows a central working place for actions that can handle all of the buttons
on the panel. See the
|
|||
Copyright (c) 2006, Abstractics, L.L.C. |