View Javadoc
1 /*** 2 * $Header: /cvsroot/ebxmlrr/jaxr/src/com/sun/xml/registry/client/browser/JBListModel.java,v 1.1 2002/10/31 01:54:04 farrukh_najmi Exp $ 3 */ 4 package com.sun.xml.registry.client.browser; 5 6 import java.util.*; 7 import javax.xml.registry.*; 8 import javax.xml.registry.infomodel.*; 9 10 import java.awt.*; 11 import java.awt.event.*; 12 import javax.swing.*; 13 import javax.swing.event.*; 14 15 /*** 16 * Base class for all xxListModel classes 17 * 18 * @author <a href="mailto:Farrukh.Najmi@Sun.COM">Farrukh S. Najmi</a> 19 */ 20 public class JBListModel extends DefaultListModel { 21 22 /*** 23 * Constructor 24 */ 25 public JBListModel() { 26 super(); 27 } 28 29 public ArrayList getModels() throws JAXRException { 30 ArrayList models = new ArrayList(); 31 32 Object[] objs = toArray(); 33 for (int i=0; i<objs.length; i++) { 34 models.add(objs[i]); 35 } 36 37 return models; 38 } 39 40 public void setModels(ArrayList models) throws JAXRException { 41 clear(); 42 43 if (models != null) { 44 Iterator iter = models.iterator(); 45 while (iter.hasNext()) { 46 addElement(iter.next()); 47 } 48 } 49 50 fireContentsChanged(this, 0, size()); 51 } 52 53 }

This page was automatically generated by Maven