本文整理汇总了Java中com.vaadin.ui.ListSelect类的典型用法代码示例。如果您正苦于以下问题:Java ListSelect类的具体用法?Java ListSelect怎么用?Java ListSelect使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ListSelect类属于com.vaadin.ui包,在下文中一共展示了ListSelect类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildAndBindList
import com.vaadin.ui.ListSelect; //导入依赖的package包/类
protected Component buildAndBindList(String key, String caption) {
ListSelect field = new ListSelect();
field.setCaption(caption);
field.setNullSelectionAllowed(false);
field.addValueChangeListener((ValueChangeEvent event) -> {
String path = (String) event.getProperty().getValue();
if (path != null) {
// open app (subapp)
Location location = new RerootBrowserLocation("neatconfiguration", "helperBrowser", path, false);
adminEventBus.fireEvent(new LocationChangedEvent(location));
}
});
dataBindings.put(key, field);
return field;
}
示例2: updateScheduleFields
import com.vaadin.ui.ListSelect; //导入依赖的package包/类
protected void updateScheduleFields() {
if (agentDeployment.getStartExpression() != null) {
String[] fields = agentDeployment.getStartExpression().split(" ");
for (int i = 0; i < fields.length; i++) {
if (fields[i].equals("?")) {
fields[i] = "*";
}
String[] values = fields[i].split(",");
ListSelect listSelect = ((ListSelect) cronLayout.getComponent(i));
for (Object itemId : listSelect.getItemIds()) {
listSelect.unselect(itemId);
}
for (String value : values) {
listSelect.select(value);
}
}
}
}
示例3: OrderingListSelect
import com.vaadin.ui.ListSelect; //导入依赖的package包/类
public OrderingListSelect(String caption)
{
final GridLayout layout = new GridLayout(2, 1);
listSelect = new ListSelect();
final VerticalLayout buttonLayout = new VerticalLayout();
buttonLayout.setSpacing(true);
layout.addComponent(listSelect, 0, 0);
layout.addComponent(buttonLayout, 1, 0);
layout.setComponentAlignment(buttonLayout, Alignment.MIDDLE_CENTER);
upButton = new Button("▲");
downButton = new Button("▼");
buttonLayout.addComponent(upButton);
buttonLayout.addComponent(downButton);
setButtonClickListeners();
listSelect.setCaption(caption);
setCompositionRoot(layout);
}
示例4: addList
import com.vaadin.ui.ListSelect; //导入依赖的package包/类
private void addList( AbsoluteLayout mainLayout ) {
ListSelect list = new ListSelect();
list.setWidth( "100%" );
list.setHeight( "420px" );
list.setNullSelectionAllowed( false );
list.setImmediate( true );
list.addValueChangeListener( new Property.ValueChangeListener() {
@Override
public void valueChange( Property.ValueChangeEvent event ) {
Object value = event.getProperty().getValue();
if ( value != null ) {
close();
selectedUser = ( String ) value;
showUser( ( String ) value );
}
}
});
loadData( list );
mainLayout.addComponent( list, "left: 0px; top: 0px;" );
}
示例5: 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 );
}
}
示例6: initListSelect
import com.vaadin.ui.ListSelect; //导入依赖的package包/类
/** Initialise les listes
* @param listSelect
* @param container
*/
private void initListSelect(ListSelect listSelect, BeanItemContainer<DroitFonctionnalite> container){
listSelect.setWidth(100, Unit.PERCENTAGE);
listSelect.setMultiSelect(true);
listSelect.setNullSelectionAllowed(false);
listSelect.setContainerDataSource(container);
listSelect.setImmediate(true);
listSelect.setRows(17);
listSelect.setItemCaptionPropertyId(DroitFonctionnalite_.libFonc.getName());
}
示例7: initListSelectPj
import com.vaadin.ui.ListSelect; //导入依赖的package包/类
/**
* Initialise les listes de PJ
*
* @param listSelect
* @param container
*/
private void initListSelectPj(ListSelect listSelect, BeanItemContainer<PieceJustif> container) {
listSelect.setWidth(100, Unit.PERCENTAGE);
listSelect.setMultiSelect(true);
listSelect.setNullSelectionAllowed(false);
listSelect.setContainerDataSource(container);
listSelect.setImmediate(true);
listSelect.setItemCaptionPropertyId(PieceJustif_.libPj.getName());
}
示例8: initListSelectFormulaire
import com.vaadin.ui.ListSelect; //导入依赖的package包/类
/**
* Initialise les listes de PJ
*
* @param listSelect
* @param container
*/
private void initListSelectFormulaire(ListSelect listSelect, BeanItemContainer<Formulaire> container) {
listSelect.setWidth(100, Unit.PERCENTAGE);
listSelect.setMultiSelect(true);
listSelect.setNullSelectionAllowed(false);
listSelect.setContainerDataSource(container);
listSelect.setImmediate(true);
listSelect.setItemCaptionPropertyId(Formulaire_.libFormulaire.getName());
}
示例9: buildMainLayout
import com.vaadin.ui.ListSelect; //导入依赖的package包/类
@AutoGenerated
private VerticalLayout buildMainLayout() {
// common part: create layout
mainLayout = new VerticalLayout();
mainLayout.setImmediate(false);
mainLayout.setWidth("-1px");
mainLayout.setHeight("-1px");
mainLayout.setMargin(true);
mainLayout.setSpacing(true);
// top-level component properties
setWidth("-1px");
setHeight("-1px");
// listSelectPDPGroup
listSelectPDPGroup = new ListSelect();
listSelectPDPGroup.setImmediate(false);
listSelectPDPGroup.setWidth("-1px");
listSelectPDPGroup.setHeight("-1px");
listSelectPDPGroup.setInvalidAllowed(false);
listSelectPDPGroup.setRequired(true);
mainLayout.addComponent(listSelectPDPGroup);
mainLayout.setExpandRatio(listSelectPDPGroup, 1.0f);
// buttonSave
buttonSave = new Button();
buttonSave.setCaption("Save");
buttonSave.setImmediate(true);
buttonSave.setWidth("-1px");
buttonSave.setHeight("-1px");
mainLayout.addComponent(buttonSave);
mainLayout.setComponentAlignment(buttonSave, new Alignment(48));
return mainLayout;
}
示例10: buildMainLayout
import com.vaadin.ui.ListSelect; //导入依赖的package包/类
@AutoGenerated
private VerticalLayout buildMainLayout() {
// common part: create layout
mainLayout = new VerticalLayout();
mainLayout.setImmediate(false);
mainLayout.setWidth("-1px");
mainLayout.setHeight("-1px");
mainLayout.setMargin(true);
mainLayout.setSpacing(true);
// top-level component properties
setWidth("-1px");
setHeight("-1px");
// horizontalLayout_2
horizontalLayout_2 = buildHorizontalLayout_2();
mainLayout.addComponent(horizontalLayout_2);
// listSelectAttribute
listSelectAttribute = new ListSelect();
listSelectAttribute.setCaption("Dictionary Attributes");
listSelectAttribute.setImmediate(false);
listSelectAttribute.setWidth("100.0%");
listSelectAttribute.setHeight("-1px");
listSelectAttribute.setInvalidAllowed(false);
listSelectAttribute.setRequired(true);
mainLayout.addComponent(listSelectAttribute);
mainLayout.setExpandRatio(listSelectAttribute, 1.0f);
return mainLayout;
}
示例11: buildAndBindField
import com.vaadin.ui.ListSelect; //导入依赖的package包/类
/**
* Method called to generate and bind the Field component corresponding to a
* scalar property
* @param label
* @param propId
* @param prop
* @return the generated Field object
*/
protected Field<?> buildAndBindField(String label, String propId, Property<?> prop)
{
Field<?> field = fieldGroup.buildAndBind(label, propId);
Class<?> propType = prop.getType();
if (propId.equals(PROP_ID))
field.setReadOnly(true);
else if (propId.endsWith("." + PROP_ID))
field.setVisible(false);
else if (propId.endsWith("." + PROP_NAME))
field.setVisible(false);
else if (propId.endsWith(PROP_ENABLED))
field.setVisible(false);
else if (propId.endsWith(PROP_MODULECLASS))
field.setReadOnly(true);
if (propType.equals(String.class))
field.setWidth(500, Unit.PIXELS);
else if (propType.equals(int.class) || propType.equals(Integer.class) ||
propType.equals(float.class) || propType.equals(Float.class) ||
propType.equals(double.class) || propType.equals(Double.class))
field.setWidth(200, Unit.PIXELS);
else if (Enum.class.isAssignableFrom(propType))
((ListSelect)field).setRows(3);
if (field instanceof TextField) {
((TextField)field).setNullSettingAllowed(true);
((TextField)field).setNullRepresentation("");
}
return field;
}
示例12: getStartTypeComponent
import com.vaadin.ui.ListSelect; //导入依赖的package包/类
protected ComboBox getStartTypeComponent() {
startTypeCombo = new ComboBox("Start Type");
startTypeCombo.setWidth(200, Unit.PIXELS);
startTypeCombo.setNullSelectionAllowed(false);
StartType[] values = StartType.values();
for (StartType value : values) {
startTypeCombo.addItem(value.name());
}
startTypeCombo.setValue(agentDeployment.getStartType());
startTypeCombo.addValueChangeListener(new ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
agentDeployment.setStartType((String) startTypeCombo.getValue());
updateScheduleEnable();
for (int i = 0; i < 7; i++) {
ListSelect listSelect = ((ListSelect) cronLayout.getComponent(i));
for (Object itemId : listSelect.getItemIds()) {
listSelect.unselect(itemId);
}
listSelect.select(listSelect.getItemIds().iterator().next());
}
String startExpression = null;
if (agentDeployment.getStartType().equals(StartType.SCHEDULED_CRON.name())) {
startExpression = "0 0 0 * * ?";
}
startExpressionTextField.setValue(startExpression);
agentDeployment.setStartExpression(startExpression);
updateScheduleFields();
saveAgentDeployment(agentDeployment);
}
});
return startTypeCombo;
}
示例13: 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;
}
示例14: getCronValue
import com.vaadin.ui.ListSelect; //导入依赖的package包/类
@SuppressWarnings("unchecked")
protected Set<Object> getCronValue(int index) {
Set<Object> values = (Set<Object>) ((ListSelect) cronLayout.getComponent(index)).getValue();
if (values.contains("*") && values.size() > 1) {
values = new HashSet<Object>();
values.add("*");
}
return values;
}
示例15: buildDialogLayout
import com.vaadin.ui.ListSelect; //导入依赖的package包/类
@Override
public void buildDialogLayout() {
Map<String, String> env = this.getContext().getEnvironment();
pathToShellScripts = env.get(ExecuteShellScript.SHELL_SCRIPT_PATH);
final VerticalLayout mainLayout = new VerticalLayout();
mainLayout.setSizeFull();
mainLayout.setMargin(true);
mainLayout.setSpacing(true);
lstScriptName = new ListSelect(ctx.tr("ExecuteShellScript.dialog.scriptName"));
lstScriptName.setRows(5);
lstScriptName.setNullSelectionAllowed(true);
lstScriptName.setWidth("100%");
mainLayout.addComponent(lstScriptName);
txtConfiguration = new TextArea(ctx.tr("ExecuteShellScript.dialog.configuration"));
txtConfiguration.setSizeFull();
mainLayout.addComponent(txtConfiguration);
errorLabel = new Label();
errorLabel.setVisible(false);
errorLabel.setStyleName("dpu-error-label");
mainLayout.addComponent(errorLabel);
fillListValues();
setCompositionRoot(mainLayout);
}