當前位置: 首頁>>代碼示例>>Java>>正文


Java TextField.setInputPrompt方法代碼示例

本文整理匯總了Java中com.vaadin.ui.TextField.setInputPrompt方法的典型用法代碼示例。如果您正苦於以下問題:Java TextField.setInputPrompt方法的具體用法?Java TextField.setInputPrompt怎麽用?Java TextField.setInputPrompt使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.vaadin.ui.TextField的用法示例。


在下文中一共展示了TextField.setInputPrompt方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: addStringFilters

import com.vaadin.ui.TextField; //導入方法依賴的package包/類
/**
 * Ajoute un filtre en TextField sur une liste de colonnes
 * 
 * @param filterRow
 * @param container
 * @param propertys
 */
private void addStringFilters(String... propertys) {
	for (String property : propertys) {
		HeaderCell cell = getFilterCell(property);
		TextField filterField = new TextField();
		filterField.setImmediate(true);
		filterField.setWidth(100, Unit.PERCENTAGE);
		filterField.addStyleName(ValoTheme.TEXTFIELD_TINY);
		filterField.setInputPrompt(applicationContext.getMessage("filter.all", null, UI.getCurrent().getLocale()));
		filterField.addTextChangeListener(change -> {
			// Can't modify filters so need to replace
			container.removeContainerFilters(property);
			// (Re)create the filter if necessary
			if (!change.getText().isEmpty()) {
				container.addContainerFilter(new InsensitiveStringFilter(property, change.getText()));
			}
			fireFilterListener();
		});
		cell.setComponent(filterField);
	}
}
 
開發者ID:EsupPortail,項目名稱:esup-ecandidat,代碼行數:28,代碼來源:GridFormatting.java

示例2: initSearchField

import com.vaadin.ui.TextField; //導入方法依賴的package包/類
protected void initSearchField() {
  HorizontalLayout searchLayout = new HorizontalLayout();
  searchLayout.setSpacing(true);
  addComponent(searchLayout);
  
  // textfield
  searchField = new TextField();
  searchField.setInputPrompt(i18nManager.getMessage(Messages.PEOPLE_SEARCH));
  searchField.setWidth(180, UNITS_PIXELS);
  searchField.focus();
  searchLayout.addComponent(searchField);
  
  // Logic to change table according to input
  searchField.addListener(new TextChangeListener() {
    public void textChange(TextChangeEvent event) {
      searchPeople(event.getText());
    }
  });
  
  initSelectMyselfButton(searchLayout);
}
 
開發者ID:logicalhacking,項目名稱:SecureBPMN,代碼行數:22,代碼來源:SelectUsersPopupWindow.java

示例3: initInputField

import com.vaadin.ui.TextField; //導入方法依賴的package包/類
protected void initInputField() {
  // Csslayout is used to style inputtext as rounded
  CssLayout csslayout = new CssLayout();
  csslayout.setHeight(24, UNITS_PIXELS);
  csslayout.setWidth(100, UNITS_PERCENTAGE);
  layout.addComponent(csslayout);
  
  inputField = new TextField();
  inputField.setWidth(100, UNITS_PERCENTAGE);
  inputField.addStyleName(ExplorerLayout.STYLE_SEARCHBOX);
  inputField.setInputPrompt(i18nManager.getMessage(Messages.TASK_CREATE_NEW));
  inputField.focus();
  csslayout.addComponent(inputField);
  
  layout.setComponentAlignment(csslayout, Alignment.MIDDLE_LEFT);
  layout.setExpandRatio(csslayout, 1.0f);
}
 
開發者ID:logicalhacking,項目名稱:SecureBPMN,代碼行數:18,代碼來源:TaskListHeader.java

示例4: createSearchBar

import com.vaadin.ui.TextField; //導入方法依賴的package包/類
private MHorizontalLayout createSearchBar() {
    Label header = new Label("Bookery");
    header.addStyleName(ValoTheme.LABEL_BOLD);
    header.setSizeUndefined();
    header.addStyleName(ValoTheme.LABEL_H3);
    
    searchText = new TextField();
    searchText.setIcon(FontAwesome.SEARCH);
    searchText.addStyleName(ValoTheme.TEXTFIELD_LARGE);
    searchText.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON);
    searchText.setWidth(100, Unit.PERCENTAGE);
    searchText.setInputPrompt("hier einfach suchen..");
    Button searchButton = new Button("such!", new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent event) {
            Navigator navigator = ((App)UI.getCurrent()).getNavigator();
            if (navigator.getState().contains("search")) {
                navigator.navigateTo(navigator.getState());
            }
            else {
                navigator.navigateTo(SearchView.id);
            }
            
        }
    });
    searchButton.addStyleName(ValoTheme.BUTTON_LARGE);
    searchText.addShortcutListener(new Button.ClickShortcut(searchButton, ShortcutAction.KeyCode.ENTER));

    MHorizontalLayout layout = new MHorizontalLayout(header,searchText,searchButton);
    layout.setWidth(100, Unit.PERCENTAGE);
    layout.setExpandRatio(searchText, 1.0f);
    return layout;
}
 
開發者ID:felixhusse,項目名稱:bookery,代碼行數:34,代碼來源:AppHeader.java

示例5: buildMainLayout

import com.vaadin.ui.TextField; //導入方法依賴的package包/類
@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");
	
	// textFieldColumn
	textFieldColumn = new TextField();
	textFieldColumn.setCaption("Column");
	textFieldColumn.setImmediate(false);
	textFieldColumn.setDescription("0-based index into CSV line");
	textFieldColumn.setWidth("-1px");
	textFieldColumn.setHeight("-1px");
	textFieldColumn.setRequired(true);
	textFieldColumn.setInputPrompt("Eg. ‘0'");
	mainLayout.addComponent(textFieldColumn);
	
	// buttonSave
	buttonSave = new Button();
	buttonSave.setCaption("Save");
	buttonSave.setImmediate(false);
	buttonSave.setWidth("-1px");
	buttonSave.setHeight("-1px");
	mainLayout.addComponent(buttonSave);
	mainLayout.setComponentAlignment(buttonSave, new Alignment(48));
	
	return mainLayout;
}
 
開發者ID:apache,項目名稱:incubator-openaz,代碼行數:37,代碼來源:ColumnSelectionWindow.java

示例6: buildMainLayout

import com.vaadin.ui.TextField; //導入方法依賴的package包/類
@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;
}
 
開發者ID:apache,項目名稱:incubator-openaz,代碼行數:40,代碼來源:SubDomainEditorWindow.java

示例7: buildMainLayout

import com.vaadin.ui.TextField; //導入方法依賴的package包/類
@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");
	
	// textFieldExpression
	textFieldExpression = new TextField();
	textFieldExpression.setCaption("Regular Expression");
	textFieldExpression.setImmediate(true);
	textFieldExpression
			.setDescription("Create a regular expression used to constrain attribute values.");
	textFieldExpression.setWidth("-1px");
	textFieldExpression.setHeight("-1px");
	textFieldExpression.setInvalidAllowed(false);
	textFieldExpression.setInputPrompt("eg. [a-zA-Z0-9]");
	mainLayout.addComponent(textFieldExpression);
	mainLayout.setExpandRatio(textFieldExpression, 1.0f);
	
	// panelTester
	panelTester = buildPanelTester();
	mainLayout.addComponent(panelTester);
	mainLayout.setExpandRatio(panelTester, 1.0f);
	
	return mainLayout;
}
 
開發者ID:apache,項目名稱:incubator-openaz,代碼行數:35,代碼來源:RegexpEditorComponent.java

示例8: buildVerticalLayout_2

import com.vaadin.ui.TextField; //導入方法依賴的package包/類
@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);
	
	// textFieldTestValue
	textFieldTestValue = new TextField();
	textFieldTestValue.setCaption("Test Value");
	textFieldTestValue.setImmediate(true);
	textFieldTestValue
			.setDescription("Enter a value to match against the regular expression.");
	textFieldTestValue.setWidth("-1px");
	textFieldTestValue.setHeight("-1px");
	textFieldTestValue.setInputPrompt("eg. example");
	verticalLayout_2.addComponent(textFieldTestValue);
	
	// buttonTest
	buttonTest = new Button();
	buttonTest.setCaption("Test");
	buttonTest.setImmediate(true);
	buttonTest.setWidth("-1px");
	buttonTest.setHeight("-1px");
	verticalLayout_2.addComponent(buttonTest);
	verticalLayout_2.setComponentAlignment(buttonTest, new Alignment(48));
	
	return verticalLayout_2;
}
 
開發者ID:apache,項目名稱:incubator-openaz,代碼行數:32,代碼來源:RegexpEditorComponent.java

示例9: buildHorizontalLayout_1

import com.vaadin.ui.TextField; //導入方法依賴的package包/類
@AutoGenerated
private HorizontalLayout buildHorizontalLayout_1() {
	// common part: create layout
	horizontalLayout_1 = new HorizontalLayout();
	horizontalLayout_1.setImmediate(false);
	horizontalLayout_1.setWidth("-1px");
	horizontalLayout_1.setHeight("-1px");
	horizontalLayout_1.setMargin(false);
	horizontalLayout_1.setSpacing(true);
	
	// comboBoxMin
	comboBoxMin = new ComboBox();
	comboBoxMin.setCaption("Minimum Type");
	comboBoxMin.setImmediate(true);
	comboBoxMin.setDescription("Select the type for the minimum.");
	comboBoxMin.setWidth("-1px");
	comboBoxMin.setHeight("-1px");
	horizontalLayout_1.addComponent(comboBoxMin);
	
	// textFieldMin
	textFieldMin = new TextField();
	textFieldMin.setCaption("Minimum Value");
	textFieldMin.setImmediate(true);
	textFieldMin.setDescription("Enter a value for the minimum.");
	textFieldMin.setWidth("-1px");
	textFieldMin.setHeight("-1px");
	textFieldMin.setInvalidAllowed(false);
	textFieldMin.setInputPrompt("eg. 1");
	horizontalLayout_1.addComponent(textFieldMin);
	horizontalLayout_1
			.setComponentAlignment(textFieldMin, new Alignment(9));
	
	return horizontalLayout_1;
}
 
開發者ID:apache,項目名稱:incubator-openaz,代碼行數:35,代碼來源:RangeEditorComponent.java

示例10: buildHorizontalLayout_2

import com.vaadin.ui.TextField; //導入方法依賴的package包/類
@AutoGenerated
private HorizontalLayout buildHorizontalLayout_2() {
	// common part: create layout
	horizontalLayout_2 = new HorizontalLayout();
	horizontalLayout_2.setImmediate(false);
	horizontalLayout_2.setWidth("-1px");
	horizontalLayout_2.setHeight("-1px");
	horizontalLayout_2.setMargin(false);
	horizontalLayout_2.setSpacing(true);
	
	// comboBoxMax
	comboBoxMax = new ComboBox();
	comboBoxMax.setCaption("Maximum Type");
	comboBoxMax.setImmediate(true);
	comboBoxMax.setDescription("Select the type for the maximum.");
	comboBoxMax.setWidth("-1px");
	comboBoxMax.setHeight("-1px");
	horizontalLayout_2.addComponent(comboBoxMax);
	
	// textFieldMax
	textFieldMax = new TextField();
	textFieldMax.setCaption("Maximum Value");
	textFieldMax.setImmediate(true);
	textFieldMax.setDescription("Enter a value for the maxmum.");
	textFieldMax.setWidth("-1px");
	textFieldMax.setHeight("-1px");
	textFieldMax.setInvalidAllowed(false);
	textFieldMax.setInputPrompt("eg. 100");
	horizontalLayout_2.addComponent(textFieldMax);
	
	return horizontalLayout_2;
}
 
開發者ID:apache,項目名稱:incubator-openaz,代碼行數:33,代碼來源:RangeEditorComponent.java

示例11: buildVerticalLayout_2

import com.vaadin.ui.TextField; //導入方法依賴的package包/類
@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;
}
 
開發者ID:apache,項目名稱:incubator-openaz,代碼行數:35,代碼來源:RangeEditorComponent.java

示例12: buildMainLayout

import com.vaadin.ui.TextField; //導入方法依賴的package包/類
@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;
}
 
開發者ID:apache,項目名稱:incubator-openaz,代碼行數:36,代碼來源:CustomPIPConfigurationComponent.java

示例13: buildFilter

import com.vaadin.ui.TextField; //導入方法依賴的package包/類
private Component buildFilter() {
    final TextField filter = new TextField();
    filter.addTextChangeListener(new TextChangeListener() {
        @Override
        public void textChange(final TextChangeEvent event) {
            Filterable data = (Filterable) table.getContainerDataSource();
            data.removeAllContainerFilters();
            data.addContainerFilter(new Filter() {
                @Override
                public boolean passesFilter(final Object itemId,
                        final Item item) {

                    if (event.getText() == null
                            || event.getText().equals("")) {
                        return true;
                    }

                    return filterByProperty("country", item,
                            event.getText())
                            || filterByProperty("city", item,
                                    event.getText())
                            || filterByProperty("title", item,
                                    event.getText());

                }

                @Override
                public boolean appliesToProperty(final Object propertyId) {
                    if (propertyId.equals("country")
                            || propertyId.equals("city")
                            || propertyId.equals("title")) {
                        return true;
                    }
                    return false;
                }
            });
        }
    });

    filter.setInputPrompt("Filter");
    filter.setIcon(FontAwesome.SEARCH);
    filter.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON);
    filter.addShortcutListener(new ShortcutListener("Clear",
            KeyCode.ESCAPE, null) {
        @Override
        public void handleAction(final Object sender, final Object target) {
            filter.setValue("");
            ((Filterable) table.getContainerDataSource())
                    .removeAllContainerFilters();
        }
    });
    return filter;
}
 
開發者ID:mcollovati,項目名稱:vaadin-vertx-samples,代碼行數:54,代碼來源:TransactionsView.java

示例14: buildMainLayout

import com.vaadin.ui.TextField; //導入方法依賴的package包/類
@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");
	
	// textFieldObligationID
	textFieldObligationID = new TextField();
	textFieldObligationID.setCaption("Obligation ID");
	textFieldObligationID.setImmediate(false);
	textFieldObligationID.setWidth("-1px");
	textFieldObligationID.setHeight("-1px");
	textFieldObligationID.setInvalidAllowed(false);
	textFieldObligationID.setRequired(true);
	textFieldObligationID.setInputPrompt("Eg. urn:com:foo:obligation:sample");
	mainLayout.addComponent(textFieldObligationID);
	
	// optionGroupFullfillOn
	optionGroupFullfillOn = new OptionGroup();
	optionGroupFullfillOn.setCaption("Fulfill On");
	optionGroupFullfillOn.setImmediate(false);
	optionGroupFullfillOn.setWidth("-1px");
	optionGroupFullfillOn.setHeight("-1px");
	optionGroupFullfillOn.setInvalidAllowed(false);
	optionGroupFullfillOn.setRequired(true);
	mainLayout.addComponent(optionGroupFullfillOn);
	
	// 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;
}
 
開發者ID:apache,項目名稱:incubator-openaz,代碼行數:47,代碼來源:ObligationEditorWindow.java

示例15: buildMainLayout

import com.vaadin.ui.TextField; //導入方法依賴的package包/類
@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");
	
	// textFieldAdviceID
	textFieldAdviceID = new TextField();
	textFieldAdviceID.setCaption("Advice ID");
	textFieldAdviceID.setImmediate(false);
	textFieldAdviceID.setWidth("-1px");
	textFieldAdviceID.setHeight("-1px");
	textFieldAdviceID.setInvalidAllowed(false);
	textFieldAdviceID.setRequired(true);
	textFieldAdviceID.setInputPrompt("Eg. urn:com:foo:advice:sample");
	mainLayout.addComponent(textFieldAdviceID);
	
	// optionGroupEffect
	optionGroupEffect = new OptionGroup();
	optionGroupEffect.setCaption("Applies To");
	optionGroupEffect.setImmediate(false);
	optionGroupEffect.setWidth("-1px");
	optionGroupEffect.setHeight("-1px");
	optionGroupEffect.setInvalidAllowed(false);
	optionGroupEffect.setRequired(true);
	mainLayout.addComponent(optionGroupEffect);
	
	// 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;
}
 
開發者ID:apache,項目名稱:incubator-openaz,代碼行數:47,代碼來源:AdviceEditorWindow.java


注:本文中的com.vaadin.ui.TextField.setInputPrompt方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。