• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ValueChangeMode类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.vaadin.shared.ui.ValueChangeMode的典型用法代码示例。如果您正苦于以下问题:Java ValueChangeMode类的具体用法?Java ValueChangeMode怎么用?Java ValueChangeMode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ValueChangeMode类属于com.vaadin.shared.ui包,在下文中一共展示了ValueChangeMode类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: test

import com.vaadin.shared.ui.ValueChangeMode; //导入依赖的package包/类
@Test
public void test() {
    FRichTextArea area = new FRichTextArea().withCaption("test")
                                            .withEnabled(false)
                                            .withIcon(VaadinIcons.AIRPLANE)
                                            .withId("textId")
                                            .withValue("some text")
                                            .withVisible(false)
                                            .withValueChangeMode(ValueChangeMode.TIMEOUT)
                                            .withValueChangeTimeout(5000);

    assertEquals("test", area.getCaption());
    assertFalse(area.isEnabled());
    assertEquals(VaadinIcons.AIRPLANE, area.getIcon());
    assertEquals("textId", area.getId());
    assertEquals("some text", area.getValue());
    assertFalse(area.isVisible());
    assertEquals(ValueChangeMode.TIMEOUT, area.getValueChangeMode());
    assertEquals(5000, area.getValueChangeTimeout());
}
 
开发者ID:viydaag,项目名称:vaadin-fluent-api,代码行数:21,代码来源:FRichTextAreaTest.java


示例2: test

import com.vaadin.shared.ui.ValueChangeMode; //导入依赖的package包/类
@Test
public void test() {
    FTextArea area = new FTextArea().withCaption("test")
                                    .withEnabled(false)
                                    .withIcon(VaadinIcons.AIRPLANE)
                                    .withId("textId")
                                    .withPlaceholder("enter text")
                                    .withValue("some text")
                                    .withVisible(false)
                                    .withValueChangeMode(ValueChangeMode.TIMEOUT)
                                    .withValueChangeTimeout(5000)
                                    .withRows(20)
                                    .withWordWrap(false);

    assertEquals("test", area.getCaption());
    assertFalse(area.isEnabled());
    assertEquals(VaadinIcons.AIRPLANE, area.getIcon());
    assertEquals("textId", area.getId());
    assertEquals("enter text", area.getPlaceholder());
    assertEquals("some text", area.getValue());
    assertFalse(area.isVisible());
    assertEquals(ValueChangeMode.TIMEOUT, area.getValueChangeMode());
    assertEquals(5000, area.getValueChangeTimeout());
    assertEquals(20, area.getRows());
    assertFalse(area.isWordWrap());
}
 
开发者ID:viydaag,项目名称:vaadin-fluent-api,代码行数:27,代码来源:FTextAreaTest.java


示例3: getAllMetricsGrid

import com.vaadin.shared.ui.ValueChangeMode; //导入依赖的package包/类
private Grid<MetricsGridRow> getAllMetricsGrid(Map<String, Number> metrics) {
	allMetricsRows = metrics.entrySet().stream()
							.map(MetricsGridRow::new)
							.collect(Collectors.toList());

	Grid<MetricsGridRow> grid = new Grid<>(MetricsGridRow.class);
	grid.removeAllColumns();
	Column<MetricsGridRow, String> nameColumn = grid.addColumn(MetricsGridRow::getName)
															.setCaption("Name")
															.setExpandRatio(1);
	grid.addColumn(MetricsGridRow::getValue).setCaption("Value");

	grid.setItems(allMetricsRows);
	grid.sort(nameColumn);
	grid.setSizeFull();
	grid.setRowHeight(40);

	TextField filterInput = new TextField();
	filterInput.setPlaceholder("filter by metric...");
	filterInput.addValueChangeListener(e -> updateMetrics(e.getValue()));
	filterInput.setValueChangeMode(ValueChangeMode.LAZY);
	filterInput.setSizeFull();

	// Header row
	HeaderRow filterRow = grid.addHeaderRowAt(grid.getHeaderRowCount());
	filterRow.getCell(nameColumn).setComponent(filterInput);

	return grid;
}
 
开发者ID:vianneyfaivre,项目名称:Persephone,代码行数:30,代码来源:MetricsPage.java


示例4: initFilterRow

import com.vaadin.shared.ui.ValueChangeMode; //导入依赖的package包/类
private void initFilterRow(Column<Application, String> appColumn, Column<Application, String> envColumn, Column<Application, String> urlColumn) {
	TextField filterApp = new TextField();
	TextField filterEnv = new TextField();
	TextField filterUrl = new TextField();

	filterApp.setPlaceholder("filter by application...");
	filterApp.addValueChangeListener(e -> updateApplications(e.getValue(), filterEnv.getValue(), filterUrl.getValue()));
	filterApp.setValueChangeMode(ValueChangeMode.LAZY);
	filterApp.focus();
	filterApp.setSizeFull();

	filterEnv.setPlaceholder("filter by environment...");
	filterEnv.addValueChangeListener(e -> updateApplications(filterApp.getValue(), e.getValue(), filterUrl.getValue()));
	filterEnv.setValueChangeMode(ValueChangeMode.LAZY);
	filterEnv.setSizeFull();

	filterUrl.setPlaceholder("filter by URL...");
	filterUrl.addValueChangeListener(e -> updateApplications(filterApp.getValue(), filterEnv.getValue(), e.getValue()));
	filterUrl.setValueChangeMode(ValueChangeMode.LAZY);
	filterUrl.setSizeFull();

	// Header row
	HeaderRow filterRow = grid.addHeaderRowAt(grid.getHeaderRowCount());
	filterRow.getCell(appColumn).setComponent(filterApp);
	filterRow.getCell(envColumn).setComponent(filterEnv);
	filterRow.getCell(urlColumn).setComponent(filterUrl);
}
 
开发者ID:vianneyfaivre,项目名称:Persephone,代码行数:28,代码来源:ApplicationsPage.java


示例5: setValueChangeMode

import com.vaadin.shared.ui.ValueChangeMode; //导入依赖的package包/类
@Override
public void setValueChangeMode(ValueChangeMode valueChangeMode) {
	ObjectUtils.argumentNotNull(valueChangeMode, "ValueChangeMode must be not null");
	if (isValueChangeModeSupported()) {
		((HasValueChangeMode) field).setValueChangeMode(valueChangeMode);
	}
}
 
开发者ID:holon-platform,项目名称:holon-vaadin,代码行数:8,代码来源:InputFieldWrapper.java


示例6: getValueChangeMode

import com.vaadin.shared.ui.ValueChangeMode; //导入依赖的package包/类
@Override
public ValueChangeMode getValueChangeMode() {
	if (isValueChangeModeSupported()) {
		return ((HasValueChangeMode) field).getValueChangeMode();
	}
	return ValueChangeMode.BLUR;
}
 
开发者ID:holon-platform,项目名称:holon-vaadin,代码行数:8,代码来源:InputFieldWrapper.java


示例7: test

import com.vaadin.shared.ui.ValueChangeMode; //导入依赖的package包/类
@Test
public void test() {
    FTextField field = new FTextField().withPlaceholder("enter text")
                                       .withValue("some text")
                                       .withVisible(false)
                                       .withValueChangeMode(ValueChangeMode.TIMEOUT)
                                       .withValueChangeTimeout(5000);

    assertEquals("enter text", field.getPlaceholder());
    assertEquals("some text", field.getValue());
    assertFalse(field.isVisible());
    assertEquals(ValueChangeMode.TIMEOUT, field.getValueChangeMode());
    assertEquals(5000, field.getValueChangeTimeout());
}
 
开发者ID:viydaag,项目名称:vaadin-fluent-api,代码行数:15,代码来源:FTextFieldTest.java


示例8: setTextFilter

import com.vaadin.shared.ui.ValueChangeMode; //导入依赖的package包/类
/**
 * assign a <b>SimpleStringFilter</b> to grid for given columnId<br>
 * could also be used for NumberField when you would like to do filter by startWith for example
 *
 * @param columnId        id of property
 * @param ignoreCase      property of SimpleStringFilter
 * @param onlyMatchPrefix property of SimpleStringFilter
 * @param inputPrompt     hint for user
 * @return CellFilterComponent that contains TextField
 */
public CellFilterComponent<TextField> setTextFilter(String columnId, boolean ignoreCase, boolean onlyMatchPrefix, String inputPrompt) {
    CellFilterComponent<TextField> filter = new CellFilterComponent<TextField>() {

        TextField textField = new TextField();

        String currentValue = "";

        public void triggerUpdate() {
            if (currentValue == null || currentValue.isEmpty()) {
                removeFilter(columnId);
            } else {
                replaceFilter(new SimpleStringFilter(currentValue, ignoreCase, onlyMatchPrefix), columnId);
            }
        }

        @Override
        public TextField layoutComponent() {
            textField.setPlaceholder(inputPrompt);
            textField.addStyleName(STYLENAME_GRIDCELLFILTER);
            textField.addStyleName(ValoTheme.TEXTFIELD_TINY);
            textField.setValueChangeTimeout(200);
            textField.setValueChangeMode(ValueChangeMode.TIMEOUT);
            // used to allow changes from outside
            textField.addValueChangeListener(e -> {
                currentValue = textField.getValue();
                triggerUpdate();
            });
            return textField;
        }

        @Override
        public void clearFilter() {
            textField.clear();
        }
    };
    handleFilterRow(columnId, filter);
    return filter;
}
 
开发者ID:melistik,项目名称:vaadin-grid-util,代码行数:49,代码来源:GridCellFilter.java


示例9: test_fluent

import com.vaadin.shared.ui.ValueChangeMode; //导入依赖的package包/类
@Test
public void test_fluent() {
    EmailField field = new EmailField();

    assertThat(field.getValueChangeMode(),
            is(equalTo(ValueChangeMode.LAZY)));
    
    assertThat(
            new EmailField().withValueChangeMode(ValueChangeMode.BLUR)
                    .getValueChangeMode(),
            is(equalTo(ValueChangeMode.BLUR)));
}
 
开发者ID:viritin,项目名称:viritin,代码行数:13,代码来源:EmailFieldTest.java


示例10: initGrid

import com.vaadin.shared.ui.ValueChangeMode; //导入依赖的package包/类
private void initGrid() {
	this.grid = new Grid<>(PropertyItem.class);

	this.grid.removeAllColumns();
	Column<PropertyItem, String> propertyColumn = this.grid.addColumn(PropertyItem::getKey)
															.setCaption("Property")
															.setExpandRatio(1);
	Column<PropertyItem, String> valueColumn = this.grid.addColumn(PropertyItem::getValue)
															.setCaption("Value")
															.setExpandRatio(1);
	Column<PropertyItem, String> originColumn = this.grid.addColumn(PropertyItem::getOrigin).setCaption("Origin");

	this.grid.sort(propertyColumn);
	this.grid.setSizeFull();
	this.grid.setRowHeight(40);

	// distinct origin
	List<String> origins = this.currentEnv.getProperties().stream()
												.map(PropertyItem::getOrigin)
												.distinct()
												.sorted(String::compareTo)
												.collect(Collectors.toList());

	// Filters
	TextField filterProperty = new TextField();
	TextField filterValue = new TextField();
	NativeSelect<String> filterOrigin = new NativeSelect<>(null, origins);

	filterProperty.setPlaceholder("filter by key...");
	filterProperty.addValueChangeListener(e -> updateProperties(e.getValue(), filterValue.getValue(), filterOrigin.getValue()));
	filterProperty.setValueChangeMode(ValueChangeMode.LAZY);
	filterProperty.focus();
	filterProperty.setSizeFull();

	filterValue.setPlaceholder("filter by value...");
	filterValue.addValueChangeListener(e -> updateProperties(filterProperty.getValue(), e.getValue(), filterOrigin.getValue()));
	filterValue.setValueChangeMode(ValueChangeMode.LAZY);
	filterValue.setSizeFull();

	filterOrigin.addValueChangeListener(e -> updateProperties(filterProperty.getValue(), filterValue.getValue(), e.getValue()));
	filterOrigin.setSizeFull();

	// Header row
	HeaderRow filterRow = grid.addHeaderRowAt(grid.getHeaderRowCount());
	filterRow.getCell(propertyColumn).setComponent(filterProperty);
	filterRow.getCell(valueColumn).setComponent(filterValue);
	filterRow.getCell(originColumn).setComponent(filterOrigin);
}
 
开发者ID:vianneyfaivre,项目名称:Persephone,代码行数:49,代码来源:PropertiesPage.java


示例11: enter

import com.vaadin.shared.ui.ValueChangeMode; //导入依赖的package包/类
@Override
public void enter(ViewChangeEvent event) {
	pageHelper.setErrorHandler(this);

	this.removeAllComponents();

	// Get application
	int appId = Integer.parseInt(event.getParameters());
	Application app = pageHelper.getApp(appId);

	// Get loggers config
	Optional<Loggers> loggers = getLoggers(app);

	if(loggers.isPresent()) {

		// Display loggers in a grid
		grid = new Grid<>(LoggerGridRow.class);

		grid.removeAllColumns();

		Column<LoggerGridRow, String> nameColumn = grid.addColumn(LoggerGridRow::getName)
																.setCaption("Name")
																.setExpandRatio(2);
		grid.addComponentColumn(logger -> {
			NativeSelect<String> levelsDropdown = new NativeSelect<>(null, loggers.get().getLevels());

			levelsDropdown.setEmptySelectionAllowed(false);
			levelsDropdown.setSelectedItem(logger.getLevel());

			// on selected level
			levelsDropdown.addValueChangeListener(value -> {

				// change logger level
				loggersService.changeLevel(app, logger.getName(), value.getValue());

				// refresh data in grid (several loggers might have been impacted)
				updateLoggers(app);

				Notification.show(
						String.format("Logger %s level changed to %s", logger.getName(), value.getValue())
						, Notification.Type.TRAY_NOTIFICATION);
			});

			return levelsDropdown;
		})	.setCaption("Level")
			.setExpandRatio(1);

		grid.setSizeFull();
		grid.setRowHeight(40);

		grid.setItems(loggersRows);
		grid.sort(nameColumn);

		// Filter grid by logger name
		filterInput = new TextField();
		filterInput.setPlaceholder("filter by logger name...");
		filterInput.addValueChangeListener(e -> filterLoggers(e.getValue()));
		filterInput.setValueChangeMode(ValueChangeMode.LAZY);
		filterInput.focus();
		filterInput.setSizeFull();

		// Header row
		HeaderRow filterRow = grid.addHeaderRowAt(grid.getHeaderRowCount());
		filterRow.getCell(nameColumn).setComponent(filterInput);

		this.addComponent(new PageHeader(app, "Loggers"));
		this.addComponent(new Label("Changing a level will update one/many logger(s) level(s)"));
		this.addComponent(grid);
	} else {
		this.addComponent(new PageHeader(app, "Loggers"));
		this.addComponent(new Label(String.format("Failed to call %s<br />This endpoint is available since Spring Boot 1.5", app.endpoints().loggers()), ContentMode.HTML));
	}
}
 
开发者ID:vianneyfaivre,项目名称:Persephone,代码行数:74,代码来源:LoggersPage.java


示例12: setValueChangeMode

import com.vaadin.shared.ui.ValueChangeMode; //导入依赖的package包/类
@Override
public void setValueChangeMode(ValueChangeMode valueChangeMode) {
	super.setValueChangeMode(valueChangeMode);
}
 
开发者ID:holon-platform,项目名称:holon-vaadin,代码行数:5,代码来源:SecretField.java


示例13: getValueChangeMode

import com.vaadin.shared.ui.ValueChangeMode; //导入依赖的package包/类
@Override
public ValueChangeMode getValueChangeMode() {
	return super.getValueChangeMode();
}
 
开发者ID:holon-platform,项目名称:holon-vaadin,代码行数:5,代码来源:SecretField.java


示例14: setValueChangeMode

import com.vaadin.shared.ui.ValueChangeMode; //导入依赖的package包/类
@Override
public void setValueChangeMode(ValueChangeMode valueChangeMode) {
	getInternalField().setValueChangeMode(valueChangeMode);
}
 
开发者ID:holon-platform,项目名称:holon-vaadin,代码行数:5,代码来源:NumberField.java


示例15: getValueChangeMode

import com.vaadin.shared.ui.ValueChangeMode; //导入依赖的package包/类
@Override
public ValueChangeMode getValueChangeMode() {
	return getInternalField().getValueChangeMode();
}
 
开发者ID:holon-platform,项目名称:holon-vaadin,代码行数:5,代码来源:NumberField.java


示例16: textChangeEventMode

import com.vaadin.shared.ui.ValueChangeMode; //导入依赖的package包/类
@Override
public NumberInputBuilder<T> textChangeEventMode(ValueChangeMode inputEventMode) {
	getInstance().setTextChangeEventMode(inputEventMode);
	return builder();
}
 
开发者ID:holon-platform,项目名称:holon-vaadin,代码行数:6,代码来源:NumberField.java


示例17: textChangeEventMode

import com.vaadin.shared.ui.ValueChangeMode; //导入依赖的package包/类
@Override
public StringInputBuilder textChangeEventMode(ValueChangeMode inputEventMode) {
	getInstance().setValueChangeMode(inputEventMode);
	return builder();
}
 
开发者ID:holon-platform,项目名称:holon-vaadin,代码行数:6,代码来源:AbstractStringFieldBuilder.java


示例18: setValueChangeMode

import com.vaadin.shared.ui.ValueChangeMode; //导入依赖的package包/类
@Override
public void setValueChangeMode(ValueChangeMode valueChangeMode) {
	input.setValueChangeMode(valueChangeMode);
}
 
开发者ID:holon-platform,项目名称:holon-vaadin,代码行数:5,代码来源:InputConverterAdapter.java


示例19: getValueChangeMode

import com.vaadin.shared.ui.ValueChangeMode; //导入依赖的package包/类
@Override
public ValueChangeMode getValueChangeMode() {
	return input.getValueChangeMode();
}
 
开发者ID:holon-platform,项目名称:holon-vaadin,代码行数:5,代码来源:InputConverterAdapter.java


示例20: setValueChangeMode

import com.vaadin.shared.ui.ValueChangeMode; //导入依赖的package包/类
@Override
default void setValueChangeMode(ValueChangeMode valueChangeMode) {
	// not supported by default
}
 
开发者ID:holon-platform,项目名称:holon-vaadin,代码行数:5,代码来源:Input.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java OnDrawListener类代码示例发布时间:2022-05-23
下一篇:
Java RTimer类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap