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


Java CheckBox.setTabIndex方法代碼示例

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


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

示例1: buildLoginForm

import com.vaadin.ui.CheckBox; //導入方法依賴的package包/類
private Component buildLoginForm() {
    final VerticalLayout loginPanel = new VerticalLayout();
    loginPanel.setSizeUndefined();
    loginPanel.setSpacing(true);
    Responsive.makeResponsive(loginPanel);
    loginPanel.addStyleName("login-panel");

    loginPanel.addComponent(buildLabels());
    loginPanel.addComponent(buildFields());
    
    CheckBox rememberMe = new CheckBox("Remember me", true);
    rememberMe.setTabIndex(3);
    
    loginPanel.addComponent(rememberMe);
    return loginPanel;
}
 
開發者ID:GJRTimmer,項目名稱:vaadin-security-template,代碼行數:17,代碼來源:LoginUI.java

示例2: addFilter

import com.vaadin.ui.CheckBox; //導入方法依賴的package包/類
/**
 * Adds a new filter to the CRUD.
 * @param column column to add the filter for.
 * @param row filter layout row to add the filter fields in.
 */
public void addFilter(final Object column, int row) {
	
	VerticalLayout fieldFilterLayout = new VerticalLayout();
	HorizontalLayout fieldsLayout = new HorizontalLayout();
	HorizontalLayout optionsLayout = new HorizontalLayout();
	final TextField tf = new TextField();
	final TextField tf2 = new TextField();
	final CheckBox caseSensitiveCheckBox = new CheckBox(Constants.uiCaseSensitive, false);
	final CheckBox onlyMatchPrefixCheckBox = new CheckBox(Constants.uiOnlyMatchPrefix, false);
	
	caseSensitiveCheckBox.setImmediate(true);
	onlyMatchPrefixCheckBox.setImmediate(true);
	caseSensitiveCheckBox.setTabIndex(-1);
	onlyMatchPrefixCheckBox.setTabIndex(-1);
	
	String prompt = table.getColumnHeader(column);
	tf.setInputPrompt(prompt.substring(0, 1).toUpperCase() + prompt.substring(1, prompt.length()));
	tf.setWidth("100%");
	tf.setImmediate(true);
	tf.setNullRepresentation("");
	tf.setValue("");
	
	fieldsLayout.addComponent(tf);
	fieldsLayout.setWidth("100%");
	
	fieldFilterLayout.addComponent(fieldsLayout);
	fieldFilterLayout.addComponent(optionsLayout);
	fieldFilterLayout.setWidth("100%");
	
	HorizontalLayout horizontalLayout = null;
	
	if(row < filterLayout.getComponentCount()) {
		horizontalLayout = (HorizontalLayout) filterLayout.getComponent(row);
	}
	
	if(horizontalLayout == null) {
		horizontalLayout = new HorizontalLayout();
		horizontalLayout.setWidth("100%");
		filterLayout.addComponent(horizontalLayout);
	}
	
	horizontalLayout.addComponent(fieldFilterLayout);
	horizontalLayout.setExpandRatio(fieldFilterLayout, 1);
	
	ValueChangeListener valueChangeListener = new Property.ValueChangeListener() {
		private static final long serialVersionUID = 1L;
		@Override
		public void valueChange(Property.ValueChangeEvent event) {
			filter(column, tf, tf2, caseSensitiveCheckBox, onlyMatchPrefixCheckBox);
		}
	};
	
	Class<?> columnType = table.getContainerDataSource().getType(column);
	
	if(columnType.equals(Date.class)) {
		tf.setInputPrompt(table.getColumnHeader(column) + " (" + Constants.uiStarting + ")");
		tf2.setInputPrompt(table.getColumnHeader(column) + " (" + Constants.uiEnding + ")");
		tf2.setWidth("100%");
		tf2.setImmediate(true);
		tf2.setNullRepresentation("");
		tf2.setValue(null);
		fieldsLayout.addComponent(tf2);
		fieldsLayout.setExpandRatio(tf, 1f);
		fieldsLayout.setExpandRatio(tf2, 1f);
		tf2.addListener(valueChangeListener);
	} else if(String.class.isAssignableFrom(columnType) || Dto.class.isAssignableFrom(columnType)) {
		optionsLayout.addComponent(caseSensitiveCheckBox);
		optionsLayout.addComponent(onlyMatchPrefixCheckBox);
		optionsLayout.setSizeUndefined();
	}
	
	tf.addListener(valueChangeListener);
	caseSensitiveCheckBox.addListener(valueChangeListener);
	onlyMatchPrefixCheckBox.addListener(valueChangeListener);
}
 
開發者ID:alejandro-du,項目名稱:enterprise-app,代碼行數:81,代碼來源:CrudComponent.java

示例3: buildMainLayout

import com.vaadin.ui.CheckBox; //導入方法依賴的package包/類
@AutoGenerated
private AbsoluteLayout buildMainLayout() {
	// common part: create layout
	mainLayout = new AbsoluteLayout();
	mainLayout.setImmediate(false);
	mainLayout.setWidth("560px");
	mainLayout.setHeight("280px");
	mainLayout.setMargin(true);
	
	// top-level component properties
	setWidth("560px");
	setHeight("280px");
	
	// activeField
	activeField = new CheckBox();
	activeField.setCaption("Activo");
	activeField.setImmediate(false);
	activeField.setWidth("-1px");
	activeField.setHeight("-1px");
	activeField.setTabIndex(2);
	activeField.setRequired(true);
	mainLayout.addComponent(activeField, "top:20.0px;left:486.0px;");
	
	// codeField
	codeField = new TextField();
	codeField.setCaption("Código");
	codeField.setImmediate(false);
	codeField.setWidth("120px");
	codeField.setHeight("-1px");
	codeField.setRequired(true);
	mainLayout.addComponent(codeField, "top:20.0px;left:20.0px;");
	
	// commentField
	commentField = new TextField();
	commentField.setCaption("Comentarios");
	commentField.setImmediate(false);
	commentField.setWidth("520px");
	commentField.setHeight("120px");
	commentField.setTabIndex(6);
	mainLayout.addComponent(commentField, "top:140.0px;left:20.0px;");
	
	// descriptionField
	descriptionField = new TextField();
	descriptionField.setCaption("Descripción");
	descriptionField.setImmediate(false);
	descriptionField.setWidth("520px");
	descriptionField.setHeight("-1px");
	descriptionField.setTabIndex(3);
	mainLayout.addComponent(descriptionField, "top:60.0px;left:20.0px;");
	
	// nameField
	nameField = new TextField();
	nameField.setCaption("Nombre");
	nameField.setImmediate(false);
	nameField.setWidth("320px");
	nameField.setHeight("-1px");
	nameField.setTabIndex(1);
	nameField.setRequired(true);
	mainLayout.addComponent(nameField, "top:20.0px;left:160.0px;");
	
	// areaTypeField
	areaTypeField = new ComboBox();
	areaTypeField.setCaption("Tipo Area");
	areaTypeField.setImmediate(false);
	areaTypeField.setWidth("-1px");
	areaTypeField.setHeight("-1px");
	areaTypeField.setTabIndex(4);
	areaTypeField.setRequired(true);
	mainLayout.addComponent(areaTypeField, "top:100.0px;left:19.0px;");
	
	return mainLayout;
}
 
開發者ID:thingtrack,項目名稱:konekti,代碼行數:73,代碼來源:AreaViewForm.java

示例4: buildMainLayout

import com.vaadin.ui.CheckBox; //導入方法依賴的package包/類
@AutoGenerated
private AbsoluteLayout buildMainLayout() {
	// common part: create layout
	mainLayout = new AbsoluteLayout();
	mainLayout.setImmediate(false);
	mainLayout.setWidth("700px");
	mainLayout.setHeight("440px");
	mainLayout.setMargin(true);
	
	// top-level component properties
	setWidth("700px");
	setHeight("440px");
	
	// activeField
	activeField = new CheckBox();
	activeField.setCaption("Activo");
	activeField.setImmediate(false);
	activeField.setWidth("-1px");
	activeField.setHeight("-1px");
	activeField.setTabIndex(1);
	activeField.setRequired(true);
	mainLayout.addComponent(activeField, "top:14.0px;left:507.0px;");
	
	// commentField
	commentField = new TextField();
	commentField.setCaption("Comentario");
	commentField.setImmediate(false);
	commentField.setWidth("540px");
	commentField.setHeight("160px");
	commentField.setTabIndex(3);
	mainLayout.addComponent(commentField, "top:100.0px;left:20.0px;");
	
	// passwordField
	passwordField = new PasswordField();
	passwordField.setCaption("Clave");
	passwordField.setImmediate(false);
	passwordField.setWidth("160px");
	passwordField.setHeight("-1px");
	passwordField.setTabIndex(2);
	passwordField.setRequired(true);
	mainLayout.addComponent(passwordField, "top:56.0px;left:20.0px;");
	
	// usernameField
	usernameField = new TextField();
	usernameField.setCaption("Nombre usuario");
	usernameField.setImmediate(false);
	usernameField.setWidth("160px");
	usernameField.setHeight("-1px");
	usernameField.setRequired(true);
	mainLayout.addComponent(usernameField, "top:17.0px;left:20.0px;");
	
	// rolesField
	rolesField = new Table();
	rolesField.setCaption("Roles");
	rolesField.setImmediate(false);
	rolesField.setWidth("501px");
	rolesField.setHeight("140px");
	mainLayout.addComponent(rolesField, "top:281.0px;left:19.0px;");
	
	// brnAdd
	brnAdd = new Button();
	brnAdd.setCaption("+");
	brnAdd.setImmediate(true);
	brnAdd.setWidth("-1px");
	brnAdd.setHeight("-1px");
	mainLayout.addComponent(brnAdd, "top:283.0px;left:525.0px;");
	
	// btnRemove
	btnRemove = new Button();
	btnRemove.setCaption("-");
	btnRemove.setImmediate(true);
	btnRemove.setWidth("-1px");
	btnRemove.setHeight("-1px");
	mainLayout.addComponent(btnRemove, "top:320.0px;left:525.0px;");
	
	return mainLayout;
}
 
開發者ID:thingtrack,項目名稱:konekti,代碼行數:78,代碼來源:UserViewForm.java


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