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


Java TextField.setId方法代码示例

本文整理汇总了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);
        }
    }
 
开发者ID:viydaag,项目名称:dungeonstory-java,代码行数:41,代码来源:AbstractCrudView.java

示例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();
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:36,代码来源:WebFtsField.java

示例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");
}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:8,代码来源:AbstractHawkbitLoginUI.java

示例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");
    }
}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:11,代码来源:AbstractHawkbitLoginUI.java

示例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;
}
 
开发者ID:vaadin4qbanos,项目名称:vaadin-jsclipboard-addon,代码行数:9,代码来源:TextFieldView.java

示例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;
}
 
开发者ID:viydaag,项目名称:dungeonstory-java,代码行数:57,代码来源:LoginScreen.java


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