本文整理汇总了Java中org.zkoss.zul.Listbox类的典型用法代码示例。如果您正苦于以下问题:Java Listbox类的具体用法?Java Listbox怎么用?Java Listbox使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Listbox类属于org.zkoss.zul包,在下文中一共展示了Listbox类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: render
import org.zkoss.zul.Listbox; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public void render(Listitem listitem, BookValueHistory data, int index) {
Listbox listbox = listitem.getListbox();
if (index == 0) {
if (listbox.getListhead() != null) {
listbox.getListhead().setParent(null);
}
createListhead(data).setParent(listbox);
}
listitem.setValue(data);
if (data.getBookValues().size() > 0) {
String description = data.getBookValues().get(0).getDescription();
addLabelCell(listitem, description);
for (BookValue bookValue : data.getBookValues()) {
if (bookValue.getSaldo() != null) {
addIntboxCell(listitem, bookValue.getSaldo().intValue()).addEventListener(Events.ON_CHANGE,
getSaldoChangedListener(listbox, bookValue, listitem));
} else {
addLabelCell(listitem, "");
}
}
}
}
示例2: obtenerItemSeleccionado
import org.zkoss.zul.Listbox; //导入依赖的package包/类
/**
* Obtiene item seleccionado en el listbox. Si no hay ninguno seleccionado
* muestra mensaje de que no se ha seleccionado elemento.
*
* @param listbox
* Listbox
* @return Elemento seleccionado (null si no hay ninguno seleccionado).
*/
protected final Object obtenerItemSeleccionado(final Listbox listbox) {
Object valueSelected = null;
if (listbox.getSelectedIndex() == ConstantesZK.SINSELECCION) {
mostrarMessageBox(
Labels.getLabel(ConstantesZK.SINSELECCION_LABEL),
Labels.getLabel("mensaje.atencion"), Messagebox.OK,
Messagebox.EXCLAMATION);
} else {
valueSelected = listbox.getSelectedItem().getValue();
}
return valueSelected;
}
示例3: fillFieldList
import org.zkoss.zul.Listbox; //导入依赖的package包/类
private void fillFieldList(Listbox list, Collection<IField<?>> fields) {
list.getItems().clear();
for(IField<?> f: fields) {
Listitem item = new Listitem();
Listcell id = new Listcell();
Listcell title = new Listcell();
id.setLabel(f.getId());
title.setLabel(f.getLabel());
item.appendChild(id);
item.appendChild(title);
item.setValue(f);
list.getItems().add(item);
}
}
示例4: initFormList
import org.zkoss.zul.Listbox; //导入依赖的package包/类
private void initFormList(Listbox list) throws SQLException {
list.getItems().clear();
QueryBuilder<Form, String> qb = ConfigLoader.getInstance().getForms().queryBuilder();
Where<Form, String> w = qb.where();
w.eq(Form.CONNECTION_FIELD_NAME, dbConnection.getName());
List<Form> forms = ConfigLoader.getInstance().getForms().query(qb.prepare());
for(Form f : forms) {
Listitem item = new Listitem();
Listcell name = new Listcell();
name.setLabel(f.getName());
item.appendChild(name);
item.setValue(f);
list.getItems().add(item);
}
}
示例5: getResultPanel
import org.zkoss.zul.Listbox; //导入依赖的package包/类
private Listbox getResultPanel() {
Listbox listbox = new Listbox();
listbox.setMold("paging");
listbox.setPageSize(15);
listbox.setEmptyMessage("No hay resultados");
listbox.setModel(getModel());
listbox.setItemRenderer(getItemRenderer());
listbox.appendChild(getListHeader());
return listbox;
}
示例6: getSaldoChangedListener
import org.zkoss.zul.Listbox; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
private EventListener getSaldoChangedListener(final Listbox listbox, final BookValue oldBookValue, final Listitem listitem) {
return new EventListener() {
public void onEvent(Event event) throws ParseException {
InputEvent ievent = (InputEvent) event;
BigInteger amount = AmountHelper.parse(ievent.getValue());
BookValue newBookValue = new BookValue(oldBookValue.getBalanceType(), oldBookValue.getYear(), amount);
newBookValue.setId(oldBookValue.getId());
Events.postEvent(ModelDataChangeEvent.getModelDataChangeEvent(listbox, newBookValue,
listitem.getIndex()
));
}
};
}
示例7: addComponentsToTab
import org.zkoss.zul.Listbox; //导入依赖的package包/类
/**
* Retrieves the predefined visual components
* declared within the iDOM and attaches them
* onto the specified tab panel
* @param elementTab The iDOM description of the
* tab element
* @param tabpanel The panel where the components
* will be attached to
*/
private void addComponentsToTab(Element domTab,
Tabpanel tabpanel)
{
if ((config == null) || (domTab == null) || (tabpanel == null))
return;
// get the components defined for this tab,
// directly from the iDOM document
Element[] arrComponents = config.getElements("component", domTab);
if (ArrayUtils.isEmpty(arrComponents))
return;
// create the list with components items
Listbox list = new Listbox();
list.setWidth("100%");
list.setHflex("1");
list.setVflex("1");
list.setDroppable("false");
// create the Tabs to accomodate the tab groups
for (int i = 0; i < arrComponents.length; i++)
{
try
{
// get the next 'group' iDOM Element
Element domComponent = arrComponents[i];
// get the <class>, <image> and <tooltip> values
// directly from the iDOM document
Element domClass = config.getElement("class", domComponent);
Element domImage = config.getElement("image32", domComponent);
Element domTooltip = config.getElement("tooltip", domComponent);
Element domName = config.getElement("name", domComponent);
if (domClass == null)
continue;
// create the component's image and attach it onto
// the panel, according to its iDOM description
ElementInfo component = new ElementInfo(domClass.getText(),
domName.getText(), domTooltip.getText(), domImage.getText());
ComponentListItem item = new ComponentListItem(component);
list.getItems().add(item);
}
catch (Exception e)
{
// if something is missing, just move on
continue;
}
}
tabpanel.appendChild(list);
}