package com.vci.client.ui.swing.components;
|
|
import java.util.Vector;
|
|
import javax.swing.AbstractListModel;
|
import javax.swing.JList;
|
import javax.swing.ListModel;
|
|
import com.vci.client.ui.swing.VCISwingUtil;
|
|
/**
|
*
|
* <p>Title: </p>
|
* <p>Description: </p>
|
* <p>Copyright: Copyright (c) 2012</p>
|
* <p>Company: VCI</p>
|
* @author xchao
|
* @time 2012-5-10
|
* @version 1.0
|
*/
|
public class VCIJList extends JList {
|
|
/**
|
*
|
*/
|
private static final long serialVersionUID = 7316859233487775153L;
|
|
@SuppressWarnings("serial")
|
public VCIJList() {
|
this (new AbstractListModel() {
|
public int getSize() { return 0; }
|
public Object getElementAt(int i) { return "No Data Model"; }
|
});
|
}
|
|
@SuppressWarnings("serial")
|
public VCIJList(final Object[] listData) {
|
this (new AbstractListModel() {
|
public int getSize() { return listData.length; }
|
public Object getElementAt(int i) { return listData[i]; }
|
});
|
}
|
|
@SuppressWarnings("serial")
|
public VCIJList(final Vector<?> listData) {
|
this (new AbstractListModel() {
|
public int getSize() { return listData.size(); }
|
public Object getElementAt(int i) { return listData.get(i); }
|
});
|
}
|
|
public VCIJList(ListModel dataModel) {
|
super(dataModel);
|
customConstructor();
|
}
|
|
private void customConstructor(){
|
setFont(VCISwingUtil.FONT_DEFAULT);
|
}
|
private Object obj = null;
|
public Object getObj() {
|
return obj;
|
}
|
public void setObj(Object obj) {
|
this.obj = obj;
|
}
|
}
|