RE: Associating a command with a <choice> tag
Gerald Bauer <[email protected]> Wed, 24 Dec 2003 08:10:28 -0800 (PST)
| Newsgroups | gmane.comp.java.luxor-xul.user |
|---|---|
| Message-ID | <[email protected]> |
Hello Dale,
> I couldn't find the CompUtils class in the Salsa
> 1.0-b1 package.
CompUtils is upcoming in the next Salsa release.
For now just grab the code from the CVS repository at
http://cvs.sourceforge.net/viewcvs.py/ajax/salsa/src/salsa/util/
for example.
Here's the snippet:
public class CompUtils
{
static Logger T = Logger.getLogger( CompUtils.class
);
public static JComponent get( Container parent,
String id )
{
// find component; using breath first search
Component c[] = parent.getComponents();
if( c == null )
return null;
for( int i=0; i < c.length; i++ )
{
String name = c[i].getName();
if( name != null && name.equals( id ) )
return (JComponent) c[i];
}
for( int i=0; i < c.length; i++ )
if( c[i] instanceof Container )
{
JComponent found = get( (Container) c[i], id
);
if( found != null )
return found;
}
return null;
}
- Gerald
-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click