Java FormLayout.setSizeUndefined方法代码示例

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


Java FormLayout.setSizeUndefined方法代码示例

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

示例1: createValidateWindow

import com.vaadin.ui.FormLayout; //导入方法依赖的package包/类
/**
 *
 * Returns a Delete window using provided Content and Caption.It will have a Force Delete check box along with
 * Cancel and Ok Buttons.
 * The cancel button defaults to closing the window. You can customize behavior of OK,Cancel and Force Delete
 * components by calling @link {@link VmidcWindow#getComponentModel()} and setting a different
 * listener to that component
 *
 * @param caption
 *            Window's Caption
 * @param content
 *            Window's Content
 * @return
 *         Window Object
 */
public static VmidcWindow<OkCancelValidateButtonModel> createValidateWindow(String caption, String content) {
    final VmidcWindow<OkCancelValidateButtonModel> validateWindow = new VmidcWindow<OkCancelValidateButtonModel>(
            new OkCancelValidateButtonModel());
    validateWindow.setCaption(caption);
    validateWindow.getComponentModel().setCancelClickedListener(new ClickListener() {
        /**
         *
         */
        private static final long serialVersionUID = -1166844267835596823L;

        @Override
        public void buttonClick(ClickEvent event) {
            validateWindow.close();
        }
    });
    Label contentLabel = new Label(content);
    contentLabel.setContentMode(ContentMode.HTML);

    FormLayout form = new FormLayout();
    form.setMargin(true);
    form.setSizeUndefined();
    form.addComponent(contentLabel);

    validateWindow.setContent(form);
    return validateWindow;
} 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:42,代码来源:WindowUtil.java

示例2: createAlertWindow

import com.vaadin.ui.FormLayout; //导入方法依赖的package包/类
/**
 * Returns a simple window with the specified caption and content(which can be HTML) with an OK and Cancel Buttons.
 * The cancel button defaults to closing the window.
 * This behaviour can be modified by calling @link {@link VmidcWindow#getComponentModel()} and setting a different
 * listener to the cancel button
 *
 * @param caption
 *            the caption
 * @param content
 *            the content
 * @return the handle to window object
 */
public static VmidcWindow<OkCancelButtonModel> createAlertWindow(String caption, String content) {
    final VmidcWindow<OkCancelButtonModel> alertWindow = new VmidcWindow<OkCancelButtonModel>(
            new OkCancelButtonModel());
    alertWindow.setCaption(caption);
    alertWindow.getComponentModel().setCancelClickedListener(new ClickListener() {

        /**
         *
         */
        private static final long serialVersionUID = 98853982893459323L;

        @Override
        public void buttonClick(ClickEvent event) {
            alertWindow.close();
        }
    });
    Label contentLabel = new Label(content);
    contentLabel.setContentMode(ContentMode.HTML);

    FormLayout form = new FormLayout();
    form.setMargin(true);
    form.setSizeUndefined();
    form.addComponent(contentLabel);

    alertWindow.setContent(form);
    return alertWindow;
} 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:40,代码来源:WindowUtil.java

示例3: createEditFields

import com.vaadin.ui.FormLayout; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
protected ComponentContainer createEditFields() {
    final FormLayout form = new ExtaFormLayout();
    form.setSizeUndefined();

    valueField = new EditField("Значение", "Введите целое число.");
    valueField.setColumns(15);
    valueField.setRequired(true);
    valueField.addValidator(new RangeValidator<>("Неподходящее значение", Long.class, 0L, java.lang.Long.MAX_VALUE));
    //valueField.setConverter(new StringToLongConverter());
    form.addComponent(valueField);

    return form;
} 
开发者ID:ExtaSoft,项目名称:extacrm,代码行数:16,代码来源:GetValueWindowLong.java

示例4: AdminLangueWindow

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

	/* Layout */
	VerticalLayout layout = new VerticalLayout();
	layout.setMargin(true);
	layout.setSpacing(true);
	setContent(layout);

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

	/* Formulaire */
	fieldGroup = new CustomBeanFieldGroup<>(Langue.class);
	fieldGroup.setItemDataSource(langue);
	FormLayout formLayout = new FormLayout();
	formLayout.setSpacing(true);
	formLayout.setSizeUndefined();
	for (String fieldName : LANGUE_FIELDS_ORDER) {
		formLayout.addComponent(fieldGroup.buildAndBind(applicationContext.getMessage("langue.table." + fieldName, null, UI.getCurrent().getLocale()), fieldName));
	}

	fieldGroup.getField(Langue_.codLangue.getName()).setReadOnly(true);
	fieldGroup.getField(Langue_.libLangue.getName()).setReadOnly(true);
	if (langue.getCodLangue().equals(NomenclatureUtils.LANGUE_FR)){
		fieldGroup.getField(Langue_.tesLangue.getName()).setEnabled(false);
	}

	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 langue saisie */
			langueController.saveLangue(langue);
			/* 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,代码行数:69,代码来源:AdminLangueWindow.java

示例5: init

import com.vaadin.ui.FormLayout; //导入方法依赖的package包/类
@SuppressWarnings("serial")
@Override
protected void init(VaadinRequest request) {

	getUI().setLocale(BBPlay.getLanguage(request.getLocale().getLanguage()));
	I18n.init(i18n);
	getPage().setTitle("BBPlay");

	String token = request.getParameter("token");
	if (token == null || token.isEmpty()) {
		BBPlay.error(I18n.t("noToken"));
		return;
	}
	User user = userService.checkToken(token);
	if (user == null) {
		BBPlay.error(I18n.t("wrongPasswordToken"));
		return;
	}

	FormLayout loginForm = new FormLayout();
	loginForm.setSizeUndefined();

	passwordField = new PasswordField(I18n.t("changePassword.new"));
	passwordFieldRepeat = new PasswordField(I18n.t("changePassword.confirm"));
	passwordFieldRepeat.setImmediate(false);
	passwordFieldRepeat.addValidator(new AbstractStringValidator(I18n
			.t("changePassword.errorMatch")) {
		@Override
		protected boolean isValidValue(String value) {
			return value.equals(passwordField.getValue());
		}
	});
	reset = new Button(I18n.t("reset"));

	loginForm.addComponent(passwordField);
	loginForm.addComponent(passwordFieldRepeat);
	loginForm.addComponent(reset);

	reset.addStyleName(ValoTheme.BUTTON_PRIMARY);
	reset.setClickShortcut(ShortcutAction.KeyCode.ENTER);
	reset.addClickListener(event -> reset(user));

	VerticalLayout loginLayout = new VerticalLayout();
	loginLayout.setSpacing(true);
	loginLayout.setSizeUndefined();

	loginLayout.addComponent(loginForm);
	loginLayout.setComponentAlignment(loginForm, Alignment.TOP_CENTER);

	VerticalLayout rootLayout = new VerticalLayout(loginLayout);
	rootLayout.setSizeFull();
	rootLayout.setComponentAlignment(loginLayout, Alignment.MIDDLE_CENTER);
	setContent(rootLayout);
	setSizeFull();

} 
开发者ID:Horuss,项目名称:bbplay,代码行数:57,代码来源:PasswordUI.java

示例6: init

import com.vaadin.ui.FormLayout; //导入方法依赖的package包/类
@Override
protected void init(VaadinRequest request) {

	if (!(SecurityContextHolder.getContext().getAuthentication() instanceof AnonymousAuthenticationToken)) {
		getUI().getPage().setLocation("/#!");
	}

	getUI().setLocale(BBPlay.getLanguage(request.getLocale().getLanguage()));
	I18n.init(i18n);
	getPage().setTitle("BBPlay");

	FormLayout loginForm = new FormLayout();
	loginForm.setSizeUndefined();

	userName = new TextField(I18n.t("username"));
	passwordField = new PasswordField(I18n.t("password"));
	rememberMe = new CheckBox(I18n.t("rememberMe"));
	login = new Button(I18n.t("login"));
	forgetPassword = new Button(I18n.t("forgetPassword"));
	
	loginForm.addComponent(userName);
	loginForm.addComponent(passwordField);
	loginForm.addComponent(new LanguageComboBox(getUI().getLocale()));
	loginForm.addComponent(rememberMe);
	loginForm.addComponent(login);
	loginForm.addComponent(forgetPassword);
	
	forgetPassword.addStyleName(ValoTheme.BUTTON_LINK);
	forgetPassword.addClickListener(event -> UI.getCurrent().addWindow(new ForgetPasswordWindow(userService)));
	
	login.addStyleName(ValoTheme.BUTTON_PRIMARY);
	login.setDisableOnClick(true);
	login.setClickShortcut(ShortcutAction.KeyCode.ENTER);
	login.addClickListener(event -> login());

	VerticalLayout loginLayout = new VerticalLayout();
	loginLayout.setSpacing(true);
	loginLayout.setSizeUndefined();
	
	loginLayout.addComponent(msgLabel = new Label());
	loginLayout.setComponentAlignment(msgLabel, Alignment.BOTTOM_CENTER);
	msgLabel.setSizeUndefined();
	msgLabel.setVisible(false);

	if (request.getParameter("logout") != null) {
		msgLabel.setValue(I18n.t("loggedOut"));
		msgLabel.addStyleName(ValoTheme.LABEL_SUCCESS);
		msgLabel.setVisible(true);
	}
	
	if (request.getParameter("changed") != null) {
		msgLabel.setValue(I18n.t("changePassword.success"));
		msgLabel.addStyleName(ValoTheme.LABEL_SUCCESS);
		msgLabel.setVisible(true);
	}

	loginLayout.addComponent(loginForm);
	loginLayout.setComponentAlignment(loginForm, Alignment.TOP_CENTER);

	VerticalLayout rootLayout = new VerticalLayout(loginLayout);
	rootLayout.setSizeFull();
	rootLayout.setComponentAlignment(loginLayout, Alignment.MIDDLE_CENTER);
	setContent(rootLayout);
	setSizeFull();
} 
开发者ID:Horuss,项目名称:bbplay,代码行数:66,代码来源:LoginUI.java

示例7: buildLoginForm

import com.vaadin.ui.FormLayout; //导入方法依赖的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

示例8: init

import com.vaadin.ui.FormLayout; //导入方法依赖的package包/类
@Override
 protected void init(VaadinRequest request) {
 	
 	setLocale(Locale.ENGLISH);

     FormLayout loginForm = new FormLayout();
     loginForm.setSizeUndefined();

     loginForm.addComponent(userName = new TextField("Username"));
     loginForm.addComponent(passwordField = new PasswordField("Password"));
     loginForm.addComponent(rememberMe = new CheckBox("Remember me"));
     loginForm.addComponent(login = new Button("Login"));
     login.addStyleName(ValoTheme.BUTTON_PRIMARY);
     login.setDisableOnClick(true);
     login.setClickShortcut(ShortcutAction.KeyCode.ENTER);
     login.addClickListener(new Button.ClickListener() {
         /**
 * 
 */
private static final long serialVersionUID = 7813011112417170727L;

@Override
         public void buttonClick(Button.ClickEvent event) {
             login();
         }
     });

     VerticalLayout loginLayout = new VerticalLayout();
     loginLayout.setSpacing(true);
     loginLayout.setSizeUndefined();

     if (request.getParameter("logout") != null) {
         loggedOutLabel = new Label("You have been logged out!");
         loggedOutLabel.addStyleName(ValoTheme.LABEL_SUCCESS);
         loggedOutLabel.setSizeUndefined();
         loginLayout.addComponent(loggedOutLabel);
         loginLayout.setComponentAlignment(loggedOutLabel, Alignment.BOTTOM_CENTER);
     }

     loginLayout.addComponent(loginFailedLabel = new Label());
     loginLayout.setComponentAlignment(loginFailedLabel, Alignment.BOTTOM_CENTER);
     loginFailedLabel.setSizeUndefined();
     loginFailedLabel.addStyleName(ValoTheme.LABEL_FAILURE);
     loginFailedLabel.setVisible(false);

     loginLayout.addComponent(loginForm);
     loginLayout.setComponentAlignment(loginForm, Alignment.TOP_CENTER);

     VerticalLayout rootLayout = new VerticalLayout(loginLayout);
     rootLayout.setSizeFull();
     rootLayout.setComponentAlignment(loginLayout, Alignment.MIDDLE_CENTER);
     setContent(rootLayout);
     setSizeFull();
 } 
开发者ID:xyfreemind,项目名称:trader,代码行数:55,代码来源:LoginUI.java

示例9: initLayout

import com.vaadin.ui.FormLayout; //导入方法依赖的package包/类
private void initLayout() {
    FormLayout loginForm = new FormLayout();
    loginForm.setSizeUndefined();
    userName = new TextField("Username");
    passwordField = new PasswordField("Password");
    login = new Button("Login");
    loginForm.addComponent(userName);
    loginForm.addComponent(passwordField);
    loginForm.addComponent(login);
    login.addStyleName(ValoTheme.BUTTON_PRIMARY);
    login.setDisableOnClick(true);
    login.setClickShortcut(ShortcutAction.KeyCode.ENTER);
    login.addClickListener(new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent event) {
            login();
        }
    });

    VerticalLayout loginLayout = new VerticalLayout();
    loginLayout.setSizeUndefined();
    
    loginFailedLabel = new Label();
    loginLayout.addComponent(loginFailedLabel);
    loginLayout.setComponentAlignment(loginFailedLabel, Alignment.BOTTOM_CENTER);
    loginFailedLabel.setSizeUndefined();
    loginFailedLabel.addStyleName(ValoTheme.LABEL_FAILURE);
    loginFailedLabel.setVisible(false);

    loggedOutLabel = new Label("Good bye!");
    loginLayout.addComponent(loggedOutLabel);
    loginLayout.setComponentAlignment(loggedOutLabel, Alignment.BOTTOM_CENTER);
    loggedOutLabel.setSizeUndefined();
    loggedOutLabel.addStyleName(ValoTheme.LABEL_SUCCESS);
    loggedOutLabel.setVisible(false);

    loginLayout.addComponent(loginForm);
    loginLayout.setComponentAlignment(loginForm, Alignment.TOP_CENTER);

    VerticalLayout rootLayout = new VerticalLayout(loginLayout);
    rootLayout.setSizeFull();
    rootLayout.setComponentAlignment(loginLayout, Alignment.MIDDLE_CENTER);
    setCompositionRoot(rootLayout);
    setSizeFull();
} 
开发者ID:peholmst,项目名称:vaadin4spring,代码行数:46,代码来源:LoginScreen.java

本文标签属性:

示例:示例是什么意思

代码:代码生成器

java:java自行车

FormLayout:FormLayout

setSizeUndefined:setSizeUndefined

上一篇:意外惊喜什么意思(意外惊喜有哪些表现形式呢?)(意外惊喜什么意外惊喜什么意外惊喜有哪些表现形式)
下一篇:C++ method_iterator::isPure方法代码示例(c++ispure方法的典型用法代码示例汇总)

为您推荐