com.vaadin.ui.TextField Java Examples

The following examples show how to use com.vaadin.ui.TextField. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Util.java    From gantt with Apache License 2.0 6 votes vote down vote up
public static TextField createNumberEditor(String caption, float value, final Component component,
        final NumberValueChange valueChange) {
    TextField field = new TextField(caption);
    field.setMaxLength(5);
    field.setValue("" + value);
    field.addValueChangeListener(new ValueChangeListener<String>() {

        @Override
        public void valueChange(ValueChangeEvent<String> event) {
            Object v = event.getValue();
            try {
                float f = Float.parseFloat("" + v);
                valueChange.onValueChange(f);
            } catch (NumberFormatException e) {
                Notification.show("Invalid floating number! Format is 123.345");
            }
        }
    });
    return field;
}
 
Example #2
Source File: MyCloudEdit.java    From primecloud-controller with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void attach() {
    // myCloud名
    cloudNameField = new TextField(ViewProperties.getCaption("field.cloudName"));
    getLayout().addComponent(cloudNameField);

    // ドメイン名
    domainNameField = new TextField(ViewProperties.getCaption("field.domainName"));
    domainNameField.setWidth("100%");
    getLayout().addComponent(domainNameField);

    // コメント
    commentField = new TextField(ViewProperties.getCaption("field.comment"));
    commentField.setWidth("100%");
    getLayout().addComponent(commentField);

    cloudNameField.focus();

    initValidation();
}
 
Example #3
Source File: WinServiceEdit.java    From primecloud-controller with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void attach() {
    setHeight(TAB_HEIGHT);
    setMargin(false, true, false, true);
    setSpacing(false);

    // カスタムパラメータ1
    customParam1Field = new TextField(ViewProperties.getCaption("field.customParam1"));
    customParam1Field.setWidth("90%");
    form.getLayout().addComponent(customParam1Field);

    // カスタムパラメータ2
    customParam2Field = new TextField(ViewProperties.getCaption("field.customParam2"));
    customParam2Field.setWidth("90%");
    form.getLayout().addComponent(customParam2Field);

    // カスタムパラメータ3
    customParam3Field = new TextField(ViewProperties.getCaption("field.customParam3"));
    customParam3Field.setWidth("90%");
    form.getLayout().addComponent(customParam3Field);

    form.setReadOnly(true);
    addComponent(form);

    initValidation();
}
 
Example #4
Source File: ToggleTicketSummaryField.java    From mycollab with GNU Affero General Public License v3.0 6 votes vote down vote up
private void updateFieldValue(TextField editField) {
    removeComponent(editField);
    addComponent(titleLinkLbl);
    addComponent(buttonControls);
    addStyleName("editable-field");
    String newValue = editField.getValue();
    if (StringUtils.isNotBlank(newValue) && !newValue.equals(ticket.getName())) {
        ticket.setName(newValue);
        titleLinkLbl.setValue(buildTicketLink());
        if (ticket.isBug()) {
            BugWithBLOBs bug = ProjectTicket.buildBug(ticket);
            BugService bugService = AppContextUtil.getSpringBean(BugService.class);
            bugService.updateSelectiveWithSession(bug, UserUIContext.getUsername());
        } else if (ticket.isTask()) {
            Task task = ProjectTicket.buildTask(ticket);
            TaskService taskService = AppContextUtil.getSpringBean(TaskService.class);
            taskService.updateSelectiveWithSession(task, UserUIContext.getUsername());
        } else if (ticket.isRisk()) {
            Risk risk = ProjectTicket.buildRisk(ticket);
            RiskService riskService = AppContextUtil.getSpringBean(RiskService.class);
            riskService.updateSelectiveWithSession(risk, UserUIContext.getUsername());
        }
    }

    isRead = !isRead;
}
 
Example #5
Source File: FieldFactory.java    From vaadin-grid-util with MIT License 6 votes vote down vote up
public static <T> TextField genNumberField(Binder<T> binder, String propertyId, Converter converter, String inputPrompt) {
    final TextField field = new TextField();
    field.setWidth("100%");
    field.addStyleName(STYLENAME_GRIDCELLFILTER);
    field.addStyleName(ValoTheme.TEXTFIELD_TINY);
    field.addValueChangeListener(e -> {
        if (binder.isValid()) {
            field.setComponentError(null);
        }
    });
    binder.forField(field)
            .withNullRepresentation("")
            // .withValidator(text -> text != null && text.length() > 0, "invalid")
            .withConverter(converter)
            .bind(propertyId);
    field.setPlaceholder(inputPrompt);
    return field;
}
 
Example #6
Source File: FormFactoryImpl.java    From cia with Apache License 2.0 6 votes vote down vote up
/**
 * Creates the display property converters.
 *
 * @param                     <T> the generic type
 * @param displayProperties   the display properties
 * @param formContent         the form content
 * @param binder              the binder
 * @param propertyDescriptors the property descriptors
 */
private static <T extends Serializable> void createDisplayPropertyConverters(final List<String> displayProperties,
		final ComponentContainer formContent, final Binder<T> binder, final PropertyDescriptor[] propertyDescriptors) {
	for (final String property : displayProperties) {
		final Class<?> typeOfProperty = getTypeOfProperty(propertyDescriptors, property);

		if (typeOfProperty != null) {
			final AbstractField<?> field = new TextField();
			field.setReadOnly(true);
			field.setCaption(property);
			field.setWidth(ContentSize.FULL_SIZE);
			formContent.addComponent(field);
			final Converter converter = getConverterForType(typeOfProperty);

			if (converter != null) {
				binder.forField(field).withConverter(converter).bind(property);
			} else {
				binder.forField(field).bind(property);
			} 
		}
	}
}
 
Example #7
Source File: TargetDetails.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
private HorizontalLayout getSecurityTokenLayout(final String securityToken) {
    final HorizontalLayout securityTokenLayout = new HorizontalLayout();

    final Label securityTableLbl = new Label(
            SPUIComponentProvider.getBoldHTMLText(getI18n().getMessage("label.target.security.token")),
            ContentMode.HTML);
    securityTableLbl.addStyleName(SPUIDefinitions.TEXT_STYLE);
    securityTableLbl.addStyleName("label-style");

    final TextField securityTokentxt = new TextField();
    securityTokentxt.addStyleName(ValoTheme.TEXTFIELD_BORDERLESS);
    securityTokentxt.addStyleName(ValoTheme.TEXTFIELD_TINY);
    securityTokentxt.addStyleName("targetDtls-securityToken");
    securityTokentxt.addStyleName(SPUIDefinitions.TEXT_STYLE);
    securityTokentxt.setCaption(null);
    securityTokentxt.setNullRepresentation("");
    securityTokentxt.setValue(securityToken);
    securityTokentxt.setReadOnly(true);

    securityTokenLayout.addComponent(securityTableLbl);
    securityTokenLayout.addComponent(securityTokentxt);
    return securityTokenLayout;
}
 
Example #8
Source File: RangeEditorComponent.java    From XACML with MIT License 5 votes vote down vote up
@AutoGenerated
private VerticalLayout buildVerticalLayout_2() {
	// common part: create layout
	verticalLayout_2 = new VerticalLayout();
	verticalLayout_2.setImmediate(false);
	verticalLayout_2.setWidth("100.0%");
	verticalLayout_2.setHeight("100.0%");
	verticalLayout_2.setMargin(false);
	verticalLayout_2.setSpacing(true);
	
	// textFieldTestInput
	textFieldTestInput = new TextField();
	textFieldTestInput.setCaption("Value");
	textFieldTestInput.setImmediate(true);
	textFieldTestInput.setDescription("Enter a value to test against.");
	textFieldTestInput.setWidth("-1px");
	textFieldTestInput.setHeight("-1px");
	textFieldTestInput.setInputPrompt("eg. 50");
	verticalLayout_2.addComponent(textFieldTestInput);
	
	// buttonValidate
	buttonValidate = new Button();
	buttonValidate.setCaption("Test");
	buttonValidate.setImmediate(true);
	buttonValidate
			.setDescription("Click to test if value is within the range.");
	buttonValidate.setWidth("-1px");
	buttonValidate.setHeight("-1px");
	verticalLayout_2.addComponent(buttonValidate);
	verticalLayout_2.setComponentAlignment(buttonValidate,
			new Alignment(48));
	
	return verticalLayout_2;
}
 
Example #9
Source File: TextFieldBuilder.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Create a search text field.
 * 
 * @param textChangeListener
 *            listener when text is changed.
 * @return the textfield
 */
public TextField createSearchField(final TextChangeListener textChangeListener) {
    final TextField textField = style("filter-box").styleName("text-style filter-box-hide").buildTextComponent();
    textField.setWidth(100.0F, Unit.PERCENTAGE);
    textField.addTextChangeListener(textChangeListener);
    textField.setTextChangeEventMode(TextChangeEventMode.LAZY);
    // 1 seconds timeout.
    textField.setTextChangeTimeout(1000);
    return textField;
}
 
Example #10
Source File: WinLoadBalancerAdd.java    From primecloud-controller with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void attach() {
    // LB名
    loadBalancerNameField = new TextField(ViewProperties.getCaption("field.loadBalancerName"));
    getLayout().addComponent(loadBalancerNameField);

    // コメント欄
    commentField = new TextField(ViewProperties.getCaption("field.comment"));
    commentField.setWidth("95%");
    getLayout().addComponent(commentField);

    // クラウド選択
    cloudTable = new SelectCloudTable();
    getLayout().addComponent(cloudTable);
    cloudTable.addListener(new Property.ValueChangeListener() {
        @Override
        public void valueChange(Property.ValueChangeEvent event) {
            cloudTableSelect(event);
        }
    });

    // LB種別選択
    typeTable = new SelectTypeTable();
    getLayout().addComponent(typeTable);

    // 割り当てサービス選択
    serviceTable = new SelectServiceTable();
    getLayout().addComponent(serviceTable);

    initValidation();
}
 
Example #11
Source File: AbstractMetadataPopupLayout.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private TextField createKeyTextField() {
    final TextField keyField = new TextFieldBuilder(MetaData.KEY_MAX_SIZE).caption(i18n.getMessage("textfield.key"))
            .required(true, i18n).id(UIComponentIdProvider.METADATA_KEY_FIELD_ID).buildTextComponent();
    keyField.addTextChangeListener(this::onKeyChange);
    keyField.setTextChangeEventMode(TextChangeEventMode.LAZY);
    keyField.setTextChangeTimeout(INPUT_DEBOUNCE_TIMEOUT);
    keyField.setWidth("100%");
    return keyField;
}
 
Example #12
Source File: FormFactoryImpl.java    From cia with Apache License 2.0 5 votes vote down vote up
/**
 * Creates the field.
 *
 * @param property the property
 * @return the abstract field
 */
private static AbstractField<?> createField(final String property) {
	if (StringUtils.containsIgnoreCase(property,HIDDEN_FIELD_NAME)) {
		return new PasswordField();
	} else {
		return new TextField();
	}
}
 
Example #13
Source File: TargetFilterHeader.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private TextField createSearchField() {
    final TextField campSearchTextField = new TextFieldBuilder(64)
            .id(UIComponentIdProvider.TARGET_FILTER_SEARCH_TEXT)
            .createSearchField(event -> searchBy(event.getText()));
    campSearchTextField.setWidth(500.0F, Unit.PIXELS);
    return campSearchTextField;
}
 
Example #14
Source File: Util.java    From gantt with Apache License 2.0 5 votes vote down vote up
public static TextField createHeightEditor(final Component component) {
    return createNumberEditor("Height", component.getHeight(), component, new NumberValueChange() {

        @Override
        public void onValueChange(float number) {
            component.setHeight(number, component.getHeightUnits());
        }
    });
}
 
Example #15
Source File: AddUpdateRolloutWindowLayout.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private TextField createTriggerThreshold() {
    final TextField thresholdField = createIntegerTextField("prompt.tigger.threshold",
            UIComponentIdProvider.ROLLOUT_TRIGGER_THRESOLD_ID);
    thresholdField.addValidator(new ThresholdFieldValidator());
    thresholdField.setValue(defaultRolloutGroupConditions.getSuccessConditionExp());
    return thresholdField;
}
 
Example #16
Source File: WinServerEdit.java    From primecloud-controller with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void attach() {
    setHeight(TAB_HEIGHT);
    setMargin(false, true, false, true);
    setSpacing(false);

    // サーバサイズ
    sizeSelect = new ComboBox(ViewProperties.getCaption("field.serverSize"));
    sizeSelect.setNullSelectionAllowed(false);
    form.getLayout().addComponent(sizeSelect);

    // キーペア
    keySelect = new ComboBox(ViewProperties.getCaption("field.keyPair"));
    keySelect.setNullSelectionAllowed(false);
    keySelect.addContainerProperty(KEY_CAPTION_ID, String.class, null);
    keySelect.setItemCaptionPropertyId(KEY_CAPTION_ID);
    keySelect.setItemCaptionMode(AbstractSelect.ITEM_CAPTION_MODE_PROPERTY);
    // Windowsの場合はキーペアを無効にする
    if (StringUtils.startsWith(image.getImage().getOs(), PCCConstant.OS_NAME_WIN)) {
        keySelect.setEnabled(false);
    }
    form.getLayout().addComponent(keySelect);

    // クラスタ
    clusterSelect = new ComboBox(ViewProperties.getCaption("field.cluster"));
    clusterSelect.setNullSelectionAllowed(false);
    form.getLayout().addComponent(clusterSelect);

    // ルートサイズ
    rootSizeField = new TextField(ViewProperties.getCaption("field.rootSize"));
    rootSizeField.setImmediate(true);
    form.getLayout().addComponent(rootSizeField);

    addComponent(form);
}
 
Example #17
Source File: AddUpdateRolloutWindowLayout.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private TextField createIntegerTextField(final String in18Key, final String id) {
    final TextField textField = createTextField(in18Key, id, 32);
    textField.setConverter(new StringToIntegerConverter());
    textField.setConversionError(i18n.getMessage(MESSAGE_ENTER_NUMBER));
    textField.setSizeUndefined();
    return textField;
}
 
Example #18
Source File: Util.java    From gantt with Apache License 2.0 5 votes vote down vote up
public static TextField createTextEditor(String caption, String value, final Component component,
        final TextValueChange valueChange) {
    TextField field = new TextField(caption);
    field.setValue("" + value);
    field.addValueChangeListener(new ValueChangeListener<String>() {

        @Override
        public void valueChange(ValueChangeEvent<String> event) {
            Object v = event.getValue();
            valueChange.onValueChange(String.valueOf(v));
        }
    });
    return field;
}
 
Example #19
Source File: AbstractHawkbitLoginUI.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private void buildUserField() {
    username = new TextField(i18n.getMessage("label.login.username"));
    username.setIcon(FontAwesome.USER);
    username.addStyleName(
            ValoTheme.TEXTFIELD_INLINE_ICON + " " + ValoTheme.TEXTFIELD_SMALL + " " + LOGIN_TEXTFIELD);
    username.setId("login-username");
    if (isDemo && !uiProperties.getDemo().getUser().isEmpty()) {
        username.setValue(uiProperties.getDemo().getUser());
    }
}
 
Example #20
Source File: SignUpViewImpl.java    From Vaadin4Spring-MVP-Sample-SpringSecurity with Apache License 2.0 5 votes vote down vote up
private void buildForm() {
	username = new TextField("Username");
	username.setWidth("100%");
	username.setImmediate(true);
	username.setValidationVisible(false);
	username.setNullRepresentation("");
	username.setRequired(true);		
	form.addComponent(username);
	
	password = new PasswordField("Password");
	password.setWidth("100%");
	password.setImmediate(true);
	password.setValidationVisible(false);
	password.setNullRepresentation("");
	password.setRequired(true);
	form.addComponent(password);
	
	firstName = new TextField("First name");
	firstName.setWidth("100%");
	firstName.setValidationVisible(false);
	firstName.setNullRepresentation("");
	firstName.setImmediate(true);
	firstName.setRequired(true);
	form.addComponent(firstName);
	
	lastName = new TextField("Last name");
	lastName.setWidth("100%");
	lastName.setImmediate(true);
	lastName.setNullRepresentation("");
	lastName.setValidationVisible(false);
	lastName.setRequired(true);
	form.addComponent(lastName);
	
	binder.bind(username, "username");
	binder.bind(password, "password");
	binder.bind(firstName, "firstName");
	binder.bind(lastName, "lastName");	
}
 
Example #21
Source File: CustomPIPConfigurationComponent.java    From XACML with MIT License 5 votes vote down vote up
@AutoGenerated
private VerticalLayout buildMainLayout() {
	// common part: create layout
	mainLayout = new VerticalLayout();
	mainLayout.setImmediate(false);
	mainLayout.setWidth("-1px");
	mainLayout.setHeight("-1px");
	mainLayout.setMargin(false);
	mainLayout.setSpacing(true);
	
	// top-level component properties
	setWidth("-1px");
	setHeight("-1px");
	
	// textFieldClassname
	textFieldClassname = new TextField();
	textFieldClassname.setCaption("Java Classname");
	textFieldClassname.setImmediate(false);
	textFieldClassname
			.setDescription("Java classname of the code implementing the custom PIP.");
	textFieldClassname.setWidth("-1px");
	textFieldClassname.setHeight("-1px");
	textFieldClassname.setInputPrompt("Eg. com.foo.MyPIP");
	mainLayout.addComponent(textFieldClassname);
	mainLayout.setExpandRatio(textFieldClassname, 1.0f);
	
	// pipParameterComponent
	pipParameterComponent = new PIPParameterComponent(this.entity.getEntity());
	pipParameterComponent.setImmediate(false);
	pipParameterComponent.setWidth("-1px");
	pipParameterComponent.setHeight("-1px");
	mainLayout.addComponent(pipParameterComponent);
	
	return mainLayout;
}
 
Example #22
Source File: ToggleBugSummaryField.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
private void updateFieldValue(TextField editField) {
    removeComponent(editField);
    addComponent(titleLinkLbl);
    addComponent(buttonControls);
    addStyleName("editable-field");
    String newValue = editField.getValue();
    if (StringUtils.isNotBlank(newValue) && !newValue.equals(bug.getName())) {
        bug.setName(newValue);
        titleLinkLbl.setValue(buildBugLink());
        BugService bugService = AppContextUtil.getSpringBean(BugService.class);
        bugService.updateSelectiveWithSession(BeanUtility.deepClone(bug), UserUIContext.getUsername());
    }

    isRead = !isRead;
}
 
Example #23
Source File: ToggleTaskSummaryField.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
private void updateFieldValue(TextField editField) {
    removeComponent(editField);
    withComponents(titleLinkLbl, buttonControls).withStyleName("editable-field");
    String newValue = editField.getValue();
    if (StringUtils.isNotBlank(newValue) && !newValue.equals(task.getName())) {
        task.setName(newValue);
        titleLinkLbl.setValue(buildTaskLink());
        TaskService taskService = AppContextUtil.getSpringBean(TaskService.class);
        taskService.updateSelectiveWithSession(BeanUtility.deepClone(task), UserUIContext.getUsername());
    }

    isRead = !isRead;
}
 
Example #24
Source File: AttributeSelectionWindow.java    From XACML with MIT License 5 votes vote down vote up
@AutoGenerated
private VerticalLayout buildVerticalLayout_2() {
	// common part: create layout
	verticalLayout_2 = new VerticalLayout();
	verticalLayout_2.setImmediate(false);
	verticalLayout_2.setWidth("-1px");
	verticalLayout_2.setHeight("-1px");
	verticalLayout_2.setMargin(true);
	verticalLayout_2.setSpacing(true);
	
	// textFieldIssuer
	textFieldIssuer = new TextField();
	textFieldIssuer.setCaption("Issuer");
	textFieldIssuer.setImmediate(false);
	textFieldIssuer.setWidth("-1px");
	textFieldIssuer.setHeight("-1px");
	verticalLayout_2.addComponent(textFieldIssuer);
	
	// checkBoxMustBePresent
	checkBoxMustBePresent = new CheckBox();
	checkBoxMustBePresent.setCaption("Attribute Must Be Present");
	checkBoxMustBePresent.setImmediate(false);
	checkBoxMustBePresent.setWidth("-1px");
	checkBoxMustBePresent.setHeight("-1px");
	verticalLayout_2.addComponent(checkBoxMustBePresent);
	
	return verticalLayout_2;
}
 
Example #25
Source File: BasicModel.java    From chipster with MIT License 5 votes vote down vote up
private void initElements() {
	
	lbName = new Label("Display name:");
	lbId = new Label();
	lbDescription = new Label("Description:");
	lbOptional = new Label("Optional:");
	
	name = new TextField();
	name.setWidth(WIDTH);
	name.setDescription("Display name for the element");
	name.setImmediate(true);
	name.addTextChangeListener(new CSCTextChangeListener(this));
	
	id = new TextField();
	id.setDescription("file name or unique identification");
	id.setImmediate(true);
	id.setRequired(true);
	id.setRequiredError(REQUIRED_TEXT);
	id.setWidth(WIDTH);
	id.addTextChangeListener(new CSCTextChangeListener(this, true));
	
	description = new TextArea();
	description.setWidth(WIDTH);
	description.setDescription("Short description");
	
	layout = new HorizontalLayout();
	
	prefix = new TextField();
	postfix = new TextField();
	
	layout.addComponent(prefix);
	layout.addComponent(new Label(MULTI_FILE_TEXT));
	layout.addComponent(postfix);
	
	optional = new CheckBox();
	optional.setDescription("Is this element optional");
	optional.setImmediate(true);
}
 
Example #26
Source File: FormUtils.java    From jdal with Apache License 2.0 5 votes vote down vote up
/**
 * Create a new {@link TextField}
 * @return new TextField with null representation set to empty string
 */
public static TextField newTextField() {
	TextField tf = new TextField();
	tf.setNullRepresentation("");
	
	return tf;
}
 
Example #27
Source File: VariableDefinitionEditorWindow.java    From XACML with MIT License 5 votes vote down vote up
@AutoGenerated
private VerticalLayout buildMainLayout() {
	// common part: create layout
	mainLayout = new VerticalLayout();
	mainLayout.setImmediate(false);
	mainLayout.setWidth("-1px");
	mainLayout.setHeight("-1px");
	mainLayout.setMargin(true);
	mainLayout.setSpacing(true);
	
	// top-level component properties
	setWidth("-1px");
	setHeight("-1px");
	
	// textFieldID
	textFieldID = new TextField();
	textFieldID.setCaption("Variable ID");
	textFieldID.setImmediate(false);
	textFieldID.setWidth("-1px");
	textFieldID.setHeight("-1px");
	textFieldID.setInvalidAllowed(false);
	textFieldID.setRequired(true);
	textFieldID.setNullRepresentation("");
	mainLayout.addComponent(textFieldID);
	
	// buttonSave
	buttonSave = new Button();
	buttonSave.setCaption("Save and Continue");
	buttonSave.setImmediate(false);
	buttonSave.setWidth("-1px");
	buttonSave.setHeight("-1px");
	mainLayout.addComponent(buttonSave);
	mainLayout.setComponentAlignment(buttonSave, new Alignment(48));
	
	return mainLayout;
}
 
Example #28
Source File: VaadinBindingUtils.java    From jdal with Apache License 2.0 5 votes vote down vote up
public static void registerControlAccessors(ConfigurableControlAccessorFactory accessorFactory) {
	Map<Class<?>, Class<?extends ControlAccessor>> accessors = accessorFactory.getAccessors();
	
	accessors.put(AbstractField.class, FieldAccessor.class);
	accessors.put(TextField.class, TextFieldAccessor.class);
	accessors.put(Label.class, LabelAccessor.class);
	accessors.put(PageableTable.class, PageableTableAccessor.class);
	accessors.put(Table.class, TableAccessor.class);
	accessors.put(TableEditor.class, TableEditorAccessor.class);
}
 
Example #29
Source File: SubDomainEditorWindow.java    From XACML with MIT License 5 votes vote down vote up
@AutoGenerated
private FormLayout buildMainLayout() {
	// common part: create layout
	mainLayout = new FormLayout();
	mainLayout.setImmediate(false);
	mainLayout.setWidth("-1px");
	mainLayout.setHeight("-1px");
	mainLayout.setMargin(true);
	mainLayout.setSpacing(true);
	
	// top-level component properties
	setWidth("-1px");
	setHeight("-1px");
	
	// textFieldSubdomain
	textFieldSubdomain = new TextField();
	textFieldSubdomain.setCaption("Enter Sub Domain");
	textFieldSubdomain.setImmediate(false);
	textFieldSubdomain
			.setDescription("You can enter sub domain name - do not use spaces or wildcard characters.");
	textFieldSubdomain.setWidth("-1px");
	textFieldSubdomain.setHeight("-1px");
	textFieldSubdomain.setInvalidAllowed(false);
	textFieldSubdomain
			.setInputPrompt("Examples: sales hr business marketing.");
	mainLayout.addComponent(textFieldSubdomain);
	mainLayout.setExpandRatio(textFieldSubdomain, 1.0f);
	
	// buttonSave
	buttonSave = new Button();
	buttonSave.setCaption("Save");
	buttonSave.setImmediate(true);
	buttonSave.setWidth("-1px");
	buttonSave.setHeight("-1px");
	mainLayout.addComponent(buttonSave);
	mainLayout.setComponentAlignment(buttonSave, new Alignment(48));
	
	return mainLayout;
}
 
Example #30
Source File: LoginView.java    From gazpachoquest with GNU General Public License v3.0 5 votes vote down vote up
protected HorizontalLayout createCompositionRootx() {
    VerticalLayout loginPanel = new VerticalLayout();
    loginPanel.setSpacing(true);
    loginPanel.setWidth("400px");

    Label header = new Label("Enter your invitation to start the questionnair");
    header.addStyleName(Reindeer.LABEL_H1);
    loginPanel.addComponent(header);

    invitation = new TextField("Invitation");
    invitation.setWidth("100%");
    invitation.focus();
    invitation.setValue("YAS5ICHRBE");
    loginPanel.addComponent(invitation);

    HorizontalLayout buttons = new HorizontalLayout();
    buttons.setSpacing(true);
    loginPanel.addComponent(buttons);
    loginPanel.setComponentAlignment(buttons, Alignment.MIDDLE_RIGHT);

    login = new Button("Start");
    login.setClickShortcut(KeyCode.ENTER);
    login.addStyleName(Reindeer.BUTTON_DEFAULT);
    login.addClickListener(createLoginButtonListener());
    buttons.addComponent(login);

    HorizontalLayout viewLayout = new HorizontalLayout();
    viewLayout.addComponent(loginPanel);
    viewLayout.setComponentAlignment(loginPanel, Alignment.MIDDLE_CENTER);
    viewLayout.setSizeFull();
    viewLayout.addStyleName(Reindeer.LAYOUT_BLUE);
    setSizeFull();

    return viewLayout;
}