Java Field.setEnabled方法代码示例

本文整理汇总了Java中com.vaadin.ui.Field.setEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java Field.setEnabled方法的具体用法?Java Field.setEnabled怎么用?Java Field.setEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.vaadin.ui.Field的用法示例。


Java Field.setEnabled方法代码示例

在下文中一共展示了Field.setEnabled方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getField

import com.vaadin.ui.Field; //导入方法依赖的package包/类
/**
 * Renvoie le field construit
 * 
 * @param fieldName
 * @return
 */
private Field<?> getField(String fieldName) {
	String caption = applicationContext.getMessage("formation.table." + fieldName, null,
			UI.getCurrent().getLocale());
	Field<?> field;
	if (fieldName.equals(Formation_.motCleForm.getName())) {
		field = fieldGroup.buildAndBind(caption, fieldName, RequiredTextArea.class);
	} /*
		 * else if (fieldName.equals(Formation_.i18nInfoCompForm.getName())){ field =
		 * fieldGroup.buildAndBind(caption, fieldName, I18nField.class); }
		 */else if (fieldName.equals(Formation_.codEtpVetApoForm.getName())
			|| fieldName.equals(Formation_.codVrsVetApoForm.getName())
			|| fieldName.equals(Formation_.libApoForm.getName())) {
		if (parametreController.getIsFormCodApoOblig()) {
			field = fieldGroup.buildAndBind(caption, fieldName, true);
		} else {
			field = fieldGroup.buildAndBind(caption, fieldName);
		}
		field.setEnabled(false);
	} else {
		field = fieldGroup.buildAndBind(caption, fieldName);
	}

	field.setWidth(100, Unit.PERCENTAGE);
	return field;
} 
开发者ID:EsupPortail,项目名称:esup-ecandidat,代码行数:32,代码来源:CtrCandFormationWindow.java

示例2: configureField

import com.vaadin.ui.Field; //导入方法依赖的package包/类
/**
 * Configure the field defaults, depending on the FieldBinder settings.
 *
 * <code>
 *   field.setBuffered(isBuffered());
 *   field.setEnabled(isEnabled());
 *   if (field.getPropertyDataSource().isReadOnly()) {
 *      field.setReadOnly(true)
 *   } else { field.setReadOnly(isReadOnly()); }
 * </code>
 */
protected void configureField(Field<?> field) {
    field.setBuffered(isBuffered());
    field.setEnabled(isEnabled());

    if (field.getPropertyDataSource() != null
            && field.getPropertyDataSource().isReadOnly()) {
        field.setReadOnly(true);
    } else {
        field.setReadOnly(isReadOnly());
    }
} 
开发者ID:tyl,项目名称:field-binder,代码行数:23,代码来源:AbstractFieldBinder.java

示例3: setEnabled

import com.vaadin.ui.Field; //导入方法依赖的package包/类
/**
 * Updates the enabled state of all fields.
 *
 * @param fieldsEnabled
 *            true to enable all fields, false to disable them
 */
public void setEnabled(boolean fieldsEnabled) {
    getFieldGroup().setEnabled(fieldsEnabled);
    for (Field<?> field : getFields()) {
        field.setEnabled(fieldsEnabled);
    }
} 
开发者ID:tyl,项目名称:field-binder,代码行数:13,代码来源:AbstractFieldBinder.java

示例4: ScolTypeTraitementWindow

import com.vaadin.ui.Field; //导入方法依赖的package包/类
/**
 * Crée une fenêtre d'édition de typeTraitement
 * @param typeTraitement la typeTraitement à éditer
 */
public ScolTypeTraitementWindow(TypeTraitement typeTraitement) {
	/* Style */
	setModal(true);
	setWidth(550,Unit.PIXELS);
	setResizable(true);
	setClosable(true);

	/* Layout */
	VerticalLayout layout = new VerticalLayout();
	layout.setWidth(100, Unit.PERCENTAGE);
	layout.setMargin(true);
	layout.setSpacing(true);
	setContent(layout);

	/* Titre */
	setCaption(applicationContext.getMessage("typeTraitement.window", null, UI.getCurrent().getLocale()));

	/* Formulaire */
	fieldGroup = new CustomBeanFieldGroup<>(TypeTraitement.class);
	fieldGroup.setItemDataSource(typeTraitement);
	FormLayout formLayout = new FormLayout();
	formLayout.setWidth(100, Unit.PERCENTAGE);
	formLayout.setSpacing(true);
	for (String fieldName : FIELDS_ORDER) {
		String caption = applicationContext.getMessage("typeTraitement.table." + fieldName, null, UI.getCurrent().getLocale());
		Field<?> field = fieldGroup.buildAndBind(caption, fieldName);
		field.setWidth(100, Unit.PERCENTAGE);			
		formLayout.addComponent(field);
		if (fieldName.equals(TypeTraitement_.i18nLibTypTrait.getName())){
			field.setEnabled(true);
		}else{
			field.setEnabled(false);
		}
	}
	
	((I18nField)fieldGroup.getField(TypeTraitement_.i18nLibTypTrait.getName())).addCenterListener(e-> {if(e){center();}});

	layout.addComponent(formLayout);

	/* Ajoute les boutons */
	HorizontalLayout buttonsLayout = new HorizontalLayout();
	buttonsLayout.setWidth(100, Unit.PERCENTAGE);
	buttonsLayout.setSpacing(true);
	layout.addComponent(buttonsLayout);

	btnAnnuler = new OneClickButton(applicationContext.getMessage("btnAnnuler", null, UI.getCurrent().getLocale()), FontAwesome.TIMES);
	btnAnnuler.addClickListener(e -> close());
	buttonsLayout.addComponent(btnAnnuler);
	buttonsLayout.setComponentAlignment(btnAnnuler, Alignment.MIDDLE_LEFT);

	btnEnregistrer = new OneClickButton(applicationContext.getMessage("btnSave", null, UI.getCurrent().getLocale()), FontAwesome.SAVE);
	btnEnregistrer.addStyleName(ValoTheme.BUTTON_PRIMARY);		
	btnEnregistrer.addClickListener(e -> {
		try {
			/* Valide la saisie */
			fieldGroup.commit();
			/* Enregistre la typeTraitement saisie */
			nomenclatureTypeController.saveTypeTraitement(typeTraitement);
			/* Ferme la fenêtre */
			close();
		} catch (CommitException ce) {
		}
	});
	buttonsLayout.addComponent(btnEnregistrer);
	buttonsLayout.setComponentAlignment(btnEnregistrer, Alignment.MIDDLE_RIGHT);

	/* Centre la fenêtre */
	center();
} 
开发者ID:EsupPortail,项目名称:esup-ecandidat,代码行数:74,代码来源:ScolTypeTraitementWindow.java

示例5: ScolTypeStatutWindow

import com.vaadin.ui.Field; //导入方法依赖的package包/类
/**
 * Crée une fenêtre d'édition de typeStatut
 * @param typeStatut la typeStatut à éditer
 */
public ScolTypeStatutWindow(TypeStatut typeStatut) {
	/* Style */
	setModal(true);
	setWidth(550,Unit.PIXELS);
	setResizable(true);
	setClosable(true);

	/* Layout */
	VerticalLayout layout = new VerticalLayout();
	layout.setWidth(100, Unit.PERCENTAGE);
	layout.setMargin(true);
	layout.setSpacing(true);
	setContent(layout);

	/* Titre */
	setCaption(applicationContext.getMessage("typeStatut.window", null, UI.getCurrent().getLocale()));

	/* Formulaire */
	fieldGroup = new CustomBeanFieldGroup<>(TypeStatut.class);
	fieldGroup.setItemDataSource(typeStatut);
	FormLayout formLayout = new FormLayout();
	formLayout.setWidth(100, Unit.PERCENTAGE);
	formLayout.setSpacing(true);
	for (String fieldName : FIELDS_ORDER) {
		String caption = applicationContext.getMessage("typeStatut.table." + fieldName, null, UI.getCurrent().getLocale());
		Field<?> field = fieldGroup.buildAndBind(caption, fieldName);
		field.setWidth(100, Unit.PERCENTAGE);			
		formLayout.addComponent(field);
		if (fieldName.equals(TypeStatut_.i18nLibTypStatut.getName()) || fieldName.equals(TypeStatut_.temCommVisible.getName())){
			field.setEnabled(true);
		}else{
			field.setEnabled(false);
		}
	}
	
	((I18nField)fieldGroup.getField(TypeStatut_.i18nLibTypStatut.getName())).addCenterListener(e-> {if(e){center();}});

	layout.addComponent(formLayout);

	/* Ajoute les boutons */
	HorizontalLayout buttonsLayout = new HorizontalLayout();
	buttonsLayout.setWidth(100, Unit.PERCENTAGE);
	buttonsLayout.setSpacing(true);
	layout.addComponent(buttonsLayout);

	btnAnnuler = new OneClickButton(applicationContext.getMessage("btnAnnuler", null, UI.getCurrent().getLocale()), FontAwesome.TIMES);
	btnAnnuler.addClickListener(e -> close());
	buttonsLayout.addComponent(btnAnnuler);
	buttonsLayout.setComponentAlignment(btnAnnuler, Alignment.MIDDLE_LEFT);

	btnEnregistrer = new OneClickButton(applicationContext.getMessage("btnSave", null, UI.getCurrent().getLocale()), FontAwesome.SAVE);
	btnEnregistrer.addStyleName(ValoTheme.BUTTON_PRIMARY);		
	btnEnregistrer.addClickListener(e -> {
		try {
			/* Valide la saisie */
			fieldGroup.commit();
			/* Enregistre la typeStatut saisie */
			typeStatutController.saveTypeStatut(typeStatut);
			/* Ferme la fenêtre */
			close();
		} catch (CommitException ce) {
		}
	});
	buttonsLayout.addComponent(btnEnregistrer);
	buttonsLayout.setComponentAlignment(btnEnregistrer, Alignment.MIDDLE_RIGHT);

	/* Centre la fenêtre */
	center();
} 
开发者ID:EsupPortail,项目名称:esup-ecandidat,代码行数:74,代码来源:ScolTypeStatutWindow.java

示例6: ScolTypeStatutPieceWindow

import com.vaadin.ui.Field; //导入方法依赖的package包/类
/**
 * Crée une fenêtre d'édition de typeStatutPiece
 * @param typeStatutPiece la typeStatutPiece à éditer
 */
public ScolTypeStatutPieceWindow(TypeStatutPiece typeStatutPiece) {
	/* Style */
	setModal(true);
	setWidth(550,Unit.PIXELS);
	setResizable(true);
	setClosable(true);

	/* Layout */
	VerticalLayout layout = new VerticalLayout();
	layout.setWidth(100, Unit.PERCENTAGE);
	layout.setMargin(true);
	layout.setSpacing(true);
	setContent(layout);

	/* Titre */
	setCaption(applicationContext.getMessage("typeStatutPiece.window", null, UI.getCurrent().getLocale()));

	/* Formulaire */
	fieldGroup = new CustomBeanFieldGroup<>(TypeStatutPiece.class);
	fieldGroup.setItemDataSource(typeStatutPiece);
	FormLayout formLayout = new FormLayout();
	formLayout.setWidth(100, Unit.PERCENTAGE);
	formLayout.setSpacing(true);
	for (String fieldName : FIELDS_ORDER) {
		String caption = applicationContext.getMessage("typeStatutPiece.table." + fieldName, null, UI.getCurrent().getLocale());
		Field<?> field = fieldGroup.buildAndBind(caption, fieldName);
		field.setWidth(100, Unit.PERCENTAGE);			
		formLayout.addComponent(field);
		if (fieldName.equals(TypeStatutPiece_.i18nLibTypStatutPiece.getName())){
			field.setEnabled(true);
		}else{
			field.setEnabled(false);
		}
	}
	
	((I18nField)fieldGroup.getField(TypeStatutPiece_.i18nLibTypStatutPiece.getName())).addCenterListener(e-> {if(e){center();}});

	layout.addComponent(formLayout);

	/* Ajoute les boutons */
	HorizontalLayout buttonsLayout = new HorizontalLayout();
	buttonsLayout.setWidth(100, Unit.PERCENTAGE);
	buttonsLayout.setSpacing(true);
	layout.addComponent(buttonsLayout);

	btnAnnuler = new OneClickButton(applicationContext.getMessage("btnAnnuler", null, UI.getCurrent().getLocale()), FontAwesome.TIMES);
	btnAnnuler.addClickListener(e -> close());
	buttonsLayout.addComponent(btnAnnuler);
	buttonsLayout.setComponentAlignment(btnAnnuler, Alignment.MIDDLE_LEFT);

	btnEnregistrer = new OneClickButton(applicationContext.getMessage("btnSave", null, UI.getCurrent().getLocale()), FontAwesome.SAVE);
	btnEnregistrer.addStyleName(ValoTheme.BUTTON_PRIMARY);		
	btnEnregistrer.addClickListener(e -> {
		try {
			/* Valide la saisie */
			fieldGroup.commit();
			/* Enregistre la typeStatutPiece saisie */
			typeStatutController.saveTypeStatutPiece(typeStatutPiece);
			/* Ferme la fenêtre */
			close();
		} catch (CommitException ce) {
		}
	});
	buttonsLayout.addComponent(btnEnregistrer);
	buttonsLayout.setComponentAlignment(btnEnregistrer, Alignment.MIDDLE_RIGHT);

	/* Centre la fenêtre */
	center();
} 
开发者ID:EsupPortail,项目名称:esup-ecandidat,代码行数:74,代码来源:ScolTypeStatutPieceWindow.java

示例7: ScolMessageWindow

import com.vaadin.ui.Field; //导入方法依赖的package包/类
/**
 * Crée une fenêtre d'édition de message
 * @param message la message à éditer
 */
public ScolMessageWindow(Message message) {
	/* Style */
	setModal(true);
	setWidth(850,Unit.PIXELS);
	setResizable(true);
	setClosable(true);

	/* Layout */
	VerticalLayout layout = new VerticalLayout();
	layout.setWidth(100, Unit.PERCENTAGE);
	layout.setMargin(true);
	layout.setSpacing(true);
	setContent(layout);

	/* Titre */
	setCaption(applicationContext.getMessage("message.window", null, UI.getCurrent().getLocale()));

	/* Formulaire */
	fieldGroup = new CustomBeanFieldGroup<>(Message.class);
	fieldGroup.setItemDataSource(message);
	FormLayout formLayout = new FormLayout();
	formLayout.setWidth(100, Unit.PERCENTAGE);
	formLayout.setSpacing(true);
	for (String fieldName : FIELDS_ORDER) {
		String caption = applicationContext.getMessage("message.table." + fieldName, null, UI.getCurrent().getLocale());
		Field<?> field = fieldGroup.buildAndBind(caption, fieldName);
		field.setWidth(100, Unit.PERCENTAGE);			
		formLayout.addComponent(field);
		if (fieldName.equals(Message_.codMsg.getName())){
			field.setEnabled(false);
		}
	}
	
	((I18nField)fieldGroup.getField(Message_.i18nValMessage.getName())).addCenterListener(e-> {if(e){center();}});

	layout.addComponent(formLayout);

	/* Ajoute les boutons */
	HorizontalLayout buttonsLayout = new HorizontalLayout();
	buttonsLayout.setWidth(100, Unit.PERCENTAGE);
	buttonsLayout.setSpacing(true);
	layout.addComponent(buttonsLayout);

	btnAnnuler = new OneClickButton(applicationContext.getMessage("btnAnnuler", null, UI.getCurrent().getLocale()), FontAwesome.TIMES);
	btnAnnuler.addClickListener(e -> close());
	buttonsLayout.addComponent(btnAnnuler);
	buttonsLayout.setComponentAlignment(btnAnnuler, Alignment.MIDDLE_LEFT);

	btnEnregistrer = new OneClickButton(applicationContext.getMessage("btnSave", null, UI.getCurrent().getLocale()), FontAwesome.SAVE);
	btnEnregistrer.addStyleName(ValoTheme.BUTTON_PRIMARY);		
	btnEnregistrer.addClickListener(e -> {
		try {		
			/* Valide la saisie */
			fieldGroup.commit();
			/* Enregistre la message saisie */
			messageController.saveMessage(message);
			/* Ferme la fenêtre */
			close();
		} catch (CommitException ce) {
		}
	});
	buttonsLayout.addComponent(btnEnregistrer);
	buttonsLayout.setComponentAlignment(btnEnregistrer, Alignment.MIDDLE_RIGHT);

	/* Centre la fenêtre */
	center();
} 
开发者ID:EsupPortail,项目名称:esup-ecandidat,代码行数:72,代码来源:ScolMessageWindow.java

示例8: windowContent

import com.vaadin.ui.Field; //导入方法依赖的package包/类
private VerticalLayout windowContent(Player player, boolean admin) {
	VerticalLayout root = new VerticalLayout();
	root.setMargin(true);

	HorizontalLayout formsContainer = new HorizontalLayout();
	formsContainer.setSpacing(true);

	FieldGroup fieldGroup = new BeanFieldGroup<Player>(Player.class);
	fieldGroup.setItemDataSource(new BeanItem<Player>(player));

	final FormLayout content1 = new FormLayout();
	Field<?> buildAndBind = fieldGroup.buildAndBind(I18n.t("player.number"), "number");
	buildAndBind.setEnabled(admin);
	content1.addComponent(buildAndBind);
	buildAndBind = fieldGroup.buildAndBind(I18n.t("player.firstName"), "firstName");
	buildAndBind.setEnabled(admin);
	content1.addComponent(buildAndBind);
	buildAndBind = fieldGroup.buildAndBind(I18n.t("player.lastName"), "lastName");
	buildAndBind.setEnabled(admin);
	content1.addComponent(buildAndBind);
	buildAndBind = fieldGroup.buildAndBind(I18n.t("player.position"), "position");
	buildAndBind.setEnabled(admin);
	content1.addComponent(buildAndBind);
	buildAndBind = fieldGroup.buildAndBind(I18n.t("player.position2"), "position2");
	buildAndBind.setEnabled(admin);
	content1.addComponent(buildAndBind);
	buildAndBind = fieldGroup.buildAndBind(I18n.t("player.role"), "role");
	buildAndBind.setEnabled(admin);
	content1.addComponent(buildAndBind);
	formsContainer.addComponent(content1);

	final FormLayout content2 = new FormLayout();
	content2.addComponent(fieldGroup.buildAndBind(I18n.t("player.birthdate"), "birthdate"));
	content2.addComponent(fieldGroup.buildAndBind(I18n.t("player.heightCm"), "height"));
	TextField email = new TextField(I18n.t("player.email"), player.getUser() != null
			&& player.getUser().getEmail() != null ? player.getUser().getEmail() : "");
	email.setEnabled(false);
	content2.addComponent(email);
	content2.addComponent(fieldGroup.buildAndBind(I18n.t("player.phone"), "phone"));
	content2.addComponent(fieldGroup.buildAndBind(I18n.t("player.comment"), "comment"));
	formsContainer.addComponent(content2);

	root.addComponent(formsContainer);

	HorizontalLayout footer = new HorizontalLayout();
	footer.setWidth("100%");
	footer.setSpacing(true);
	footer.addStyleName(ValoTheme.WINDOW_BOTTOM_TOOLBAR);

	Label footerText = new Label();

	Button ok = new Button(I18n.t("ok"));
	ok.addStyleName(ValoTheme.BUTTON_PRIMARY);
	ok.addClickListener(event -> {
		try {
			fieldGroup.commit();
			this.savedModel = playerService.save(player);
			EditPlayerWindow.this.close();
			BBPlay.info(I18n.t("saveOk"));
		} catch (CommitException e) {
			BBPlay.error(I18n.t("saveFail"));
		}

	});

	Button cancel = new Button(I18n.t("cancel"));
	cancel.addClickListener(event -> EditPlayerWindow.this.close());

	footer.addComponents(footerText, ok, cancel);
	footer.setExpandRatio(footerText, 1);

	root.addComponent(footer);

	return root;
} 
开发者ID:Horuss,项目名称:bbplay,代码行数:76,代码来源:EditPlayerWindow.java

示例9: configureField

import com.vaadin.ui.Field; //导入方法依赖的package包/类
protected void configureField(Field<?> field) {
    field.setParent(this);
    field.setBuffered(isEditorBuffered());
    field.setEnabled(isEnabled());
} 
开发者ID:cuba-platform,项目名称:cuba,代码行数:6,代码来源:CubaGrid.java

示例10: resetField

import com.vaadin.ui.Field; //导入方法依赖的package包/类
/**
 * Clear field status:
 *
 * <code>
 *      field.setBuffered(false);
 *      field.setEnabled(true);
 *      field.setReadOnly(false);
 *      field.setValue(null);
 * </code>
 */
protected void resetField(Field<?> field) {
    field.setBuffered(false);
    field.setEnabled(true);
    field.setReadOnly(false);
    field.setValue(null);
} 
开发者ID:tyl,项目名称:field-binder,代码行数:17,代码来源:AbstractFieldBinder.java

本文标签属性:

示例:示例是什么意思

代码:代码是什么

java:java自行车

setEnabled:setenabledofmixer1to1翻译

上一篇:PHP User::init方法代码示例
下一篇:Python ipywidgets.FloatSlider方法代码示例

为您推荐