本文整理匯總了Java中com.vaadin.ui.CheckBox.setRequired方法的典型用法代碼示例。如果您正苦於以下問題:Java CheckBox.setRequired方法的具體用法?Java CheckBox.setRequired怎麽用?Java CheckBox.setRequired使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.vaadin.ui.CheckBox
的用法示例。
在下文中一共展示了CheckBox.setRequired方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getPropertyField
import com.vaadin.ui.CheckBox; //導入方法依賴的package包/類
@Override
public Field getPropertyField(FormProperty formProperty) {
CheckBox checkBox = new CheckBox(getPropertyLabel(formProperty));
checkBox.setRequired(formProperty.isRequired());
checkBox.setEnabled(formProperty.isWritable());
if (formProperty.getValue() != null) {
checkBox.setValue(formProperty.getValue());
}
return checkBox;
}
示例2: buildHorizontalLayout_1
import com.vaadin.ui.CheckBox; //導入方法依賴的package包/類
@AutoGenerated
private HorizontalLayout buildHorizontalLayout_1() {
// common part: create layout
horizontalLayout_1 = new HorizontalLayout();
horizontalLayout_1.setImmediate(false);
horizontalLayout_1.setWidth("100.0%");
horizontalLayout_1.setHeight("-1px");
horizontalLayout_1.setMargin(false);
// logoField
logoField = new Embedded();
logoField.setCaption("Logo");
logoField.setImmediate(false);
logoField.setWidth("70px");
logoField.setHeight("60px");
logoField
.setSource(new ThemeResource("img/component/embedded_icon.png"));
logoField.setType(1);
logoField.setMimeType("image/png");
horizontalLayout_1.addComponent(logoField);
// activeField
activeField = new CheckBox();
activeField.setCaption("Activo");
activeField.setImmediate(false);
activeField.setWidth("-1px");
activeField.setHeight("-1px");
activeField.setRequired(true);
horizontalLayout_1.addComponent(activeField);
horizontalLayout_1
.setComponentAlignment(activeField, new Alignment(34));
return horizontalLayout_1;
}
示例3: buildMainLayout
import com.vaadin.ui.CheckBox; //導入方法依賴的package包/類
@AutoGenerated
private AbsoluteLayout buildMainLayout() {
// common part: create layout
mainLayout = new AbsoluteLayout();
mainLayout.setImmediate(false);
mainLayout.setWidth("580px");
mainLayout.setHeight("280px");
mainLayout.setMargin(true);
// top-level component properties
setWidth("580px");
setHeight("280px");
// activeField
activeField = new CheckBox();
activeField.setCaption("Activo");
activeField.setImmediate(false);
activeField.setWidth("-1px");
activeField.setHeight("-1px");
activeField.setRequired(true);
mainLayout.addComponent(activeField, "top:14.0px;left:507.0px;");
// commentField
commentField = new TextField();
commentField.setCaption("Comentario");
commentField.setImmediate(false);
commentField.setWidth("540px");
commentField.setHeight("160px");
mainLayout.addComponent(commentField, "top:100.0px;left:20.0px;");
// codeField
codeField = new TextField();
codeField.setCaption("Código");
codeField.setImmediate(false);
codeField.setWidth("160px");
codeField.setHeight("-1px");
codeField.setRequired(true);
mainLayout.addComponent(codeField, "top:17.0px;left:20.0px;");
// descriptionField
descriptionField = new TextField();
descriptionField.setCaption("Descripción");
descriptionField.setImmediate(false);
descriptionField.setWidth("541px");
descriptionField.setHeight("-1px");
descriptionField.setRequired(true);
mainLayout.addComponent(descriptionField, "top:56.0px;left:20.0px;");
return mainLayout;
}
示例4: buildMainLayout
import com.vaadin.ui.CheckBox; //導入方法依賴的package包/類
@AutoGenerated
private AbsoluteLayout buildMainLayout() {
// common part: create layout
mainLayout = new AbsoluteLayout();
mainLayout.setImmediate(false);
mainLayout.setWidth("560px");
mainLayout.setHeight("280px");
mainLayout.setMargin(true);
// top-level component properties
setWidth("560px");
setHeight("280px");
// activeField
activeField = new CheckBox();
activeField.setCaption("Activo");
activeField.setImmediate(false);
activeField.setWidth("-1px");
activeField.setHeight("-1px");
activeField.setTabIndex(2);
activeField.setRequired(true);
mainLayout.addComponent(activeField, "top:20.0px;left:486.0px;");
// codeField
codeField = new TextField();
codeField.setCaption("Código");
codeField.setImmediate(false);
codeField.setWidth("120px");
codeField.setHeight("-1px");
codeField.setRequired(true);
mainLayout.addComponent(codeField, "top:20.0px;left:20.0px;");
// commentField
commentField = new TextField();
commentField.setCaption("Comentarios");
commentField.setImmediate(false);
commentField.setWidth("520px");
commentField.setHeight("120px");
commentField.setTabIndex(6);
mainLayout.addComponent(commentField, "top:140.0px;left:20.0px;");
// descriptionField
descriptionField = new TextField();
descriptionField.setCaption("Descripción");
descriptionField.setImmediate(false);
descriptionField.setWidth("520px");
descriptionField.setHeight("-1px");
descriptionField.setTabIndex(3);
mainLayout.addComponent(descriptionField, "top:60.0px;left:20.0px;");
// nameField
nameField = new TextField();
nameField.setCaption("Nombre");
nameField.setImmediate(false);
nameField.setWidth("320px");
nameField.setHeight("-1px");
nameField.setTabIndex(1);
nameField.setRequired(true);
mainLayout.addComponent(nameField, "top:20.0px;left:160.0px;");
// areaTypeField
areaTypeField = new ComboBox();
areaTypeField.setCaption("Tipo Area");
areaTypeField.setImmediate(false);
areaTypeField.setWidth("-1px");
areaTypeField.setHeight("-1px");
areaTypeField.setTabIndex(4);
areaTypeField.setRequired(true);
mainLayout.addComponent(areaTypeField, "top:100.0px;left:19.0px;");
return mainLayout;
}
示例5: buildHorizontalLayoutHeader
import com.vaadin.ui.CheckBox; //導入方法依賴的package包/類
@AutoGenerated
private HorizontalLayout buildHorizontalLayoutHeader() {
// common part: create layout
horizontalLayoutHeader = new HorizontalLayout();
horizontalLayoutHeader.setImmediate(false);
horizontalLayoutHeader.setWidth("100.0%");
horizontalLayoutHeader.setHeight("-1px");
horizontalLayoutHeader.setMargin(true);
horizontalLayoutHeader.setSpacing(true);
// codeField
codeField = new TextField();
codeField.setCaption("Código");
codeField.setImmediate(false);
codeField.setWidth("100px");
codeField.setHeight("-1px");
codeField.setRequired(true);
horizontalLayoutHeader.addComponent(codeField);
// nameField
nameField = new TextField();
nameField.setCaption("Nombre Comercial");
nameField.setImmediate(false);
nameField.setWidth("100.0%");
nameField.setHeight("-1px");
nameField.setRequired(true);
horizontalLayoutHeader.addComponent(nameField);
horizontalLayoutHeader.setExpandRatio(nameField, 1.0f);
// activeField
activeField = new CheckBox();
activeField.setCaption("Activo");
activeField.setImmediate(false);
activeField.setWidth("80px");
activeField.setHeight("-1px");
activeField.setRequired(true);
horizontalLayoutHeader.addComponent(activeField);
horizontalLayoutHeader.setComponentAlignment(activeField,
new Alignment(10));
return horizontalLayoutHeader;
}
示例6: buildMainLayout
import com.vaadin.ui.CheckBox; //導入方法依賴的package包/類
@AutoGenerated
private AbsoluteLayout buildMainLayout() {
// common part: create layout
mainLayout = new AbsoluteLayout();
mainLayout.setImmediate(false);
mainLayout.setWidth("580px");
mainLayout.setHeight("280px");
mainLayout.setMargin(true);
// top-level component properties
setWidth("580px");
setHeight("280px");
// activeField
activeField = new CheckBox();
activeField.setCaption("Activo");
activeField.setImmediate(false);
activeField.setWidth("-1px");
activeField.setHeight("-1px");
activeField.setRequired(true);
mainLayout.addComponent(activeField, "top:14.0px;left:507.0px;");
// commentField
commentField = new TextField();
commentField.setCaption("Comentario");
commentField.setImmediate(true);
commentField.setWidth("540px");
commentField.setHeight("160px");
mainLayout.addComponent(commentField, "top:100.0px;left:20.0px;");
// codeField
codeField = new TextField();
codeField.setCaption("Código");
codeField.setImmediate(false);
codeField.setWidth("160px");
codeField.setHeight("-1px");
codeField.setRequired(true);
mainLayout.addComponent(codeField, "top:17.0px;left:20.0px;");
// descriptionField
descriptionField = new TextField();
descriptionField.setCaption("Descripción");
descriptionField.setImmediate(false);
descriptionField.setWidth("541px");
descriptionField.setHeight("-1px");
descriptionField.setRequired(true);
mainLayout.addComponent(descriptionField, "top:56.0px;left:20.0px;");
// menuCommandResourceField
menuCommandResourceField = new ComboBox();
menuCommandResourceField.setCaption("Módulo:");
menuCommandResourceField.setImmediate(true);
menuCommandResourceField.setWidth("280px");
menuCommandResourceField.setHeight("-1px");
menuCommandResourceField.setRequired(true);
mainLayout.addComponent(menuCommandResourceField,
"top:17.0px;left:200.0px;");
return mainLayout;
}
示例7: buildMainLayout
import com.vaadin.ui.CheckBox; //導入方法依賴的package包/類
@AutoGenerated
private AbsoluteLayout buildMainLayout() {
// common part: create layout
mainLayout = new AbsoluteLayout();
mainLayout.setImmediate(false);
mainLayout.setWidth("700px");
mainLayout.setHeight("440px");
mainLayout.setMargin(true);
// top-level component properties
setWidth("700px");
setHeight("440px");
// activeField
activeField = new CheckBox();
activeField.setCaption("Activo");
activeField.setImmediate(false);
activeField.setWidth("-1px");
activeField.setHeight("-1px");
activeField.setTabIndex(1);
activeField.setRequired(true);
mainLayout.addComponent(activeField, "top:14.0px;left:507.0px;");
// commentField
commentField = new TextField();
commentField.setCaption("Comentario");
commentField.setImmediate(false);
commentField.setWidth("540px");
commentField.setHeight("160px");
commentField.setTabIndex(3);
mainLayout.addComponent(commentField, "top:100.0px;left:20.0px;");
// passwordField
passwordField = new PasswordField();
passwordField.setCaption("Clave");
passwordField.setImmediate(false);
passwordField.setWidth("160px");
passwordField.setHeight("-1px");
passwordField.setTabIndex(2);
passwordField.setRequired(true);
mainLayout.addComponent(passwordField, "top:56.0px;left:20.0px;");
// usernameField
usernameField = new TextField();
usernameField.setCaption("Nombre usuario");
usernameField.setImmediate(false);
usernameField.setWidth("160px");
usernameField.setHeight("-1px");
usernameField.setRequired(true);
mainLayout.addComponent(usernameField, "top:17.0px;left:20.0px;");
// rolesField
rolesField = new Table();
rolesField.setCaption("Roles");
rolesField.setImmediate(false);
rolesField.setWidth("501px");
rolesField.setHeight("140px");
mainLayout.addComponent(rolesField, "top:281.0px;left:19.0px;");
// brnAdd
brnAdd = new Button();
brnAdd.setCaption("+");
brnAdd.setImmediate(true);
brnAdd.setWidth("-1px");
brnAdd.setHeight("-1px");
mainLayout.addComponent(brnAdd, "top:283.0px;left:525.0px;");
// btnRemove
btnRemove = new Button();
btnRemove.setCaption("-");
btnRemove.setImmediate(true);
btnRemove.setWidth("-1px");
btnRemove.setHeight("-1px");
mainLayout.addComponent(btnRemove, "top:320.0px;left:525.0px;");
return mainLayout;
}