本文整理汇总了Java中com.vaadin.ui.ListSelect.addItem方法的典型用法代码示例。如果您正苦于以下问题:Java ListSelect.addItem方法的具体用法?Java ListSelect.addItem怎么用?Java ListSelect.addItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vaadin.ui.ListSelect
的用法示例。
在下文中一共展示了ListSelect.addItem方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: mostrarEvaluadoresDisponibles
import com.vaadin.ui.ListSelect; //导入方法依赖的package包/类
private void mostrarEvaluadoresDisponibles( ListSelect tab )
{
lstEvaluadores.removeAllItems( );
tab.removeAllItems();
EvaluacionBO evaluacionBO = (EvaluacionBO) ControladorPropietario.getInstance().getAcademUI().getHTTPSession().getAttribute("evaluacion");
RolBO rol = new RolBO();
rol.setEvaluacion( evaluacionBO.getId() );
rol.setNombre( tab.getCaption( ) );
for( UsuarioBO e : evaluacionBO.getEvaluadores( ) )
{
if( e.getRoles().contains(rol) )
tab.addItem( e );
else
lstEvaluadores.addItem( e );
}
}
示例2: getScheduleComponent
import com.vaadin.ui.ListSelect; //导入方法依赖的package包/类
protected ListSelect getScheduleComponent(String caption) {
ListSelect listSelect = new ListSelect(caption);
listSelect.setWidth(90, Unit.PIXELS);
listSelect.setMultiSelect(true);
listSelect.setRows(10);
listSelect.setImmediate(true);
listSelect.addItem("*");
listSelect.setItemCaption("*", "<All>");
if (caption.equals("Second") || caption.equals("Minute")) {
for (int i = 0; i <= 59; i++) {
listSelect.addItem(String.valueOf(i));
}
} else if (caption.equals("Hour")) {
for (int i = 0; i <= 23; i++) {
listSelect.addItem(String.valueOf(i));
}
} else if (caption.equals("Day")) {
for (int i = 1; i <= 31; i++) {
listSelect.addItem(String.valueOf(i));
}
} else if (caption.equals("Month")) {
listSelect.addItems("JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC");
} else if (caption.equals("Day of Week")) {
listSelect.addItems("SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT");
} else if (caption.equals("Year")) {
for (int i = Calendar.getInstance().get(Calendar.YEAR); i <= 2099; i++) {
listSelect.addItem(String.valueOf(i));
}
}
listSelect.select(listSelect.getItemIds().iterator().next());
listSelect.addValueChangeListener(new ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
updateScheduleExpression();
}
});
return listSelect;
}
示例3: loadData
import com.vaadin.ui.ListSelect; //导入方法依赖的package包/类
private void loadData( ListSelect list ) {
UserDao userDao = InjectorFactory.getInstance( UserDao.class );
for ( User user : userDao.getList() ) {
list.addItem( user.getUsername() );
}
}