本文整理汇总了Java中com.vaadin.ui.Field.setVisible方法的典型用法代码示例。如果您正苦于以下问题:Java Field.setVisible方法的具体用法?Java Field.setVisible怎么用?Java Field.setVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vaadin.ui.Field
的用法示例。
在下文中一共展示了Field.setVisible方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildAndBindField
import com.vaadin.ui.Field; //导入方法依赖的package包/类
/**
* Method called to generate and bind the Field component corresponding to a
* scalar property
* @param label
* @param propId
* @param prop
* @return the generated Field object
*/
protected Field<?> buildAndBindField(String label, String propId, Property<?> prop)
{
Field<?> field = fieldGroup.buildAndBind(label, propId);
Class<?> propType = prop.getType();
if (propId.equals(PROP_ID))
field.setReadOnly(true);
else if (propId.endsWith("." + PROP_ID))
field.setVisible(false);
else if (propId.endsWith("." + PROP_NAME))
field.setVisible(false);
else if (propId.endsWith(PROP_ENABLED))
field.setVisible(false);
else if (propId.endsWith(PROP_MODULECLASS))
field.setReadOnly(true);
if (propType.equals(String.class))
field.setWidth(500, Unit.PIXELS);
else if (propType.equals(int.class) || propType.equals(Integer.class) ||
propType.equals(float.class) || propType.equals(Float.class) ||
propType.equals(double.class) || propType.equals(Double.class))
field.setWidth(200, Unit.PIXELS);
else if (Enum.class.isAssignableFrom(propType))
((ListSelect)field).setRows(3);
if (field instanceof TextField) {
((TextField)field).setNullSettingAllowed(true);
((TextField)field).setNullRepresentation("");
}
return field;
}
示例2: buildAndBindField
import com.vaadin.ui.Field; //导入方法依赖的package包/类
protected Field<?> buildAndBindField(String label, String propId, Property<?> prop)
{
Field<Object> field = (Field<Object>)super.buildAndBindField(label, propId, prop);
if (propId.equals(PROP_STORAGE_PATH))
field.setVisible(false);
else if (propId.equals(PROP_DATASRC_ID))
{
field = makeModuleSelectField(field, IDataProducerModule.class);
field.addValidator(new StringLengthValidator(MSG_REQUIRED_FIELD, 1, 256, false));
}
return field;
}
示例3: buildAndBindField
import com.vaadin.ui.Field; //导入方法依赖的package包/类
protected Field<?> buildAndBindField(String label, String propId, Property<?> prop)
{
Field<Object> field = (Field<Object>)super.buildAndBindField(label, propId, prop);
if (propId.endsWith(PROP_ENDPOINT))
{
field.addValidator(new StringLengthValidator(MSG_REQUIRED_FIELD, 1, 256, false));
}
else if (propId.endsWith(PROP_ENABLED))
{
field.setVisible(true);
}
else if (propId.endsWith(PROP_URI))
{
field.addValidator(new StringLengthValidator(MSG_REQUIRED_FIELD, 1, 256, false));
}
else if (propId.endsWith(PROP_STORAGEID))
{
field = makeModuleSelectField(field, IStorageModule.class);
}
else if (propId.endsWith(PROP_SENSORID))
{
field = makeModuleSelectField(field, ISensorModule.class);
field.addValidator(new StringLengthValidator(MSG_REQUIRED_FIELD, 1, 256, false));
}
else if (propId.endsWith(PROP_DATAPROVIDERS + PROP_SEP + PROP_NAME))
field.setVisible(true);
return field;
}
示例4: buildAndBindField
import com.vaadin.ui.Field; //导入方法依赖的package包/类
@Override
protected Field<?> buildAndBindField(String label, String propId, Property<?> prop)
{
Field<?> field = super.buildAndBindField(label, propId, prop);
if (propId.endsWith(UIConstants.PROP_ID))
field.setVisible(false);
else if (propId.endsWith(UIConstants.PROP_NAME))
field.setVisible(false);
else if (propId.endsWith(UIConstants.PROP_ENABLED))
field.setVisible(false);
return field;
}