public class ListSelectionListenerSetter implements Setter, DocletActionReporter
{
public void setAttribute (String ns, String tag, String attrNS, String attr, Object obj, Object value, DecodeEngine decodeEngine) throws SetterException
{
if (value == null || (!(obj instanceof JTable) && !(obj instanceof JList)))
throw new SetterException (decodeEngine, null, this, ns, tag, attrNS, attr, obj, value);
try
{
ListSelectionListener listener = null;
if (value instanceof ListSelectionListener)
listener = (ListSelectionListener)value;
else if (value instanceof String)
{
Object o = decodeEngine.getVariable ((String)value);
if (o instanceof ListSelectionListener)
listener = (ListSelectionListener)o;
}
if (listener != null)
{
ListSelectionModel selectionModel = null;
if (obj instanceof JTable)
selectionModel = ((JTable)obj).getSelectionModel ();
if (selectionModel != null)
{
selectionModel.addListSelectionListener (listener);
return;
}
}
}
catch (Exception ex)
{
throw new SetterException (decodeEngine, ex, this, ns, tag, attrNS, attr, obj, value);
}
throw new SetterException (decodeEngine, null, this, ns, tag, attrNS, attr, obj, value);
}