当前位置: 首页>>代码示例>>Java>>正文


Java ComboBox.addValueChangeListener方法代码示例

本文整理汇总了Java中com.vaadin.ui.ComboBox.addValueChangeListener方法的典型用法代码示例。如果您正苦于以下问题:Java ComboBox.addValueChangeListener方法的具体用法?Java ComboBox.addValueChangeListener怎么用?Java ComboBox.addValueChangeListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.vaadin.ui.ComboBox的用法示例。


在下文中一共展示了ComboBox.addValueChangeListener方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: buildCombBox

import com.vaadin.ui.ComboBox; //导入方法依赖的package包/类
/**
 * @return a new ComboBox
 */
public ComboBox buildCombBox() {
    final ComboBox targetFilter = SPUIComponentProvider.getComboBox(null, "", null, ValoTheme.COMBOBOX_SMALL, false,
            "", prompt);
    targetFilter.setImmediate(true);
    targetFilter.setPageLength(7);
    targetFilter.setItemCaptionPropertyId(SPUILabelDefinitions.VAR_NAME);
    targetFilter.setSizeUndefined();
    if (id != null) {
        targetFilter.setId(id);
    }
    if (valueChangeListener != null) {
        targetFilter.addValueChangeListener(valueChangeListener);
    }
    return targetFilter;
}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:19,代码来源:ComboBoxBuilder.java

示例2: addComboBoxFilters

import com.vaadin.ui.ComboBox; //导入方法依赖的package包/类
/**
 * Ajoute un filtre en combobox String sur une colonne
 * 
 * @param property
 * @param cb
 */
public void addComboBoxFilters(String property, ComboBox cb, String libNull) {
	HeaderCell cell = getFilterCell(property);
	cb.addValueChangeListener(e -> {
		container.removeContainerFilters(property);
		if (cb.getValue() != null && !((String) cb.getValue()).isEmpty()
				&& !((String) cb.getValue()).equals(libNull)) {
			container.addContainerFilter(new SimpleStringFilter(property, (String) cb.getValue(), true, true));
		} else if (cb.getValue() != null && !((String) cb.getValue()).isEmpty()
				&& ((String) cb.getValue()).equals(libNull)) {
			container.addContainerFilter(new IsNull(property));
		}
		fireFilterListener();
		fireFilterListener();
	});
	cb.setImmediate(true);
	cb.setWidth(100, Unit.PERCENTAGE);
	cb.addStyleName(ValoTheme.COMBOBOX_TINY);
	cell.setComponent(cb);
}
 
开发者ID:EsupPortail,项目名称:esup-ecandidat,代码行数:26,代码来源:GridFormatting.java

示例3: createThemeChooserBox

import com.vaadin.ui.ComboBox; //导入方法依赖的package包/类
private ComboBox createThemeChooserBox() {
  List<String> themes = Arrays.asList("Blueprint", "Dark", "Default", "Facebook", "Flat",
                                      "Flat-Dark", "Light", "Metro");

  ComboBox comboBox = new ComboBox("Choose theme", themes);
  comboBox.setWidth(100, Unit.PERCENTAGE);
  comboBox.setValue("Default");
  comboBox.addValueChangeListener(e -> {
    Object value = e.getValue();
    String theme = value != null ? String.valueOf(value) : "";
    if (!"".equals(theme.trim())) {
      getUI().setTheme(theme.toLowerCase());
    }
  });

  return comboBox;
}
 
开发者ID:Juchar,项目名称:md-stepper,代码行数:18,代码来源:StepperPropertiesLayout.java

示例4: getLogLevelComponent

import com.vaadin.ui.ComboBox; //导入方法依赖的package包/类
protected ComboBox getLogLevelComponent() {
    final ComboBox combo = new ComboBox("Log Level");
    combo.setNullSelectionAllowed(false);
    combo.setWidth(200, Unit.PIXELS);
    LogLevel[] levels = LogLevel.values();
    for (LogLevel logLevel : levels) {
        combo.addItem(logLevel.name());
    }
    combo.setValue(agentDeployment.getLogLevel());
    combo.addValueChangeListener(new ValueChangeListener() {
        public void valueChange(ValueChangeEvent event) {
            agentDeployment.setLogLevel((String) combo.getValue());
            saveAgentDeployment(agentDeployment);
        }
    });
    return combo;
}
 
开发者ID:JumpMind,项目名称:metl,代码行数:18,代码来源:EditAgentDeploymentPanel.java

示例5: buildSelection

import com.vaadin.ui.ComboBox; //导入方法依赖的package包/类
private void buildSelection() {
	exportSelectionType = new ComboBox();
	exportSelectionType.setTextInputAllowed(false);
	exportSelectionType.setNullSelectionAllowed(false);
	exportSelectionType.setEnabled(false);

	exportSelectionType.addItem(Messages.getString("Caption.Item.Selected"));
	exportSelectionType.addItem(Messages.getString("Caption.Item.All"));
	exportSelectionType.select(Messages.getString("Caption.Item.Selected"));

	exportSelectionType.addValueChangeListener(new Property.ValueChangeListener() {
		public void valueChange(ValueChangeEvent event) {
			allTestsSelected = exportSelectionType.getValue().equals(Messages.getString("Caption.Item.All"));
			mainEvent.fire(new MainUIEvent.PackSelectionChangedEvent());
		}
	});
}
 
开发者ID:tilioteo,项目名称:hypothesis,代码行数:18,代码来源:ExportScorePresenterImpl.java

示例6: buildSelection

import com.vaadin.ui.ComboBox; //导入方法依赖的package包/类
@Override
protected ComboBox buildSelection() {
	final ComboBox selectionType = new ComboBox();
	selectionType.setTextInputAllowed(false);
	selectionType.setNullSelectionAllowed(false);

	selectionType.addItem(Messages.getString("Caption.Item.Selected"));
	selectionType.addItem(Messages.getString("Caption.Item.All"));
	selectionType.select(Messages.getString("Caption.Item.Selected"));

	selectionType.addValueChangeListener(e -> {
		allSelected = selectionType.getValue().equals(Messages.getString("Caption.Item.All"));
		mainEvent.fire(new MainUIEvent.UserSelectionChangedEvent());
	});

	return selectionType;
}
 
开发者ID:tilioteo,项目名称:hypothesis,代码行数:18,代码来源:UserManagementPresenterImpl.java

示例7: buildSelection

import com.vaadin.ui.ComboBox; //导入方法依赖的package包/类
@Override
protected ComboBox buildSelection() {
	final ComboBox selectionType = new ComboBox();
	selectionType.setTextInputAllowed(false);
	selectionType.setNullSelectionAllowed(false);

	selectionType.addItem(Messages.getString("Caption.Item.Selected"));
	selectionType.addItem(Messages.getString("Caption.Item.All"));
	selectionType.select(Messages.getString("Caption.Item.Selected"));

	selectionType.addValueChangeListener(e -> {
		allSelected = selectionType.getValue().equals(Messages.getString("Caption.Item.All"));
		mainEvent.fire(new MainUIEvent.GroupSelectionChangedEvent());
	});

	return selectionType;
}
 
开发者ID:tilioteo,项目名称:hypothesis,代码行数:18,代码来源:GroupManagementPresenterImpl.java

示例8: addParentHandler

import com.vaadin.ui.ComboBox; //导入方法依赖的package包/类
private void addParentHandler(final ComboBox parent, final EntityContainer<E> childContainer,
		final SingularAttribute<E, Parent> childForeignAttribute)
{
	parent.addValueChangeListener(new ValueChangeListener()
	{
		private static final long serialVersionUID = 1L;

		@Override
		public void valueChange(com.vaadin.data.Property.ValueChangeEvent event)
		{
			@SuppressWarnings("unchecked")
			Parent parentEntity = ((Parent) parent.getConvertedValue());

			childContainer.removeAllContainerFilters();
			childContainer.addContainerFilter(new Compare.Equal(childForeignAttribute.getName(), parentEntity));
			DependantComboBox.this.setContainerDataSource(childContainer);
			DependantComboBox.this.setValue(null);
		}
	});
}
 
开发者ID:rlsutton1,项目名称:VaadinUtils,代码行数:21,代码来源:DependantComboBox.java

示例9: createStepperTypeBox

import com.vaadin.ui.ComboBox; //导入方法依赖的package包/类
private ComboBox createStepperTypeBox() {
  List<String> stepperTypes = Arrays.asList("Horizontal", "Vertical");

  ComboBox comboBox = new ComboBox("Stepper Type *", stepperTypes);
  comboBox.setWidth(100, Unit.PERCENTAGE);
  comboBox.setValue(stepperTypes.get(0));
  comboBox.addValueChangeListener(event -> {
    createStepper();
    fireEvent(new StepperCreateEvent(StepperPropertiesLayout.this, stepper));
  });
  return comboBox;
}
 
开发者ID:Juchar,项目名称:md-stepper,代码行数:13,代码来源:StepperPropertiesLayout.java

示例10: createIconStyleBox

import com.vaadin.ui.ComboBox; //导入方法依赖的package包/类
private ComboBox createIconStyleBox() {
  List<String> iconStyles = Arrays.asList("Square", "Circular");
  ComboBox comboBox = new ComboBox("Choose Icon Style", iconStyles);
  comboBox.setWidth(100, Unit.PERCENTAGE);
  comboBox.setValue("Circular");
  comboBox.addValueChangeListener(event -> updateStepperIconStyles());
  return comboBox;
}
 
开发者ID:Juchar,项目名称:md-stepper,代码行数:9,代码来源:StepperPropertiesLayout.java

示例11: setup

import com.vaadin.ui.ComboBox; //导入方法依赖的package包/类
private void setup() {
  // Devices
  ComboBox devicesComboBox = new ComboBox("Actors");
  devicesComboBox.setNullSelectionItemId(false);
  devicesComboBox.setContainerDataSource(
      new BeanItemContainer<>(
          DeviceViewDTO.class,
          deviceSetupService.getAllActors().stream()
              .map(deviceDTO -> modelMapper.map(deviceDTO, DeviceViewDTO.class))
              .collect(Collectors.toList())
      )
  );

  DeviceDTO selectedDeviceDTO = deviceSetupService
      .getDeviceDtoByIdAndType(actionDTO.getDevId(), actionDTO.getDevType());
  if (selectedDeviceDTO != null) {
    devicesComboBox.select(modelMapper.map(selectedDeviceDTO, DeviceViewDTO.class));
  }

  devicesComboBox.addValueChangeListener(event -> {
    DeviceViewDTO selected = (DeviceViewDTO) event.getProperty().getValue();

    actionDTO.setDevId(selected.getDevId());
    actionDTO.setDevType(selected.getType());

    changeListener.accept(actionDTO);
  });
  mainLayout.addComponent(devicesComboBox);

  // Target
  TextField targetTextField = new TextField("Target", actionDTO.getParameter());
  targetTextField.addValueChangeListener(event -> {
    actionDTO.setParameter((String) event.getProperty().getValue());

    changeListener.accept(actionDTO);
  });
  mainLayout.addComponent(targetTextField);

}
 
开发者ID:daergoth,项目名称:HomeWire-Server,代码行数:40,代码来源:SetActionWidget.java

示例12: setCategoryFilter

import com.vaadin.ui.ComboBox; //导入方法依赖的package包/类
/**
 * @param filterRow
 * @return
 */
private HeaderCell setCategoryFilter(HeaderRow filterRow) {
	HeaderCell categoryFilter = filterRow.getCell(CATEGORY);
	ComboBox comboBox = new ComboBox();
	comboBox.setHeight(100, Unit.PERCENTAGE);
	comboBox.setImmediate(true);
	comboBox.setNewItemsAllowed(false);
	comboBox.setTextInputAllowed(false);
	comboBox.addValueChangeListener(getCategoryFilterListener());
	comboBox.setContainerDataSource(getCategoryDataSource());
	categoryFilter.setComponent(comboBox);
	return categoryFilter;
}
 
开发者ID:KrishnaPhani,项目名称:KrishnasSpace,代码行数:17,代码来源:FilterGrid.java

示例13: buildQuoteSelector

import com.vaadin.ui.ComboBox; //导入方法依赖的package包/类
private Component buildQuoteSelector() {
		quoteSelector = new ComboBox();
		
//		quoteSelector.setInputPrompt("Select Stock/Index...");
		
//		quoteSelector.setItemCaptionPropertyId(Quote.PROPERTY_NAME);
//		quoteSelector.setItemCaptionMode(ItemCaptionMode.PROPERTY);

		
        // Set full width
//		quoteSelector.setWidth(100.0f, Unit.PERCENTAGE);
		quoteSelector.addStyleName("borderless");
		
        // Set the appropriate filtering mode for this example
		quoteSelector.setFilteringMode(FilteringMode.CONTAINS);
		quoteSelector.setImmediate(true);
 
        // Disallow null selections
		quoteSelector.setNullSelectionAllowed(false);
		
		quoteSelector.addValueChangeListener(e -> {
                chart.setChartSymbol(quotes.getItem(e.getProperty().getValue()).getBean().getChartSrc());
                ticker.setSymbol(quotes.getItem(e.getProperty().getValue()).getBean().getTickerSrc());
                chartToolbar.getCharts().getChildren().get(LiveChart.ChartDrawType.LINE.ordinal()*2).setChecked(false);
                chartToolbar.getCharts().getChildren().get(LiveChart.ChartDrawType.CANDLE.ordinal()*2).setChecked(true);
		});
		
		return quoteSelector;
	}
 
开发者ID:xyfreemind,项目名称:trader,代码行数:30,代码来源:TradingAreaView.java

示例14: getStartTypeComponent

import com.vaadin.ui.ComboBox; //导入方法依赖的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;
}
 
开发者ID:JumpMind,项目名称:metl,代码行数:33,代码来源:EditAgentDeploymentPanel.java

示例15: buildGrid

import com.vaadin.ui.ComboBox; //导入方法依赖的package包/类
protected void buildGrid() {
    grid = new Grid();
    grid.setSelectionMode(SelectionMode.NONE);
    grid.setSizeFull();
    grid.setEditorEnabled(!readOnly);
    container = new BeanItemContainer<Record>(Record.class);
    grid.setContainerDataSource(container);
    grid.setColumns("entityName", "attributeName", "xpath");
    HeaderRow filterRow = grid.appendHeaderRow();

    addColumn("entityName", filterRow);

    addColumn("attributeName", filterRow);

    ComboBox combo = new ComboBox();
    combo.addValueChangeListener(e->saveXPathSettings());
    combo.setWidth(100, Unit.PERCENTAGE);
    combo.setImmediate(true);
    combo.setNewItemsAllowed(true);
    combo.setInvalidAllowed(true);
    combo.setTextInputAllowed(true);
    combo.setScrollToSelectedItem(true);
    combo.setFilteringMode(FilteringMode.CONTAINS);
    grid.getColumn("xpath").setEditorField(combo).setExpandRatio(1);
    addShowPopulatedFilter("xpath", filterRow);
    grid.setEditorBuffered(false);
    addComponent(grid);
    setExpandRatio(grid, 1);
}
 
开发者ID:JumpMind,项目名称:metl,代码行数:30,代码来源:EditXmlFormatPanel.java


注:本文中的com.vaadin.ui.ComboBox.addValueChangeListener方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。