本文整理匯總了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;
}