本文整理汇总了Java中org.vaadin.viritin.fields.MTextField类的典型用法代码示例。如果您正苦于以下问题:Java MTextField类的具体用法?Java MTextField怎么用?Java MTextField使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MTextField类属于org.vaadin.viritin.fields包,在下文中一共展示了MTextField类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onBecomingVisible
import org.vaadin.viritin.fields.MTextField; //导入依赖的package包/类
@Override
protected void onBecomingVisible() {
super.onBecomingVisible();
criteria = null;
content = new MVerticalLayout().withMargin(false).withSpacing(false);
nameField = new MTextField().withFullWidth().withInputPrompt(UserUIContext.getMessage(GenericI18Enum.ACTION_QUERY_BY_TEXT));
content.with(nameField);
content.with(FormSectionBuilder.build(UserUIContext.getMessage(GenericI18Enum.OPT_SHARED_TO_ME)).withStyleName("border-top"));
addSharedSearchQueryInfo(allTasksQuery);
addSharedSearchQueryInfo(allOpenTaskQuery);
addSharedSearchQueryInfo(overdueTaskQuery);
addSharedSearchQueryInfo(allClosedTaskQuery);
addSharedSearchQueryInfo(myTasksQuery);
addSharedSearchQueryInfo(tasksCreatedByMeQuery);
addSharedSearchQueryInfo(newTasksThisWeekQuery);
addSharedSearchQueryInfo(updateTasksThisWeekQuery);
addSharedSearchQueryInfo(newTasksLastWeekQuery);
addSharedSearchQueryInfo(updateTasksLastWeekQuery);
setContent(content);
}
示例2: constructBody
import org.vaadin.viritin.fields.MTextField; //导入依赖的package包/类
@Override
public ComponentContainer constructBody() {
MHorizontalLayout basicSearchBody = new MHorizontalLayout().withMargin(true);
basicSearchBody.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);
basicSearchBody.addComponent(new Label(UserUIContext.getMessage(GenericI18Enum.FORM_NAME) + ":"));
nameField = new MTextField().withInputPrompt(UserUIContext.getMessage(GenericI18Enum.ACTION_QUERY_BY_TEXT))
.withWidth(WebUIConstants.DEFAULT_CONTROL_WIDTH);
basicSearchBody.addComponent(nameField);
MButton searchBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_SEARCH), clickEvent -> callSearchAction())
.withIcon(FontAwesome.SEARCH).withStyleName(WebThemes.BUTTON_ACTION)
.withClickShortcut(ShortcutAction.KeyCode.ENTER);
basicSearchBody.addComponent(searchBtn);
MButton clearBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_CLEAR), clickEvent -> nameField.setValue(""))
.withStyleName(WebThemes.BUTTON_OPTION);
basicSearchBody.addComponent(clearBtn);
return basicSearchBody;
}
示例3: constructBody
import org.vaadin.viritin.fields.MTextField; //导入依赖的package包/类
@Override
public ComponentContainer constructBody() {
MHorizontalLayout basicSearchBody = new MHorizontalLayout().withMargin(true);
basicSearchBody.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);
Label nameLbl = new Label(UserUIContext.getMessage(GenericI18Enum.FORM_NAME) + ":");
basicSearchBody.with(nameLbl);
nameField = new MTextField().withInputPrompt(UserUIContext.getMessage(GenericI18Enum.ACTION_QUERY_BY_TEXT))
.withWidth(WebUIConstants.DEFAULT_CONTROL_WIDTH);
basicSearchBody.with(nameField);
myItemCheckbox = new CheckBox(UserUIContext.getMessage(GenericI18Enum.OPT_MY_ITEMS));
basicSearchBody.with(myItemCheckbox);
MButton searchBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_SEARCH), clickEvent -> callSearchAction())
.withIcon(FontAwesome.SEARCH).withStyleName(WebThemes.BUTTON_ACTION)
.withClickShortcut(ShortcutAction.KeyCode.ENTER);
basicSearchBody.with(searchBtn);
MButton cancelBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_CLEAR), clickEvent -> nameField.setValue(""))
.withStyleName(WebThemes.BUTTON_OPTION);
basicSearchBody.with(cancelBtn);
return basicSearchBody;
}
示例4: constructBody
import org.vaadin.viritin.fields.MTextField; //导入依赖的package包/类
@Override
public ComponentContainer constructBody() {
MHorizontalLayout basicSearchBody = new MHorizontalLayout().withMargin(true);
basicSearchBody.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);
Label nameLbl = new Label("Name:");
basicSearchBody.with(nameLbl);
nameField = new MTextField().withInputPrompt(UserUIContext.getMessage(GenericI18Enum.ACTION_QUERY_BY_TEXT))
.withWidth(WebUIConstants.DEFAULT_CONTROL_WIDTH);
basicSearchBody.with(nameField);
MButton searchBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_SEARCH), clickEvent -> callSearchAction())
.withIcon(FontAwesome.SEARCH).withStyleName(WebThemes.BUTTON_ACTION)
.withClickShortcut(ShortcutAction.KeyCode.ENTER);
basicSearchBody.with(searchBtn);
MButton cancelBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_CLEAR), clickEvent -> nameField.setValue(""))
.withStyleName(WebThemes.BUTTON_OPTION);
basicSearchBody.with(cancelBtn);
return basicSearchBody;
}
示例5: constructBody
import org.vaadin.viritin.fields.MTextField; //导入依赖的package包/类
@Override
public ComponentContainer constructBody() {
MHorizontalLayout basicSearchBody = new MHorizontalLayout().withMargin(true);
nameField = new MTextField().withInputPrompt(UserUIContext.getMessage(GenericI18Enum.ACTION_QUERY_BY_TEXT))
.withWidth(WebUIConstants.DEFAULT_CONTROL_WIDTH);
basicSearchBody.with(nameField).withAlign(nameField, Alignment.MIDDLE_CENTER);
MButton searchBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_SEARCH), clickEvent ->
callSearchAction()).withIcon(FontAwesome.SEARCH).withStyleName(WebThemes.BUTTON_ACTION)
.withClickShortcut(ShortcutAction.KeyCode.ENTER);
basicSearchBody.with(searchBtn).withAlign(searchBtn, Alignment.MIDDLE_LEFT);
MButton cancelBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_CLEAR),
clickEvent -> nameField.setValue("")).withStyleName(WebThemes.BUTTON_OPTION);
basicSearchBody.with(cancelBtn).withAlign(cancelBtn, Alignment.MIDDLE_CENTER);
MButton advancedSearchBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_ADVANCED_SEARCH),
clickEvent -> moveToAdvancedSearchLayout()).withStyleName(WebThemes.BUTTON_LINK);
basicSearchBody.with(advancedSearchBtn).withAlign(advancedSearchBtn, Alignment.MIDDLE_CENTER);
return basicSearchBody;
}
示例6: onCreateField
import org.vaadin.viritin.fields.MTextField; //导入依赖的package包/类
@Override
protected Field<?> onCreateField(Object propertyId) {
if (SimpleUser.Field.roleid.equalTo(propertyId)) {
return new AdminRoleSelectionField();
} else if (User.Field.email.equalTo(propertyId) || User.Field.firstname.equalTo(propertyId) ||
User.Field.lastname.equalTo(propertyId)) {
return new MTextField().withNullRepresentation("").withRequired(true)
.withRequiredError("This field must be not null");
} else if (propertyId.equals("dateofbirth")) {
return new DateSelectionField();
} else if (propertyId.equals("timezone")) {
return new TimeZoneSelectionField(false);
} else if (propertyId.equals("country")) {
final CountryComboBox cboCountry = new CountryComboBox();
cboCountry.addValueChangeListener(valueChangeEvent -> user.setCountry((String) cboCountry.getValue()));
return cboCountry;
} else if (User.Field.password.equalTo(propertyId)) {
return new MPasswordField();
}
return null;
}
示例7: constructBody
import org.vaadin.viritin.fields.MTextField; //导入依赖的package包/类
@Override
public ComponentContainer constructBody() {
MHorizontalLayout basicSearchBody = new MHorizontalLayout().withMargin(true)
.with(new Label(UserUIContext.getMessage(GenericI18Enum.FORM_NAME) + ":"));
nameField = new MTextField().withInputPrompt(UserUIContext.getMessage(GenericI18Enum.ACTION_QUERY_BY_TEXT))
.withWidth(WebUIConstants.DEFAULT_CONTROL_WIDTH);
basicSearchBody.addComponent(nameField);
MButton searchBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_SEARCH), clickEvent -> callSearchAction())
.withIcon(FontAwesome.SEARCH).withStyleName(WebThemes.BUTTON_ACTION)
.withClickShortcut(ShortcutAction.KeyCode.ENTER);
basicSearchBody.addComponent(searchBtn);
MButton clearBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_CLEAR), clickEvent -> nameField.setValue(""))
.withStyleName(WebThemes.BUTTON_OPTION);
basicSearchBody.addComponent(clearBtn);
basicSearchBody.setComponentAlignment(clearBtn, Alignment.MIDDLE_LEFT);
return basicSearchBody;
}
示例8: constructBody
import org.vaadin.viritin.fields.MTextField; //导入依赖的package包/类
@Override
public ComponentContainer constructBody() {
MHorizontalLayout basicSearchBody = new MHorizontalLayout().withMargin(true);
nameField = new MTextField().withInputPrompt(UserUIContext.getMessage(GenericI18Enum.ACTION_QUERY_BY_TEXT))
.withWidth(WebUIConstants.DEFAULT_CONTROL_WIDTH);
basicSearchBody.with(nameField).withAlign(nameField, Alignment.MIDDLE_CENTER);
this.myItemCheckbox = new CheckBox(UserUIContext.getMessage(GenericI18Enum.OPT_MY_ITEMS));
basicSearchBody.with(myItemCheckbox).withAlign(myItemCheckbox, Alignment.MIDDLE_CENTER);
MButton searchBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_SEARCH), clickEvent -> callSearchAction())
.withIcon(FontAwesome.SEARCH).withStyleName(WebThemes.BUTTON_ACTION)
.withClickShortcut(ShortcutAction.KeyCode.ENTER);
basicSearchBody.with(searchBtn).withAlign(searchBtn, Alignment.MIDDLE_LEFT);
MButton cancelBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_CLEAR), clickEvent -> nameField.setValue(""))
.withStyleName(WebThemes.BUTTON_OPTION);
basicSearchBody.with(cancelBtn).withAlign(cancelBtn, Alignment.MIDDLE_CENTER);
MButton advancedSearchBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_ADVANCED_SEARCH),
clickEvent -> moveToAdvancedSearchLayout()).withStyleName(WebThemes.BUTTON_LINK);
basicSearchBody.with(advancedSearchBtn).withAlign(advancedSearchBtn, Alignment.MIDDLE_CENTER);
return basicSearchBody;
}
示例9: constructBody
import org.vaadin.viritin.fields.MTextField; //导入依赖的package包/类
@Override
public ComponentContainer constructBody() {
MHorizontalLayout basicSearchBody = new MHorizontalLayout().withMargin(true);
nameField = new MTextField().withInputPrompt(UserUIContext.getMessage(GenericI18Enum.ACTION_QUERY_BY_TEXT))
.withWidth(WebUIConstants.DEFAULT_CONTROL_WIDTH);
basicSearchBody.with(nameField).withAlign(nameField, Alignment.MIDDLE_LEFT);
this.myItemCheckbox = new CheckBox(UserUIContext.getMessage(GenericI18Enum.OPT_MY_ITEMS));
basicSearchBody.with(myItemCheckbox).withAlign(myItemCheckbox, Alignment.MIDDLE_CENTER);
MButton searchBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_SEARCH), clickEvent -> callSearchAction())
.withIcon(FontAwesome.SEARCH).withStyleName(WebThemes.BUTTON_ACTION)
.withClickShortcut(ShortcutAction.KeyCode.ENTER);
basicSearchBody.with(searchBtn).withAlign(searchBtn, Alignment.MIDDLE_LEFT);
MButton clearBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_CLEAR), clickEvent -> nameField.setValue(""))
.withStyleName(WebThemes.BUTTON_OPTION);
basicSearchBody.with(clearBtn).withAlign(clearBtn, Alignment.MIDDLE_LEFT);
return basicSearchBody;
}
示例10: constructBody
import org.vaadin.viritin.fields.MTextField; //导入依赖的package包/类
@Override
public ComponentContainer constructBody() {
MHorizontalLayout basicSearchBody = new MHorizontalLayout().withMargin(true);
subjectField = new MTextField().withInputPrompt(UserUIContext.getMessage(GenericI18Enum.ACTION_QUERY_BY_TEXT))
.withWidth(WebUIConstants.DEFAULT_CONTROL_WIDTH);
basicSearchBody.with(subjectField).withAlign(subjectField, Alignment.MIDDLE_CENTER);
this.myItemCheckbox = new CheckBox(UserUIContext.getMessage(GenericI18Enum.OPT_MY_ITEMS));
basicSearchBody.with(myItemCheckbox).withAlign(myItemCheckbox, Alignment.MIDDLE_CENTER);
MButton searchBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_SEARCH), clickEvent -> callSearchAction())
.withIcon(FontAwesome.SEARCH).withStyleName(WebThemes.BUTTON_ACTION);
basicSearchBody.with(searchBtn).withAlign(searchBtn, Alignment.MIDDLE_LEFT);
MButton cancelBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_CLEAR), clickEvent -> subjectField.setValue(""))
.withStyleName(WebThemes.BUTTON_OPTION);
basicSearchBody.with(cancelBtn).withAlign(cancelBtn, Alignment.MIDDLE_CENTER);
MButton advancedSearchBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_ADVANCED_SEARCH),
clickEvent -> moveToAdvancedSearchLayout()).withStyleName(WebThemes.BUTTON_LINK);
basicSearchBody.with(advancedSearchBtn).withAlign(advancedSearchBtn, Alignment.MIDDLE_CENTER);
return basicSearchBody;
}
示例11: onBecomingVisible
import org.vaadin.viritin.fields.MTextField; //导入依赖的package包/类
@Override
protected void onBecomingVisible() {
super.onBecomingVisible();
MVerticalLayout content = new MVerticalLayout();
nameField = new MTextField().withFullWidth().withInputPrompt(UserUIContext.getMessage(GenericI18Enum.ACTION_QUERY_BY_TEXT));
content.with(nameField);
setContent(content);
}
示例12: constructBody
import org.vaadin.viritin.fields.MTextField; //导入依赖的package包/类
@Override
public ComponentContainer constructBody() {
MHorizontalLayout basicSearchBody = new MHorizontalLayout().withMargin(true);
Label nameLbl = new Label(UserUIContext.getMessage(GenericI18Enum.FORM_NAME) + ":");
basicSearchBody.with(nameLbl).withAlign(nameLbl, Alignment.MIDDLE_LEFT);
nameField = new MTextField().withInputPrompt(UserUIContext.getMessage(GenericI18Enum.ACTION_QUERY_BY_TEXT))
.withWidth(WebUIConstants.DEFAULT_CONTROL_WIDTH);
basicSearchBody.with(nameField).withAlign(nameField, Alignment.MIDDLE_CENTER);
myItemCheckbox = new CheckBox(UserUIContext.getMessage(GenericI18Enum.OPT_MY_ITEMS));
basicSearchBody.with(myItemCheckbox).withAlign(myItemCheckbox, Alignment.MIDDLE_CENTER);
MButton searchBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_SEARCH), clickEvent -> callSearchAction())
.withIcon(FontAwesome.SEARCH).withStyleName(WebThemes.BUTTON_ACTION)
.withClickShortcut(ShortcutAction.KeyCode.ENTER);
basicSearchBody.with(searchBtn).withAlign(searchBtn, Alignment.MIDDLE_LEFT);
MButton cancelBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_CLEAR), clickEvent -> nameField.setValue(""))
.withStyleName(WebThemes.BUTTON_OPTION);
basicSearchBody.with(cancelBtn).withAlign(cancelBtn, Alignment.MIDDLE_CENTER);
if (canSwitchToAdvanceLayout) {
MButton advancedSearchBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_ADVANCED_SEARCH),
clickEvent -> moveToAdvancedSearchLayout()).withStyleName(WebThemes.BUTTON_LINK);
basicSearchBody.with(advancedSearchBtn).withAlign(advancedSearchBtn, Alignment.MIDDLE_CENTER);
}
return basicSearchBody;
}
示例13: createBasicSearchLayout
import org.vaadin.viritin.fields.MTextField; //导入依赖的package包/类
private void createBasicSearchLayout() {
nameField = new MTextField().withInputPrompt(UserUIContext.getMessage(GenericI18Enum.ACTION_QUERY_BY_TEXT))
.withWidth(WebUIConstants.DEFAULT_CONTROL_WIDTH);
MButton searchBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_SEARCH), clickEvent -> doSearch())
.withStyleName(WebThemes.BUTTON_ACTION).withIcon(FontAwesome.SEARCH)
.withClickShortcut(ShortcutAction.KeyCode.ENTER);
final MHorizontalLayout basicSearchBody = new MHorizontalLayout(nameField, searchBtn).withWidthUndefined()
.withAlign(nameField, Alignment.MIDDLE_LEFT);
this.setCompositionRoot(basicSearchBody);
}
示例14: constructBody
import org.vaadin.viritin.fields.MTextField; //导入依赖的package包/类
@Override
public ComponentContainer constructBody() {
MHorizontalLayout basicSearchBody = new MHorizontalLayout().withMargin(true);
Label nameLbl = new Label(UserUIContext.getMessage(GenericI18Enum.FORM_NAME) + ":");
basicSearchBody.with(nameLbl).withAlign(nameLbl, Alignment.MIDDLE_LEFT);
nameField = new MTextField().withInputPrompt(UserUIContext.getMessage(GenericI18Enum.ACTION_QUERY_BY_TEXT))
.withWidth(WebUIConstants.DEFAULT_CONTROL_WIDTH);
basicSearchBody.with(nameField).withAlign(nameLbl, Alignment.MIDDLE_CENTER);
myItemCheckbox = new CheckBox(UserUIContext.getMessage(GenericI18Enum.OPT_MY_ITEMS));
basicSearchBody.with(myItemCheckbox).withAlign(myItemCheckbox, Alignment.MIDDLE_CENTER);
MButton searchBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_SEARCH), clickEvent -> callSearchAction())
.withIcon(FontAwesome.SEARCH).withStyleName(WebThemes.BUTTON_ACTION)
.withClickShortcut(ShortcutAction.KeyCode.ENTER);
basicSearchBody.with(searchBtn).withAlign(searchBtn, Alignment.MIDDLE_LEFT);
MButton cancelBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_CLEAR), clickEvent -> nameField.setValue(""))
.withStyleName(WebThemes.BUTTON_OPTION);
basicSearchBody.addComponent(cancelBtn);
if (canSwitchToAdvanceLayout) {
MButton advancedSearchBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_ADVANCED_SEARCH),
clickEvent -> moveToAdvancedSearchLayout()).withStyleName(WebThemes.BUTTON_LINK);
basicSearchBody.with(advancedSearchBtn).withAlign(advancedSearchBtn, Alignment.MIDDLE_CENTER);
}
return basicSearchBody;
}
示例15: onCreateField
import org.vaadin.viritin.fields.MTextField; //导入依赖的package包/类
@Override
protected Field<?> onCreateField(final Object propertyId) {
if (propertyId.equals("description")) {
return new RichTextArea();
} else if (propertyId.equals("rolename")) {
return new MTextField().withNullRepresentation("").withRequired(true)
.withRequiredError(UserUIContext.getMessage(ErrorI18nEnum.FIELD_MUST_NOT_NULL,
UserUIContext.getMessage(GenericI18Enum.FORM_NAME)));
}
return null;
}