當前位置: 首頁>>代碼示例>>Java>>正文


Java TextField.setSizeFull方法代碼示例

本文整理匯總了Java中com.vaadin.ui.TextField.setSizeFull方法的典型用法代碼示例。如果您正苦於以下問題:Java TextField.setSizeFull方法的具體用法?Java TextField.setSizeFull怎麽用?Java TextField.setSizeFull使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.vaadin.ui.TextField的用法示例。


在下文中一共展示了TextField.setSizeFull方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getAllMetricsGrid

import com.vaadin.ui.TextField; //導入方法依賴的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

示例2: initFilterRow

import com.vaadin.ui.TextField; //導入方法依賴的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

示例3: getTargetComponent

import com.vaadin.ui.TextField; //導入方法依賴的package包/類
@Override
public Component getTargetComponent() {
    final TextField textField = new TextField();
    textField.setSizeFull();
    textField.setValue("Copy to clipboard textfield value....");
    textField.setId("tocopie-textfield");
    return textField;
}
 
開發者ID:vaadin4qbanos,項目名稱:vaadin-jsclipboard-addon,代碼行數:9,代碼來源:TextFieldView.java

示例4: initGrid

import com.vaadin.ui.TextField; //導入方法依賴的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

示例5: enter

import com.vaadin.ui.TextField; //導入方法依賴的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

示例6: showAddProjectDialog

import com.vaadin.ui.TextField; //導入方法依賴的package包/類
/**
 * Zeige das Projekt-Hinzufuegen-Dialogfenster, bei dem ein Eingabefeld fuer
 * den Namen des Projekts und ein Hinzfuege-Button vorhanden ist. Funktion
 * bei geklicktem Button siehe Clicklistener in dieser Klasse. Das
 * horizontale Layout zur Darstellung besitzt ein Formlayout und den Button,
 * die nebeneinander dargestellt werden.
 * 
 * @author Christian Scherer, Mirko Göpfrich
 */
@Override
public void showAddProjectDialog() {
	addDialog = new Window("Projekt hinzufügen");
	addDialog.setModal(true);
	addDialog.setWidth(410, UNITS_PIXELS);
	addDialog.setResizable(false);
	addDialog.setDraggable(false);

	VerticalLayout layout = new VerticalLayout();
	layout.setSpacing(false);

	FormLayout formLayout = new FormLayout();
	formLayout.setMargin(true);
	formLayout.setSpacing(true);
	
	//TextFeld für Name dem Formular hinzufügen
	tfName = new TextField("Name wählen:");
	tfName.setRequired(true);
	tfName.addValidator(new StringLengthValidator(
			"Der Projektname muss zwischen 2 und 20 Zeichen lang sein.", 2,
			20, false));
	tfName.setRequiredError("Pflichtfeld");
	tfName.setSizeFull();
	formLayout.addComponent(tfName);
	
	//TextArea für Beschreibung dem Formular hinzufügen
	taDescription = new TextArea("Beschreibung wählen");
	taDescription.setSizeFull();
	formLayout.addComponent(taDescription);
	
	//Formular dem Layout hinzufügen
	layout.addComponent(formLayout);
	
	//Hinzufüge-Button erstllen und dem Layout hinzufügen
	dialogAddBtn = new Button("Hinzufügen", this);
	layout.addComponent(dialogAddBtn);
	
	//Layout dem Dialog-Fenster hinzufügen
	addDialog.addComponent(layout);

	//Dialog dem Hauptfenster hinzufügen
	getWindow().addWindow(addDialog);
	logger.debug("Hinzufuege-Dialog erzeugt");
}
 
開發者ID:DHBW-Karlsruhe,項目名稱:businesshorizon2,代碼行數:54,代碼來源:ProjectListViewImpl.java

示例7: showEditProjectDialog

import com.vaadin.ui.TextField; //導入方法依賴的package包/類
/**Methode zur Implementierung des Dialogfensters für Projekt-Änderungen.
 * 
 */
@Override
public void showEditProjectDialog(Project project) {
	editDialog = new Window("Projekt bearbeiten");
	editDialog.setModal(true);
	editDialog.setWidth(410, UNITS_PIXELS);
	editDialog.setResizable(false);
	editDialog.setDraggable(false);


	VerticalLayout layout = new VerticalLayout();
	layout.setSpacing(true);

	FormLayout formLayout = new FormLayout();
	formLayout.setMargin(true);
	formLayout.setSpacing(true);
	
	//TextFeld für Name dem Formular hinzufügen
	tfName = new TextField("Name ändern:", project.getName());
	tfName.setRequired(true);
	tfName.addValidator(new StringLengthValidator(
			"Der Projektname muss zwischen 2 und 20 Zeichen lang sein.", 2,
			20, false));
	tfName.setRequiredError("Pflichtfeld");
	tfName.setSizeFull();
	formLayout.addComponent(tfName);
	
	//TextArea für Beschreibung dem Formular hinzufügen
	taDescription = new TextArea("Beschreibung ändern:", project.getDescription());
	taDescription.setSizeFull();
	formLayout.addComponent(taDescription);
	
	//Formular dem Layout hinzufügen
	layout.addComponent(formLayout);
	
	//Speichern-Button erstllen und dem Layout hinzufügen
	//TODO: ist das korrekt? Gute Frage, I have no idea what u r doing
	dialogEditBtn = new Button("Speichern");
	layout.addComponent(dialogEditBtn);
	
	dialogEditBtn.addListener(new Button.ClickListener() {
		private static final long serialVersionUID = 1L;

		public void buttonClick(ClickEvent event) {
				
			if (tfName.isValid()) {
				boolean succed = presenter.editProject(projects.get(indexEditBtn), (String) tfName.getValue(), (String) taDescription.getValue());
				if (succed) {
					getWindow().removeWindow(editDialog);
					logger.debug("Projekt-bearbeiten Dialog geschlossen");
					
				}
					
			} else {
				getWindow().showNotification(
					"",
					"Projektname ist ein Pflichtfeld. Bitte geben Sie einen Projektnamen an",
					Notification.TYPE_ERROR_MESSAGE);
			}		
		}
	});
	
	//Layout dem Dialog-Fenster hinzufügen
	editDialog.addComponent(layout);

	//Dialog dem Hauptfenster hinzufügen
	getWindow().addWindow(editDialog);
	logger.debug("Bearbeiten-Dialog erzeugt");
	
}
 
開發者ID:DHBW-Karlsruhe,項目名稱:businesshorizon2,代碼行數:73,代碼來源:ProjectListViewImpl.java


注:本文中的com.vaadin.ui.TextField.setSizeFull方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。