本文整理汇总了Java中com.vaadin.ui.TextField.setId方法的典型用法代码示例。如果您正苦于以下问题:Java TextField.setId方法的具体用法?Java TextField.setId怎么用?Java TextField.setId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vaadin.ui.TextField
的用法示例。
在下文中一共展示了TextField.setId方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: AbstractCrudView
import com.vaadin.ui.TextField; //导入方法依赖的package包/类
public AbstractCrudView() {
form = getForm();
grid = getGrid();
service = getDataService();
dataProvider = new CrudDataProvider<>(service, getFilterBy());
filter = new TextField();
filter.setId("filterText");
filter.setPlaceholder("filtre...");
filter.addValueChangeListener(e -> {
listEntries(e.getValue());
});
Button clearFilterButton = new Button(VaadinIcons.CLOSE);
clearFilterButton.setId("clearFilterButton");
clearFilterButton.addClickListener(event -> filter.clear());
filterLayout = new CssLayout(filter, clearFilterButton);
filterLayout.addStyleName(ValoTheme.LAYOUT_COMPONENT_GROUP);
initForm();
initGrid();
if (form != null) {
addComponent(title);
if (isCreateAllowed()) {
addComponent(buttonLayout);
}
addComponent(form);
if (isFilterAllowed()) {
addComponent(filterLayout);
}
addComponentsAndExpand(grid);
} else {
if (isFilterAllowed()) {
addComponent(filterLayout);
}
addComponentsAndExpand(grid);
}
}
示例2: WebFtsField
import com.vaadin.ui.TextField; //导入方法依赖的package包/类
public WebFtsField() {
component = new CssLayout();
component.setPrimaryStyleName(FTS_FIELD_STYLENAME);
ComponentsFactory cf = AppBeans.get(ComponentsFactory.NAME);
com.haulmont.cuba.gui.components.TextField searchFieldComponent =
cf.createComponent(com.haulmont.cuba.gui.components.TextField.class);
searchField = (TextField) WebComponentsHelper.unwrap(searchFieldComponent);
searchField.setStyleName("c-ftsfield-text");
AppUI ui = AppUI.getCurrent();
if (ui.isTestMode()) {
searchField.setCubaId("ftsField");
searchField.setId(ui.getTestIdManager().reserveId("ftsField"));
}
searchField.addShortcutListener(new ShortcutListener("fts", com.vaadin.event.ShortcutAction.KeyCode.ENTER, null) {
@Override
public void handleAction(Object sender, Object target) {
openSearchWindow();
}
});
searchBtn = new CubaButton();
searchBtn.setStyleName("c-ftsfield-button");
searchBtn.setIcon(WebComponentsHelper.getIcon("app/images/fts-button.png"));
searchBtn.addClickListener(
(Button.ClickListener) event -> openSearchWindow()
);
component.addComponent(searchField);
component.addComponent(searchBtn);
adjustHeight();
adjustWidth();
}
示例3: buildUserField
import com.vaadin.ui.TextField; //导入方法依赖的package包/类
private void buildUserField() {
username = new TextField(i18n.getMessage("label.login.username"));
username.setIcon(FontAwesome.USER);
username.addStyleName(
ValoTheme.TEXTFIELD_INLINE_ICON + " " + ValoTheme.TEXTFIELD_SMALL + " " + LOGIN_TEXTFIELD);
username.setId("login-username");
}
示例4: buildTenantField
import com.vaadin.ui.TextField; //导入方法依赖的package包/类
private void buildTenantField() {
if (multiTenancyIndicator.isMultiTenancySupported()) {
tenant = new TextField(i18n.getMessage("label.login.tenant"));
tenant.setIcon(FontAwesome.DATABASE);
tenant.addStyleName(
ValoTheme.TEXTFIELD_INLINE_ICON + " " + ValoTheme.TEXTFIELD_SMALL + " " + LOGIN_TEXTFIELD);
tenant.addStyleName("uppercase");
tenant.setId("login-tenant");
}
}
示例5: 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;
}
示例6: buildLoginForm
import com.vaadin.ui.TextField; //导入方法依赖的package包/类
private Component buildLoginForm() {
FormLayout loginForm = new FormLayout();
loginForm.addStyleName(DSTheme.LOGIN_FORM);
loginForm.setSizeUndefined();
loginForm.setMargin(false);
loginForm.setId("loginForm");
username = new TextField();
username.setValue("admin");
username.setId("username");
username.setWidth(15, Unit.EM);
loginForm.addComponent(username);
password = new PasswordField();
password.setId("password");
password.setWidth(15, Unit.EM);
loginForm.addComponent(password);
CssLayout buttons = new CssLayout();
buttons.setStyleName(DSTheme.LOGIN_BUTTON_LAYOUT);
loginForm.addComponent(buttons);
loginButton = new Button();
loginButton.setId("login");
loginButton.setDisableOnClick(true);
loginButton.addClickListener(e -> {
try {
login();
} finally {
loginButton.setEnabled(true);
}
});
buttons.addComponent(loginButton);
loginButton.setClickShortcut(ShortcutAction.KeyCode.ENTER);
loginButton.addStyleName(ValoTheme.BUTTON_FRIENDLY);
forgotPassword = new Button();
forgotPassword.setId("forgotPassword");
forgotPassword.addStyleName(ValoTheme.BUTTON_LINK);
// forgotPassword.addClickListener(e -> showNotification(new Notification("Hint: Try anything")));
buttons.addComponent(forgotPassword);
newUserButton = new Button();
newUserButton.setId("newUser");
newUserButton.addClickListener(e -> {
centeringLayout.removeAllComponents();
centeringLayout.addComponent(newUserForm);
centeringLayout.setComponentAlignment(newUserForm, Alignment.MIDDLE_CENTER);
});
buttons.addComponent(newUserButton);
return loginForm;
}