FileDocCategorySizeDatePackage
BooleanStringItemListener.javaAPI DocGlassfish v2 API3508Fri May 04 22:34:38 BST 2007com.sun.enterprise.tools.common

BooleanStringItemListener

public class BooleanStringItemListener extends Object implements ItemListener
author
vkraemer
version

Fields Summary
Object
target
Method
writer
private Object[]
args
private static final String[]
FALSE
private static final String[]
TRUE
Constructors Summary
public BooleanStringItemListener(Object target, String destName)
Creates new BooleanStringItemListener

    

        
            
        this.target = target;
        writer = PropertyUtils.getWriter(target,destName);
    
public BooleanStringItemListener(Object target)

        this.target = target;
    
Methods Summary
public voiditemStateChanged(java.awt.event.ItemEvent itemEvent)

//NOI18N
    
        
        try {
            java.lang.reflect.Method lwriter = writer;
            if (null == lwriter) {
                java.awt.Component src = (java.awt.Component) itemEvent.getSource();
                lwriter = PropertyUtils.getWriter(target, src.getName());
            }
            Object args[] = FALSE;
            if (itemEvent.getStateChange() == java.awt.event.ItemEvent.SELECTED)
                args = TRUE;
            lwriter.invoke(target, args);
        }
        catch (Throwable t) {
            Reporter.critical(t); //NOI18N
        }