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


Java ComboBox.setWidth方法代碼示例

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


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

示例1: createEditFields

import com.vaadin.ui.ComboBox; //導入方法依賴的package包/類
@Override
protected ComponentContainer createEditFields() {
    final ExtaFormLayout form = new ExtaFormLayout();

    appTitleField = new EditField("Заголовок приложения");
    form.addComponent(appTitleField);

    iconPathField = new ComboBox("Иконка приложения");
    for (final String icon : lookup(UserSettingsService.class).getFaviconPathList()) {
        iconPathField.addItem(icon);
        iconPathField.setItemIcon(icon, new ThemeResource(getLast(Splitter.on('/').split(icon))));
    }
    iconPathField.setItemCaptionMode(AbstractSelect.ItemCaptionMode.ICON_ONLY);
    iconPathField.setWidth(85, Unit.PIXELS);
    iconPathField.setTextInputAllowed(false);
    iconPathField.setNullSelectionAllowed(false);
    form.addComponent(iconPathField);

    isShowSalePointIdsField = new MCheckBox("Показывать раздел \"Идентификация\" в карточке торговой точки");
    form.addComponent(isShowSalePointIdsField);

    isDevServerField = new MCheckBox("Режим отладки");
    form.addComponent(isDevServerField);

    return form;
}
 
開發者ID:ExtaSoft,項目名稱:extacrm,代碼行數:27,代碼來源:MainSettingsForm.java

示例2: addComboBoxFilters

import com.vaadin.ui.ComboBox; //導入方法依賴的package包/類
/**
 * Ajoute un filtre en combobox String sur une colonne
 * 
 * @param property
 * @param cb
 */
public void addComboBoxFilters(String property, ComboBox cb, String libNull) {
	HeaderCell cell = getFilterCell(property);
	cb.addValueChangeListener(e -> {
		container.removeContainerFilters(property);
		if (cb.getValue() != null && !((String) cb.getValue()).isEmpty()
				&& !((String) cb.getValue()).equals(libNull)) {
			container.addContainerFilter(new SimpleStringFilter(property, (String) cb.getValue(), true, true));
		} else if (cb.getValue() != null && !((String) cb.getValue()).isEmpty()
				&& ((String) cb.getValue()).equals(libNull)) {
			container.addContainerFilter(new IsNull(property));
		}
		fireFilterListener();
		fireFilterListener();
	});
	cb.setImmediate(true);
	cb.setWidth(100, Unit.PERCENTAGE);
	cb.addStyleName(ValoTheme.COMBOBOX_TINY);
	cell.setComponent(cb);
}
 
開發者ID:EsupPortail,項目名稱:esup-ecandidat,代碼行數:26,代碼來源:GridFormatting.java

示例3: createThemeChooserBox

import com.vaadin.ui.ComboBox; //導入方法依賴的package包/類
private ComboBox createThemeChooserBox() {
  List<String> themes = Arrays.asList("Blueprint", "Dark", "Default", "Facebook", "Flat",
                                      "Flat-Dark", "Light", "Metro");

  ComboBox comboBox = new ComboBox("Choose theme", themes);
  comboBox.setWidth(100, Unit.PERCENTAGE);
  comboBox.setValue("Default");
  comboBox.addValueChangeListener(e -> {
    Object value = e.getValue();
    String theme = value != null ? String.valueOf(value) : "";
    if (!"".equals(theme.trim())) {
      getUI().setTheme(theme.toLowerCase());
    }
  });

  return comboBox;
}
 
開發者ID:Juchar,項目名稱:md-stepper,代碼行數:18,代碼來源:StepperPropertiesLayout.java

示例4: buildMainLayout

import com.vaadin.ui.ComboBox; //導入方法依賴的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");
	
	// comboBox
	comboBox = new ComboBox();
	comboBox.setImmediate(false);
	comboBox.setWidth("-1px");
	comboBox.setHeight("-1px");
	mainLayout.addComponent(comboBox);
	
	// treeExpression
	treeExpression = new Tree();
	treeExpression.setImmediate(false);
	treeExpression.setWidth("100.0%");
	treeExpression.setHeight("-1px");
	mainLayout.addComponent(treeExpression);
	mainLayout.setExpandRatio(treeExpression, 1.0f);
	
	return mainLayout;
}
 
開發者ID:apache,項目名稱:incubator-openaz,代碼行數:32,代碼來源:ExpressionEditorWindow.java

示例5: createResourceCB

import com.vaadin.ui.ComboBox; //導入方法依賴的package包/類
protected ComboBox createResourceCB() {
    ComboBox cb = new ComboBox("HTTP Resource");
    
    String projectVersionId = component.getProjectVersionId();
    IConfigurationService configurationService = context.getConfigurationService();

    Set<XMLResourceDefinition> types = context.getDefinitionFactory()
            .getResourceDefinitions(projectVersionId, ResourceCategory.HTTP);
    String[] typeStrings = new String[types.size()];
    int i = 0;
    for (XMLResourceDefinition type : types) {
        typeStrings[i++] = type.getId();
    }
    List<Resource> resources = new ArrayList<>(configurationService.findResourcesByTypes(projectVersionId, true, typeStrings));
    if (resources != null) {
        for (Resource resource : resources) {
            cb.addItem(resource);
        }
    }

    cb.setWidth(50.0f, Unit.PERCENTAGE);
    return cb;
}
 
開發者ID:JumpMind,項目名稱:metl,代碼行數:24,代碼來源:ImportXmlTemplateWindow.java

示例6: attach

import com.vaadin.ui.ComboBox; //導入方法依賴的package包/類
@Override
public void attach() {
    // サーバ名(Prefix)
    prefixField = new TextField(ViewProperties.getCaption("field.serverNamePrefix"));
    getLayout().addComponent(prefixField);

    // プラットフォーム
    cloudTable = new SelectCloudTable();
    getLayout().addComponent(cloudTable);

    // サーバ台數
    serverNumber = new ComboBox(ViewProperties.getCaption("field.serverNumber"));
    serverNumber.setWidth("110px");
    serverNumber.setMultiSelect(false);
    for (int i = 1; i <= MAX_ADD_SERVER; i++) {
        serverNumber.addItem(i);
    }
    serverNumber.setNullSelectionAllowed(false);
    serverNumber.setValue(1); // 初期値は1
    getLayout().addComponent(serverNumber);

    initValidation();
}
 
開發者ID:primecloud-controller-org,項目名稱:primecloud-controller,代碼行數:24,代碼來源:WinServerAddSimple.java

示例7: DateSelectionField

import com.vaadin.ui.ComboBox; //導入方法依賴的package包/類
public DateSelectionField() {
    cboMonth = new ComboBox();
    cboMonth.setNullSelectionAllowed(true);
    cboMonth.setPageLength(12);
    cboMonth.setImmediate(true);

    addMonthItems();
    cboMonth.setWidth("117px");

    cboDate = new ComboBox();
    cboDate.setNullSelectionAllowed(true);
    cboDate.setImmediate(true);

    addDayItems();
    cboDate.setWidth("80px");

    cboYear = new ComboBox();
    cboYear.setNullSelectionAllowed(true);
    cboYear.setImmediate(true);

    addYearItems();
    cboYear.setWidth("80px");
}
 
開發者ID:MyCollab,項目名稱:mycollab,代碼行數:24,代碼來源:DateSelectionField.java

示例8: buildMainLayout

import com.vaadin.ui.ComboBox; //導入方法依賴的package包/類
private VerticalLayout buildMainLayout() {
	// common part: create layout
	mainLayout = new VerticalLayout();
	mainLayout.setImmediate(false);
	mainLayout.setWidth("100%");
	mainLayout.setHeight("100%");
	mainLayout.setMargin(false);
	
	// top-level component properties
	setWidth("100.0%");
	setHeight("100.0%");
	
	// comboBox_1
	defaultLocaleField = new ComboBox();
	defaultLocaleField.setImmediate(false);
	defaultLocaleField.setWidth("100.0%");
	defaultLocaleField.setHeight("-1px");
	mainLayout.addComponent(defaultLocaleField);
	
	return mainLayout;
}
 
開發者ID:thingtrack,項目名稱:konekti,代碼行數:22,代碼來源:LocaleField.java

示例9: initElements

import com.vaadin.ui.ComboBox; //導入方法依賴的package包/類
private void initElements() {
	lbId.setValue("Id:");
	lbModule = new Label("Module:");
	lbCategory = new Label("Category:");
	
	module = new ComboBox();
	module.setWidth(WIDTH);
	
	category = new ComboBox();
	category.setWidth(WIDTH);
	
	id.setImmediate(true);
	name.setRequired(true);
	name.setRequiredError(REQUIRED_TEXT);
	description.setRequired(true);
	description.setRequiredError(REQUIRED_TEXT);
}
 
開發者ID:chipster,項目名稱:chipster,代碼行數:18,代碼來源:Tool.java

示例10: createStepperTypeBox

import com.vaadin.ui.ComboBox; //導入方法依賴的package包/類
private ComboBox createStepperTypeBox() {
  List<String> stepperTypes = Arrays.asList("Horizontal", "Vertical");

  ComboBox comboBox = new ComboBox("Stepper Type *", stepperTypes);
  comboBox.setWidth(100, Unit.PERCENTAGE);
  comboBox.setValue(stepperTypes.get(0));
  comboBox.addValueChangeListener(event -> {
    createStepper();
    fireEvent(new StepperCreateEvent(StepperPropertiesLayout.this, stepper));
  });
  return comboBox;
}
 
開發者ID:Juchar,項目名稱:md-stepper,代碼行數:13,代碼來源:StepperPropertiesLayout.java

示例11: createIconStyleBox

import com.vaadin.ui.ComboBox; //導入方法依賴的package包/類
private ComboBox createIconStyleBox() {
  List<String> iconStyles = Arrays.asList("Square", "Circular");
  ComboBox comboBox = new ComboBox("Choose Icon Style", iconStyles);
  comboBox.setWidth(100, Unit.PERCENTAGE);
  comboBox.setValue("Circular");
  comboBox.addValueChangeListener(event -> updateStepperIconStyles());
  return comboBox;
}
 
開發者ID:Juchar,項目名稱:md-stepper,代碼行數:9,代碼來源:StepperPropertiesLayout.java

示例12: buildHorizontalLayout_1

import com.vaadin.ui.ComboBox; //導入方法依賴的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

示例13: buildHorizontalLayout_2

import com.vaadin.ui.ComboBox; //導入方法依賴的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

示例14: buildMainLayout

import com.vaadin.ui.ComboBox; //導入方法依賴的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");
	
	// comboBoxCategories
	comboBoxCategories = new ComboBox();
	comboBoxCategories.setCaption("Select A Category");
	comboBoxCategories.setImmediate(false);
	comboBoxCategories.setWidth("-1px");
	comboBoxCategories.setHeight("-1px");
	comboBoxCategories.setInvalidAllowed(false);
	comboBoxCategories.setRequired(true);
	mainLayout.addComponent(comboBoxCategories);
	mainLayout.setExpandRatio(comboBoxCategories, 1.0f);
	
	// horizontalLayout_2
	horizontalLayout_2 = buildHorizontalLayout_2();
	mainLayout.addComponent(horizontalLayout_2);
	mainLayout.setExpandRatio(horizontalLayout_2, 1.0f);
	
	return mainLayout;
}
 
開發者ID:apache,項目名稱:incubator-openaz,代碼行數:33,代碼來源:AttributeStandardSelectorComponent.java

示例15: buildHorizontalLayout_2

import com.vaadin.ui.ComboBox; //導入方法依賴的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);
	
	// comboBoxCategoryFilter
	comboBoxCategoryFilter = new ComboBox();
	comboBoxCategoryFilter.setCaption("Filter Category");
	comboBoxCategoryFilter.setImmediate(false);
	comboBoxCategoryFilter.setWidth("-1px");
	comboBoxCategoryFilter.setHeight("-1px");
	horizontalLayout_2.addComponent(comboBoxCategoryFilter);
	horizontalLayout_2.setExpandRatio(comboBoxCategoryFilter, 1.0f);
	
	// buttonNewAttribute
	buttonNewAttribute = new Button();
	buttonNewAttribute.setCaption("New Attribute");
	buttonNewAttribute.setImmediate(true);
	buttonNewAttribute
			.setDescription("Click to create a new attribute in the dictionary.");
	buttonNewAttribute.setWidth("-1px");
	buttonNewAttribute.setHeight("-1px");
	horizontalLayout_2.addComponent(buttonNewAttribute);
	horizontalLayout_2.setComponentAlignment(buttonNewAttribute,
			new Alignment(10));
	
	return horizontalLayout_2;
}
 
開發者ID:apache,項目名稱:incubator-openaz,代碼行數:34,代碼來源:AttributeDictionarySelectorComponent.java


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