Java Code Examples for com.vaadin.ui.ComboBox.setWidth()

The following are Jave code examples for showing how to use setWidth() of the com.vaadin.ui.ComboBox class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: extacrm   File: MainSettingsForm.java   Source Code and License Vote up 7 votes
@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;
}
 
Example 2
Project: esup-ecandidat   File: GridFormatting.java   Source Code and License Vote up 6 votes
/**
 * 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);
}
 
Example 3
Project: md-stepper   File: StepperPropertiesLayout.java   Source Code and License Vote up 6 votes
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;
}
 
Example 4
Project: incubator-openaz   File: ExpressionEditorWindow.java   Source Code and License Vote up 6 votes
@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;
}
 
Example 5
Project: metl   File: EditAgentDeploymentPanel.java   Source Code and License Vote up 6 votes
protected ComboBox getStartTypeComponent() {
    startTypeCombo = new ComboBox("Start Type");
    startTypeCombo.setWidth(200, Unit.PIXELS);
    startTypeCombo.setNullSelectionAllowed(false);
    StartType[] values = StartType.values();
    for (StartType value : values) {
        startTypeCombo.addItem(value.name());
    }
    startTypeCombo.setValue(agentDeployment.getStartType());
    startTypeCombo.addValueChangeListener(new ValueChangeListener() {
        public void valueChange(ValueChangeEvent event) {
            agentDeployment.setStartType((String) startTypeCombo.getValue());
            updateScheduleEnable();
            for (int i = 0; i < 7; i++) {
                ListSelect listSelect = ((ListSelect) cronLayout.getComponent(i));
                for (Object itemId : listSelect.getItemIds()) {
                    listSelect.unselect(itemId);
                }
                listSelect.select(listSelect.getItemIds().iterator().next());
            }
            String startExpression = null;
            if (agentDeployment.getStartType().equals(StartType.SCHEDULED_CRON.name())) {
                startExpression = "0 0 0 * * ?";
            }
            startExpressionTextField.setValue(startExpression);
            agentDeployment.setStartExpression(startExpression);
            updateScheduleFields();
            saveAgentDeployment(agentDeployment);
        }
    });
    return startTypeCombo;
}
 
Example 6
Project: metl   File: ImportXmlTemplateWindow.java   Source Code and License Vote up 6 votes
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;
}
 
Example 7
Project: primecloud-controller   File: WinServerAddSimple.java   Source Code and License Vote up 6 votes
@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();
}
 
Example 8
Project: mycollab   File: DateSelectionField.java   Source Code and License Vote up 6 votes
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");
}
 
Example 9
Project: XACML   File: ExpressionEditorWindow.java   Source Code and License Vote up 6 votes
@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;
}
 
Example 10
Project: konekti   File: LocaleField.java   Source Code and License Vote up 6 votes
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;
}
 
Example 11
Project: chipster   File: Tool.java   Source Code and License Vote up 6 votes
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);
}
 
Example 12
Project: md-stepper   File: StepperPropertiesLayout.java   Source Code and License Vote up 5 votes
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;
}
 
Example 13
Project: md-stepper   File: StepperPropertiesLayout.java   Source Code and License Vote up 5 votes
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;
}
 
Example 14
Project: incubator-openaz   File: RangeEditorComponent.java   Source Code and License Vote up 5 votes
@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;
}
 
Example 15
Project: incubator-openaz   File: RangeEditorComponent.java   Source Code and License Vote up 5 votes
@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;
}
 
Example 16
Project: incubator-openaz   File: AttributeStandardSelectorComponent.java   Source Code and License Vote up 5 votes
@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;
}
 
Example 17
Project: incubator-openaz   File: AttributeDictionarySelectorComponent.java   Source Code and License Vote up 5 votes
@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;
}
 
Example 18
Project: hawkbit   File: SPUIComboBoxDecorator.java   Source Code and License Vote up 5 votes
/**
 * Decorate.
 * 
 * @param caption
 *            caption of the combobox
 * @param height
 *            as H
 * @param width
 *            as W
 * @param style
 *            as style
 * @param styleName
 *            as style name
 * @param required
 *            as T|F
 * @param data
 *            as data
 * @param prompt
 *            as promt
 * @return ComboBox as comp
 */
public static ComboBox decorate(final String caption, final String width, final String style,
        final String styleName, final boolean required, final String data, final String prompt) {
    final ComboBox spUICombo = new ComboBox();
    // Default settings
    spUICombo.setRequired(required);
    spUICombo.addStyleName(ValoTheme.COMBOBOX_TINY);

    if (!StringUtils.isEmpty(caption)) {
        spUICombo.setCaption(caption);
    }
    // Add style
    if (!StringUtils.isEmpty(style)) {
        spUICombo.setStyleName(style);
    }
    // Add style Name
    if (!StringUtils.isEmpty(styleName)) {
        spUICombo.addStyleName(styleName);
    }
    // AddWidth
    if (!StringUtils.isEmpty(width)) {
        spUICombo.setWidth(width);
    }
    // Set prompt
    if (!StringUtils.isEmpty(prompt)) {
        spUICombo.setInputPrompt(prompt);
    }
    // Set Data
    if (!StringUtils.isEmpty(data)) {
        spUICombo.setData(data);
    }

    return spUICombo;
}
 
Example 19
Project: hawkbit   File: TargetBulkUpdateWindowLayout.java   Source Code and License Vote up 5 votes
private ComboBox getDsComboField() {
    final Container container = createContainer();
    final ComboBox dsComboBox = SPUIComponentProvider.getComboBox(i18n.getMessage("bulkupload.ds.name"), "", null,
            null, false, "", i18n.getMessage("bulkupload.ds.name"));
    dsComboBox.setSizeUndefined();
    dsComboBox.addStyleName(SPUIDefinitions.BULK_UPLOD_DS_COMBO_STYLE);
    dsComboBox.setImmediate(true);
    dsComboBox.setFilteringMode(FilteringMode.STARTSWITH);
    dsComboBox.setPageLength(7);
    dsComboBox.setContainerDataSource(container);
    dsComboBox.setItemCaptionPropertyId(SPUILabelDefinitions.VAR_NAME_VERSION);
    dsComboBox.setId(UIComponentIdProvider.BULK_UPLOAD_DS_COMBO);
    dsComboBox.setWidth("100%");
    return dsComboBox;
}
 
Example 20
Project: demo-spring-vaadin   File: CityComboboxView.java   Source Code and License Vote up 5 votes
@PostConstruct
void init() {
	// get cities inside germany
	List<City> cities = cityRepository.findByCountryOrderByNameAsc("DE");

	// create combobox
	ComboBox<City> combobox = new ComboBox<City>("Select a City");
	combobox.setItems(cities);
	combobox.setWidth("200px");
	combobox.setItemCaptionGenerator(new ItemCaptionGenerator<City>() {
		
		private static final long serialVersionUID = -5328245622581583103L;

		@Override
		public String apply(City item) {
			return item.getName();
		}
	}); 

	// select listener
	combobox.addSelectionListener(new SingleSelectionListener<City>() {
		
		private static final long serialVersionUID = -5456043484862675591L;

		@Override
		public void selectionChange(SingleSelectionEvent<City> event) {
			LOG.info("City <"+event.getSelectedItem().toString()+"> selected.");
			
		}
	});
	
	addComponent(combobox);
}
 
Example 21
Project: XACML   File: AttributeDictionarySelectorComponent.java   Source Code and License Vote up 5 votes
@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;
}
 
Example 22
Project: metl   File: EditTransformerPanel.java   Source Code and License Vote up 5 votes
public Field<?> createField(final Container dataContainer, final Object itemId, final Object propertyId,
        com.vaadin.ui.Component uiContext) {
    final ComponentAttribSetting setting = (ComponentAttribSetting) itemId;
    Field<?> field = null;

    if (propertyId.equals("value") && (setting.getValue() == null || !setting.getValue().contains("\n"))) {
        final ComboBox combo = new ComboBox();
        combo.setWidth(100, Unit.PERCENTAGE);
        String[] functions = ModelAttributeScriptHelper.getSignatures();
        for (String function : functions) {
            combo.addItem(function);
        }
        combo.setPageLength(functions.length > 20 ? 20 : functions.length);
        if (setting.getValue() != null && !combo.getItemIds().contains(setting.getValue())) {
            combo.addItem(setting.getValue());
        }
        combo.setImmediate(true);
        combo.setNewItemsAllowed(true);
        combo.addValueChangeListener(new ValueChangeListener() {
            public void valueChange(ValueChangeEvent event) {
                setting.setValue((String) combo.getValue());
                context.getConfigurationService().save(setting);
            }
        });
        field = combo;
    }
    return field;
}
 
Example 23
Project: XACML   File: AttributeStandardSelectorComponent.java   Source Code and License Vote up 5 votes
@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;
}
 
Example 24
Project: XACML   File: RangeEditorComponent.java   Source Code and License Vote up 5 votes
@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;
}
 
Example 25
Project: XACML   File: RangeEditorComponent.java   Source Code and License Vote up 5 votes
@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;
}
 
Example 26
Project: extacrm   File: LoanCalculatorForm.java   Source Code and License Vote up 5 votes
public LoanCalculatorForm() {
    super("Рассчет кредита и подбор кредитного продукта");

    final VerticalLayout mainLayout = new VerticalLayout();

    final ExtaFormLayout paramForm = new ExtaFormLayout();
    paramForm.addComponent(new FormGroupHeader("Параметры кредита"));
    priceField = new EditField("Стоимость техники", "Введите стоимость техники");
    priceField.setRequired(true);
    downpaymentField = new PercentOfField("Первоначальный взнос", "Введите сумму первоначального взноса по кредиту");
    downpaymentField.setRequired(true);
    paramForm.addComponent(downpaymentField);

    periodField = new ComboBox("Срок кредитования");
    periodField.setDescription("Введите период кредитования (срок кредита)");
    periodField.setImmediate(true);
    periodField.setNullSelectionAllowed(false);
    periodField.setRequired(true);
    periodField.setWidth(6, Unit.EM);
    // Наполняем возможными сроками кредита
    fillPeriodFieldItems();
    paramForm.addComponent(periodField);

    summField = new EditField("Сумма кредита", "Введите сумму кредита (Также может рассчитываться автоматически)");
    summField.setRequired(true);
    paramForm.addComponent(summField);


    mainLayout.addComponent(paramForm);

    setContent(mainLayout);
}
 
Example 27
Project: konekti   File: MapView.java   Source Code and License Vote up 5 votes
@AutoGenerated
private HorizontalLayout buildLocationDataToolLayout() {
	// common part: create layout
	locationDataToolLayout = new HorizontalLayout();
	locationDataToolLayout.setImmediate(false);
	locationDataToolLayout.setWidth("100.0%");
	locationDataToolLayout.setHeight("-1px");
	locationDataToolLayout.setMargin(false);
	
	// lblLocationData
	lblLocationData = new Label();
	lblLocationData.setImmediate(false);
	lblLocationData.setWidth("-1px");
	lblLocationData.setHeight("-1px");
	lblLocationData.setValue("Location:");
	locationDataToolLayout.addComponent(lblLocationData);
	
	// cmbLocationField
	cmbLocationField = new ComboBox();
	cmbLocationField.setImmediate(false);
	cmbLocationField.setWidth("100.0%");
	cmbLocationField.setHeight("-1px");
	locationDataToolLayout.addComponent(cmbLocationField);
	locationDataToolLayout.setExpandRatio(cmbLocationField, 1.0f);
	
	return locationDataToolLayout;
}
 
Example 28
Project: konekti   File: CalendarViewForm.java   Source Code and License Vote up 5 votes
@AutoGenerated
private HorizontalLayout buildHorizontalLayout_2() {
	// common part: create layout
	horizontalLayout_2 = new HorizontalLayout();
	horizontalLayout_2.setImmediate(false);
	horizontalLayout_2.setWidth("100.0%");
	horizontalLayout_2.setHeight("-1px");
	horizontalLayout_2.setMargin(false);
	horizontalLayout_2.setSpacing(true);
	
	// nameField
	nameField = new TextField();
	nameField.setCaption("Nombre");
	nameField.setImmediate(false);
	nameField.setWidth("100.0%");
	nameField.setHeight("-1px");
	nameField.setTabIndex(1);
	nameField.setRequired(true);
	horizontalLayout_2.addComponent(nameField);
	horizontalLayout_2.setExpandRatio(nameField, 1.0f);
	
	// calendarTypeField
	calendarTypeField = new ComboBox();
	calendarTypeField.setCaption("Tipo calendario");
	calendarTypeField.setImmediate(false);
	calendarTypeField.setWidth("-1px");
	calendarTypeField.setHeight("-1px");
	calendarTypeField.setTabIndex(3);
	calendarTypeField.setRequired(true);
	horizontalLayout_2.addComponent(calendarTypeField);
	
	return horizontalLayout_2;
}
 
Example 29
Project: chipster   File: InputOutputUI.java   Source Code and License Vote up 5 votes
protected void initElements() {
	type2 = new ComboBox();
	type2.setImmediate(true);
	type2.setWidth(WIDTH);
	lbMeta = new Label("Meta:");
	cbMeta = new CheckBox();
	cbMeta.setDescription("Is this element Meta data");
	
	optional.setWidth(WIDTH);
	type = new ComboBox();
	type.setWidth(WIDTH);
	type.setNullSelectionAllowed(false);
	type.setImmediate(true);
	type.addItem(SINGLE_FILE);
	type.addItem(MULTI_FILE);
	type.select(SINGLE_FILE);
	type.addValueChangeListener(new ValueChangeListener() {
		private static final long serialVersionUID = -1134955257251483403L;

		@Override
		public void valueChange(ValueChangeEvent event) {
			if(type.getValue().toString().contentEquals(SINGLE_FILE)) {
				getSingleFileUI();
			} else if(type.getValue().toString().contentEquals(MULTI_FILE)){
				getMultipleFilesUI();
			}
		}
	});
}
 
Example 30
Project: esup-ecandidat   File: GridFormatting.java   Source Code and License Vote up 4 votes
/**
 * Ajoute un filtre de Boolean sur une liste de colonnes
 * 
 * @param filterRow
 * @param container
 * @param property
 * @param labelTrue
 * @param labelFalse
 * @param labelNull
 */
private void addBooleanFilter(String property, String labelTrue, String labelFalse, String labelNull) {
	HeaderCell cell = getFilterCell(property);
	ComboBox cbOuiNon = new ComboBox();
	cbOuiNon.setTextInputAllowed(false);

	List<BooleanPresentation> liste = new ArrayList<BooleanPresentation>();
	BooleanPresentation nullObject = new BooleanPresentation(BooleanValue.ALL,
			applicationContext.getMessage("filter.all", null, UI.getCurrent().getLocale()), null);
	liste.add(nullObject);

	if (labelTrue != null) {
		liste.add(new BooleanPresentation(BooleanValue.TRUE, labelTrue, FontAwesome.CHECK_SQUARE_O));
	}
	if (labelFalse != null) {
		liste.add(new BooleanPresentation(BooleanValue.FALSE, labelFalse, FontAwesome.SQUARE_O));
	}
	if (labelNull != null) {
		liste.add(new BooleanPresentation(BooleanValue.NULL, labelNull, FontAwesome.HOURGLASS_HALF));
	}

	BeanItemContainer<BooleanPresentation> containerOuiNon = new BeanItemContainer<BooleanPresentation>(
			BooleanPresentation.class, liste);
	cbOuiNon.setNullSelectionItemId(nullObject);
	cbOuiNon.setImmediate(true);
	cbOuiNon.setContainerDataSource(containerOuiNon);
	cbOuiNon.setItemCaptionPropertyId("libelle");
	cbOuiNon.setItemCaptionMode(ItemCaptionMode.PROPERTY);
	cbOuiNon.setItemIconPropertyId("icone");
	cbOuiNon.setWidth(100, Unit.PERCENTAGE);
	cbOuiNon.addStyleName(ValoTheme.COMBOBOX_TINY);

	cbOuiNon.addValueChangeListener(change -> {
		container.removeContainerFilters(property);
		if (cbOuiNon.getValue() != null) {
			BooleanPresentation value = (BooleanPresentation) cbOuiNon.getValue();
			if (value != null) {
				BooleanValue booleanValue = value.getValeur();
				switch (booleanValue) {
				case TRUE:
					container.addContainerFilter(new Equal(property, true));
					break;
				case FALSE:
					container.addContainerFilter(new Equal(property, false));
					break;
				case NULL:
					container.addContainerFilter(new Equal(property, null));
					break;
				default:
					break;
				}
			}
			fireFilterListener();
		}
	});
	cell.setComponent(cbOuiNon);
}
 
Example 31
Project: HomeWire-Server   File: StatisticView.java   Source Code and License Vote up 4 votes
private Window getExportWindow() {
  final String[] fileName = {""};

  Window selectWindow = new Window("Export data");
  selectWindow.setClosable(true);
  selectWindow.setDraggable(false);
  selectWindow.setModal(true);
  selectWindow.setResizable(false);
  selectWindow.setWidth(300, Unit.PIXELS);
  selectWindow.addCloseListener(e -> {
    if (!fileName[0].isEmpty()) {
      new File(fileName[0]).delete();
    }
  });

  VerticalLayout windowRoot = new VerticalLayout();

  ComboBox devicesComboBox = new ComboBox("Devices");
  devicesComboBox.setWidth(100, Unit.PERCENTAGE);
  devicesComboBox.setNullSelectionItemId(false);
  devicesComboBox.setContainerDataSource(
      new BeanItemContainer<>(
          DeviceViewDTO.class,
          deviceSetupService.getAllDeviceDtos().stream()
              .map(deviceDTO ->
                  new DeviceViewDTO(deviceDTO.getDevId(), deviceDTO.getType(),
                      deviceDTO.getName()))
              .collect(Collectors.toList())
      )
  );
  windowRoot.addComponent(devicesComboBox);

  Button toExportButton = new Button("Export", event -> {
    DeviceViewDTO selectedDto = (DeviceViewDTO) devicesComboBox.getValue();
    fileName[0] =
        statisticDeviceDataService.exportDataToCsv(selectedDto.getDevId(), selectedDto.getType(),
            selectedDto.getName());

    if (!fileName[0].isEmpty()) {
      windowRoot
          .addComponent(new Link("Download CSV", new FileResource(new File(fileName[0]))));
    } else {
      windowRoot.addComponent(new Label("Export failed! Please Try again!"));
    }

  });
  windowRoot.addComponent(toExportButton);

  selectWindow.setContent(windowRoot);

  return selectWindow;
}
 
Example 32
Project: incubator-openaz   File: ApplyEditorWindow.java   Source Code and License Vote up 4 votes
@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);
	
	// textAreaDescription
	textAreaDescription = new TextArea();
	textAreaDescription.setCaption("Enter A Description");
	textAreaDescription.setImmediate(false);
	textAreaDescription.setWidth("50.0%");
	textAreaDescription.setHeight("-1px");
	horizontalLayout_1.addComponent(textAreaDescription);
	
	// textFieldFilter
	textFieldFilter = new TextField();
	textFieldFilter.setCaption("Filter Function By ID");
	textFieldFilter.setImmediate(false);
	textFieldFilter.setWidth("-1px");
	textFieldFilter.setHeight("-1px");
	horizontalLayout_1.addComponent(textFieldFilter);
	horizontalLayout_1.setComponentAlignment(textFieldFilter,
			new Alignment(9));
	
	// comboBoxDatatypeFilter
	comboBoxDatatypeFilter = new ComboBox();
	comboBoxDatatypeFilter.setCaption("Filter By Data Type");
	comboBoxDatatypeFilter.setImmediate(false);
	comboBoxDatatypeFilter.setWidth("-1px");
	comboBoxDatatypeFilter.setHeight("-1px");
	horizontalLayout_1.addComponent(comboBoxDatatypeFilter);
	horizontalLayout_1.setComponentAlignment(comboBoxDatatypeFilter,
			new Alignment(9));
	
	// checkBoxFilterIsBag
	checkBoxFilterIsBag = new CheckBox();
	checkBoxFilterIsBag.setCaption("Is Bag Filter");
	checkBoxFilterIsBag.setImmediate(false);
	checkBoxFilterIsBag.setWidth("-1px");
	checkBoxFilterIsBag.setHeight("-1px");
	horizontalLayout_1.addComponent(checkBoxFilterIsBag);
	horizontalLayout_1.setComponentAlignment(checkBoxFilterIsBag,
			new Alignment(9));
	
	return horizontalLayout_1;
}
 
Example 33
Project: incubator-openaz   File: AttributeValueEditorWindow.java   Source Code and License Vote up 4 votes
@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");
	
	// comboBoxDatatype
	comboBoxDatatype = new ComboBox();
	comboBoxDatatype.setCaption("Select Datatype");
	comboBoxDatatype.setImmediate(false);
	comboBoxDatatype.setWidth("-1px");
	comboBoxDatatype.setHeight("-1px");
	comboBoxDatatype.setInvalidAllowed(false);
	comboBoxDatatype.setRequired(true);
	mainLayout.addComponent(comboBoxDatatype);
	
	// textFieldValue
	textFieldValue = new TextField();
	textFieldValue.setCaption("Attribute Value");
	textFieldValue.setImmediate(false);
	textFieldValue.setWidth("100.0%");
	textFieldValue.setHeight("-1px");
	textFieldValue.setInvalidAllowed(false);
	textFieldValue.setRequired(true);
	mainLayout.addComponent(textFieldValue);
	
	// 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 34
Project: incubator-openaz   File: PolicyNameEditorWindow.java   Source Code and License Vote up 4 votes
@AutoGenerated
private FormLayout buildMainLayout() {
	// common part: create layout
	mainLayout = new FormLayout();
	mainLayout.setImmediate(false);
	
	// textFieldPolicyName
	textFieldPolicyName = new TextField();
	textFieldPolicyName.setCaption("Policy File Name");
	textFieldPolicyName.setImmediate(true);
	textFieldPolicyName.setWidth("-1px");
	textFieldPolicyName.setHeight("-1px");
	textFieldPolicyName.setInputPrompt("Enter filename eg. foobar.xml");
	textFieldPolicyName.setRequired(true);
	mainLayout.addComponent(textFieldPolicyName);
	
	// textAreaDescription
	textAreaDescription = new TextArea();
	textAreaDescription.setCaption("Description");
	textAreaDescription.setImmediate(false);
	textAreaDescription.setWidth("100%");
	textAreaDescription.setHeight("-1px");
	textAreaDescription
			.setInputPrompt("Enter a description for the Policy/PolicySet.");
	textAreaDescription.setNullSettingAllowed(true);
	mainLayout.addComponent(textAreaDescription);
	
	// optionPolicySet
	optionPolicySet = new OptionGroup();
	optionPolicySet.setCaption("Policy or PolicySet?");
	optionPolicySet.setImmediate(true);
	optionPolicySet
			.setDescription("Is the root level a Policy or Policy Set.");
	optionPolicySet.setWidth("-1px");
	optionPolicySet.setHeight("-1px");
	optionPolicySet.setRequired(true);
	mainLayout.addComponent(optionPolicySet);
	
	// comboAlgorithms
	comboAlgorithms = new ComboBox();
	comboAlgorithms.setCaption("Combining Algorithm");
	comboAlgorithms.setImmediate(false);
	comboAlgorithms.setDescription("Select the combining algorithm.");
	comboAlgorithms.setWidth("-1px");
	comboAlgorithms.setHeight("-1px");
	comboAlgorithms.setRequired(true);
	mainLayout.addComponent(comboAlgorithms);
	
	// 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 35
Project: incubator-openaz   File: SQLPIPConfigurationComponent.java   Source Code and License Vote up 4 votes
@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");
	
	// comboBoxConnectionType
	comboBoxConnectionType = new ComboBox();
	comboBoxConnectionType.setCaption("Type of SQL Connection");
	comboBoxConnectionType.setImmediate(false);
	comboBoxConnectionType.setWidth("-1px");
	comboBoxConnectionType.setHeight("-1px");
	mainLayout.addComponent(comboBoxConnectionType);
	
	// textFieldDataSource
	textFieldDataSource = new TextField();
	textFieldDataSource.setCaption("Data Source");
	textFieldDataSource.setImmediate(false);
	textFieldDataSource.setWidth("-1px");
	textFieldDataSource.setHeight("-1px");
	mainLayout.addComponent(textFieldDataSource);
	mainLayout.setExpandRatio(textFieldDataSource, 1.0f);
	
	// comboBoxSQLDriver
	comboBoxSQLDriver = new ComboBox();
	comboBoxSQLDriver.setCaption("JDBC Driver");
	comboBoxSQLDriver.setImmediate(false);
	comboBoxSQLDriver.setWidth("-1px");
	comboBoxSQLDriver.setHeight("-1px");
	mainLayout.addComponent(comboBoxSQLDriver);
	mainLayout.setExpandRatio(comboBoxSQLDriver, 1.0f);
	
	// textFieldConnectionURL
	textFieldConnectionURL = new TextField();
	textFieldConnectionURL.setCaption("Connection URL");
	textFieldConnectionURL.setImmediate(false);
	textFieldConnectionURL.setWidth("-1px");
	textFieldConnectionURL.setHeight("-1px");
	mainLayout.addComponent(textFieldConnectionURL);
	mainLayout.setExpandRatio(textFieldConnectionURL, 1.0f);
	
	// textFieldUser
	textFieldUser = new TextField();
	textFieldUser.setCaption("User");
	textFieldUser.setImmediate(false);
	textFieldUser.setWidth("-1px");
	textFieldUser.setHeight("-1px");
	mainLayout.addComponent(textFieldUser);
	mainLayout.setExpandRatio(textFieldUser, 1.0f);
	
	// textFieldPassword
	textFieldPassword = new PasswordField();
	textFieldPassword.setCaption("Password");
	textFieldPassword.setImmediate(false);
	textFieldPassword.setWidth("-1px");
	textFieldPassword.setHeight("-1px");
	mainLayout.addComponent(textFieldPassword);
	mainLayout.setExpandRatio(textFieldPassword, 1.0f);
	
	// buttonTest
	buttonTest = new Button();
	buttonTest.setCaption("Test Connection");
	buttonTest.setImmediate(true);
	buttonTest.setWidth("-1px");
	buttonTest.setHeight("-1px");
	mainLayout.addComponent(buttonTest);
	mainLayout.setComponentAlignment(buttonTest, new Alignment(48));
	
	return mainLayout;
}
 
Example 36
Project: incubator-openaz   File: ObadviceDictionary.java   Source Code and License Vote up 4 votes
@AutoGenerated
private HorizontalLayout buildHorizontalLayoutToolbar() {
	// common part: create layout
	horizontalLayoutToolbar = new HorizontalLayout();
	horizontalLayoutToolbar.setImmediate(false);
	horizontalLayoutToolbar.setWidth("-1px");
	horizontalLayoutToolbar.setHeight("-1px");
	horizontalLayoutToolbar.setMargin(false);
	horizontalLayoutToolbar.setSpacing(true);
	
	// buttonNew
	buttonNew = new Button();
	buttonNew.setCaption("New");
	buttonNew.setImmediate(true);
	buttonNew
			.setDescription("Add a new advice or obligation to the dictionary.");
	buttonNew.setWidth("-1px");
	buttonNew.setHeight("-1px");
	horizontalLayoutToolbar.addComponent(buttonNew);
	horizontalLayoutToolbar.setComponentAlignment(buttonNew, new Alignment(
			24));
	
	// buttonRemove
	buttonRemove = new Button();
	buttonRemove.setCaption("Remove");
	buttonRemove.setImmediate(true);
	buttonRemove
			.setDescription("Remove the selected advice or obligation from the dictionary.");
	buttonRemove.setWidth("-1px");
	buttonRemove.setHeight("-1px");
	horizontalLayoutToolbar.addComponent(buttonRemove);
	horizontalLayoutToolbar.setComponentAlignment(buttonRemove,
			new Alignment(24));
	
	// buttonClone
	buttonClone = new Button();
	buttonClone.setCaption("Clone");
	buttonClone.setImmediate(true);
	buttonClone.setDescription("Clone the selected obligation/advice.");
	buttonClone.setWidth("-1px");
	buttonClone.setHeight("-1px");
	horizontalLayoutToolbar.addComponent(buttonClone);
	horizontalLayoutToolbar.setComponentAlignment(buttonClone,
			new Alignment(24));
	
	// comboBoxFilter
	comboBoxFilter = new ComboBox();
	comboBoxFilter.setCaption("Filter By Type");
	comboBoxFilter.setImmediate(false);
	comboBoxFilter.setWidth("-1px");
	comboBoxFilter.setHeight("-1px");
	horizontalLayoutToolbar.addComponent(comboBoxFilter);
	
	return horizontalLayoutToolbar;
}
 
Example 37
Project: incubator-openaz   File: AttributeDictionary.java   Source Code and License Vote up 4 votes
@AutoGenerated
private HorizontalLayout buildHorizontalLayoutToolbar() {
	// common part: create layout
	horizontalLayoutToolbar = new HorizontalLayout();
	horizontalLayoutToolbar.setImmediate(false);
	horizontalLayoutToolbar.setWidth("-1px");
	horizontalLayoutToolbar.setHeight("-1px");
	horizontalLayoutToolbar.setMargin(false);
	horizontalLayoutToolbar.setSpacing(true);
	
	// buttonNew
	buttonNew = new Button();
	buttonNew.setCaption("New");
	buttonNew.setImmediate(true);
	buttonNew.setDescription("Create a new attribute");
	buttonNew.setWidth("70px");
	buttonNew.setHeight("-1px");
	horizontalLayoutToolbar.addComponent(buttonNew);
	horizontalLayoutToolbar.setComponentAlignment(buttonNew, new Alignment(
			9));
	
	// buttonRemove
	buttonRemove = new Button();
	buttonRemove.setCaption("Remove");
	buttonRemove.setImmediate(true);
	buttonRemove.setDescription("Remove the selected attribute(s)");
	buttonRemove.setWidth("-1px");
	buttonRemove.setHeight("-1px");
	horizontalLayoutToolbar.addComponent(buttonRemove);
	horizontalLayoutToolbar.setComponentAlignment(buttonRemove,
			new Alignment(9));
	
	// buttonClone
	buttonClone = new Button();
	buttonClone.setCaption("Clone");
	buttonClone.setImmediate(true);
	buttonClone.setDescription("Clone an attribute.");
	buttonClone.setWidth("-1px");
	buttonClone.setHeight("-1px");
	horizontalLayoutToolbar.addComponent(buttonClone);
	horizontalLayoutToolbar.setComponentAlignment(buttonClone,
			new Alignment(9));
	
	// comboBoxFilterCategory
	comboBoxFilterCategory = new ComboBox();
	comboBoxFilterCategory.setCaption("Filter By Category");
	comboBoxFilterCategory.setImmediate(false);
	comboBoxFilterCategory.setWidth("-1px");
	comboBoxFilterCategory.setHeight("-1px");
	horizontalLayoutToolbar.addComponent(comboBoxFilterCategory);
	
	// comboBoxFilterDatatype
	comboBoxFilterDatatype = new ComboBox();
	comboBoxFilterDatatype.setCaption("Filter By Data Type");
	comboBoxFilterDatatype.setImmediate(false);
	comboBoxFilterDatatype.setWidth("-1px");
	comboBoxFilterDatatype.setHeight("-1px");
	horizontalLayoutToolbar.addComponent(comboBoxFilterDatatype);
	
	return horizontalLayoutToolbar;
}
 
Example 38
Project: metl   File: PluginsPanelAddDialog.java   Source Code and License Vote up 4 votes
protected AbstractLayout buildSearchLayout() {
    FormLayout layout = new FormLayout();
    layout.setMargin(true);

    List<Plugin> existingPlugins = context.getPluginService().findPlugins();
    Set<String> groups = new HashSet<>();
    Set<String> names = new HashSet<>();
    for (Plugin plugin : existingPlugins) {
        groups.add(plugin.getArtifactGroup());
        names.add(plugin.getArtifactName());
    }

    versionSelect = new ListSelect("Versions");
    groupCombo = new ComboBox("Group");
    nameCombo = new ComboBox("Name");

    versionSelect.setRows(4);
    versionSelect.setMultiSelect(false);
    versionSelect.setNullSelectionAllowed(false);
    versionSelect.setWidth(100, Unit.PERCENTAGE);
    versionSelect.addValueChangeListener(e -> versionSelected());

    groupCombo.setWidth(100, Unit.PERCENTAGE);
    groupCombo.setNewItemsAllowed(true);
    groupCombo.addItems(groups);
    groupCombo.addValueChangeListener(e -> {
        populateNameField(nameCombo);
        setSearchButtonEnabled();
    });
    groupCombo.setNewItemHandler((newItemCaption) -> {
        groupCombo.removeItem(handEnteredGroup);
        handEnteredGroup = newItemCaption;
        groupCombo.addItem(handEnteredGroup);
        groupCombo.setValue(handEnteredGroup);
        setSearchButtonEnabled();
    });
    layout.addComponent(groupCombo);

    nameCombo.setWidth(100, Unit.PERCENTAGE);
    nameCombo.setNewItemsAllowed(true);
    nameCombo.addItems(names);
    nameCombo.addValueChangeListener(e -> {
        setSearchButtonEnabled();
    });
    nameCombo.setNewItemHandler((newItemCaption) -> {
        nameCombo.removeItem(handEnteredName);
        handEnteredName = newItemCaption;
        nameCombo.addItem(handEnteredName);
        nameCombo.setValue(handEnteredName);
        setSearchButtonEnabled();
    });
    layout.addComponent(nameCombo);

    layout.addComponent(versionSelect);

    return layout;
}
 
Example 39
Project: XACML   File: SQLPIPConfigurationComponent.java   Source Code and License Vote up 4 votes
@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");
	
	// comboBoxConnectionType
	comboBoxConnectionType = new ComboBox();
	comboBoxConnectionType.setCaption("Type of SQL Connection");
	comboBoxConnectionType.setImmediate(false);
	comboBoxConnectionType.setWidth("-1px");
	comboBoxConnectionType.setHeight("-1px");
	mainLayout.addComponent(comboBoxConnectionType);
	
	// textFieldDataSource
	textFieldDataSource = new TextField();
	textFieldDataSource.setCaption("Data Source");
	textFieldDataSource.setImmediate(false);
	textFieldDataSource.setWidth("-1px");
	textFieldDataSource.setHeight("-1px");
	mainLayout.addComponent(textFieldDataSource);
	mainLayout.setExpandRatio(textFieldDataSource, 1.0f);
	
	// comboBoxSQLDriver
	comboBoxSQLDriver = new ComboBox();
	comboBoxSQLDriver.setCaption("JDBC Driver");
	comboBoxSQLDriver.setImmediate(false);
	comboBoxSQLDriver.setWidth("-1px");
	comboBoxSQLDriver.setHeight("-1px");
	mainLayout.addComponent(comboBoxSQLDriver);
	mainLayout.setExpandRatio(comboBoxSQLDriver, 1.0f);
	
	// textFieldConnectionURL
	textFieldConnectionURL = new TextField();
	textFieldConnectionURL.setCaption("Connection URL");
	textFieldConnectionURL.setImmediate(false);
	textFieldConnectionURL.setWidth("-1px");
	textFieldConnectionURL.setHeight("-1px");
	mainLayout.addComponent(textFieldConnectionURL);
	mainLayout.setExpandRatio(textFieldConnectionURL, 1.0f);
	
	// textFieldUser
	textFieldUser = new TextField();
	textFieldUser.setCaption("User");
	textFieldUser.setImmediate(false);
	textFieldUser.setWidth("-1px");
	textFieldUser.setHeight("-1px");
	mainLayout.addComponent(textFieldUser);
	mainLayout.setExpandRatio(textFieldUser, 1.0f);
	
	// textFieldPassword
	textFieldPassword = new PasswordField();
	textFieldPassword.setCaption("Password");
	textFieldPassword.setImmediate(false);
	textFieldPassword.setWidth("-1px");
	textFieldPassword.setHeight("-1px");
	mainLayout.addComponent(textFieldPassword);
	mainLayout.setExpandRatio(textFieldPassword, 1.0f);
	
	// buttonTest
	buttonTest = new Button();
	buttonTest.setCaption("Test Connection");
	buttonTest.setImmediate(true);
	buttonTest.setWidth("-1px");
	buttonTest.setHeight("-1px");
	mainLayout.addComponent(buttonTest);
	mainLayout.setComponentAlignment(buttonTest, new Alignment(48));
	
	return mainLayout;
}
 
Example 40
Project: XACML   File: AttributeDictionary.java   Source Code and License Vote up 4 votes
@AutoGenerated
private HorizontalLayout buildHorizontalLayoutToolbar() {
	// common part: create layout
	horizontalLayoutToolbar = new HorizontalLayout();
	horizontalLayoutToolbar.setImmediate(false);
	horizontalLayoutToolbar.setWidth("-1px");
	horizontalLayoutToolbar.setHeight("-1px");
	horizontalLayoutToolbar.setMargin(false);
	horizontalLayoutToolbar.setSpacing(true);
	
	// buttonNew
	buttonNew = new Button();
	buttonNew.setCaption("New");
	buttonNew.setImmediate(true);
	buttonNew.setDescription("Create a new attribute");
	buttonNew.setWidth("70px");
	buttonNew.setHeight("-1px");
	horizontalLayoutToolbar.addComponent(buttonNew);
	horizontalLayoutToolbar.setComponentAlignment(buttonNew, new Alignment(
			9));
	
	// buttonRemove
	buttonRemove = new Button();
	buttonRemove.setCaption("Remove");
	buttonRemove.setImmediate(true);
	buttonRemove.setDescription("Remove the selected attribute(s)");
	buttonRemove.setWidth("-1px");
	buttonRemove.setHeight("-1px");
	horizontalLayoutToolbar.addComponent(buttonRemove);
	horizontalLayoutToolbar.setComponentAlignment(buttonRemove,
			new Alignment(9));
	
	// buttonClone
	buttonClone = new Button();
	buttonClone.setCaption("Clone");
	buttonClone.setImmediate(true);
	buttonClone.setDescription("Clone an attribute.");
	buttonClone.setWidth("-1px");
	buttonClone.setHeight("-1px");
	horizontalLayoutToolbar.addComponent(buttonClone);
	horizontalLayoutToolbar.setComponentAlignment(buttonClone,
			new Alignment(9));
	
	// comboBoxFilterCategory
	comboBoxFilterCategory = new ComboBox();
	comboBoxFilterCategory.setCaption("Filter By Category");
	comboBoxFilterCategory.setImmediate(false);
	comboBoxFilterCategory.setWidth("-1px");
	comboBoxFilterCategory.setHeight("-1px");
	horizontalLayoutToolbar.addComponent(comboBoxFilterCategory);
	
	// comboBoxFilterDatatype
	comboBoxFilterDatatype = new ComboBox();
	comboBoxFilterDatatype.setCaption("Filter By Data Type");
	comboBoxFilterDatatype.setImmediate(false);
	comboBoxFilterDatatype.setWidth("-1px");
	comboBoxFilterDatatype.setHeight("-1px");
	horizontalLayoutToolbar.addComponent(comboBoxFilterDatatype);
	
	return horizontalLayoutToolbar;
}
 
Example 41
Project: primecloud-controller   File: WinLoadBalancerEdit.java   Source Code and License Vote up 4 votes
@Override
public void attach() {
    setHeight(TAB_HEIGHT);
    setMargin(false, true, true, true);
    setSpacing(false);

    // メインフォーム
    Form mainForm = new Form();
    addComponent(mainForm);

    // 監視プロトコル
    checkProtocolSelect = new ComboBox(ViewProperties.getCaption("field.checkProtocol"));
    checkProtocolSelect.setWidth(TEXT_WIDTH);
    checkProtocolSelect.setImmediate(true);
    checkProtocolSelect.setNullSelectionAllowed(false);
    checkProtocolSelect.addListener(new Property.ValueChangeListener() {
        @Override
        public void valueChange(Property.ValueChangeEvent event) {
            checkProtocolValueChange(event);
        }
    });
    mainForm.getLayout().addComponent(checkProtocolSelect);

    // 監視ポート
    checkPortField = new TextField(ViewProperties.getCaption("field.checkPort"));
    checkPortField.setWidth(TEXT_WIDTH);
    mainForm.getLayout().addComponent(checkPortField);

    // 監視Path
    checkPathField = new TextField(ViewProperties.getCaption("field.checkPath"));
    checkPathField.setImmediate(true);
    mainForm.getLayout().addComponent(checkPathField);

    // ヘルスチェック詳細設定パネル
    Panel panel = new Panel(ViewProperties.getCaption("field.healthCheckDetail"));
    ((Layout) panel.getContent()).setMargin(false, false, false, true);
    ((Layout) panel.getContent()).setHeight("200px");
    ((Layout) panel.getContent()).setWidth("315px");
    mainForm.getLayout().addComponent(panel);

    // サブフォーム
    Form subForm = new Form();
    subForm.setStyleName("panel-healthcheck-setting");
    subForm.getLayout().setMargin(false, false, false, false);
    panel.addComponent(subForm);

    // タイムアウト時間
    checkTimeoutField = new TextField(ViewProperties.getCaption("field.checkTimeout"));
    checkTimeoutField.setWidth(TEXT_WIDTH);
    subForm.getLayout().addComponent(checkTimeoutField);

    // ヘルスチェック間隔
    checkIntervalField = new TextField(ViewProperties.getCaption("field.checkInterval"));
    checkIntervalField.setWidth(TEXT_WIDTH);
    subForm.getLayout().addComponent(checkIntervalField);

    // 障害閾値
    unhealthyThresholdField = new TextField(ViewProperties.getCaption("field.checkDownThreshold"));
    unhealthyThresholdField.setWidth(TEXT_WIDTH);
    subForm.getLayout().addComponent(unhealthyThresholdField);

    // 復帰閾値
    healthyThresholdField = new TextField(ViewProperties.getCaption("field.checkRecoverThreshold"));
    healthyThresholdField.setWidth(TEXT_WIDTH);
    subForm.getLayout().addComponent(healthyThresholdField);

    // UltraMonkeyロードバランサの場合、復帰閾値は設定できない
    if (PCCConstant.LOAD_BALANCER_ULTRAMONKEY.equals(loadBalancerType)) {
        healthyThresholdField.setEnabled(false);
    }

    initValidation();
}
 
Example 42
Project: primecloud-controller   File: WinServerEdit.java   Source Code and License Vote up 4 votes
public VcloudDetailTab(InstanceDto instance, PlatformDto platform, ImageDto image) {
    this.instance = instance;
    this.platform = platform;
    this.image = image;

    setHeight(TAB_HEIGHT);
    setMargin(false, true, false, true);
    setSpacing(false);

    //ストレージタイプ
    storageTypeSelect = new ComboBox(ViewProperties.getCaption("field.storageType"));
    storageTypeSelect.setWidth(WIDTH_COMBOBOX);
    storageTypeSelect.setNullSelectionAllowed(false);
    storageTypeSelect.setItemCaptionPropertyId(CID_STORAGE_TYPE);
    storageTypeSelect.setItemCaptionMode(AbstractSelect.ITEM_CAPTION_MODE_PROPERTY);

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

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

    Label spacer = new Label(" ");
    spacer.addStyleName("desc-padding-horizontal");
    spacer.setHeight("5px");

    //データディスクテーブル
    dataDiskTable = new DataDiskTable();

    //データディスクボタン
    dataDiskTableButtons = new DataDiskTableButtons();

    form.getLayout().addComponent(storageTypeSelect);
    form.getLayout().addComponent(sizeSelect);
    form.getLayout().addComponent(keySelect);
    form.getLayout().addComponent(spacer);
    form.getLayout().addComponent(dataDiskTable);
    form.getLayout().addComponent(dataDiskTableButtons);

    addComponent(form);

    // サーバがStopped以外の場合は、変更不可とする
    InstanceStatus status = InstanceStatus.fromStatus(instance.getInstance().getStatus());
    if (status != InstanceStatus.STOPPED) {
        storageTypeSelect.setEnabled(false);
        sizeSelect.setEnabled(false);
        keySelect.setEnabled(false);
    }
}
 
Example 43
Project: primecloud-controller   File: WinServerEdit.java   Source Code and License Vote up 4 votes
public AzureDetailTab(InstanceDto instance, PlatformDto platform, ImageDto image) {
    this.instance = instance;
    this.platform = platform;
    this.image = image;

    setHeight(TAB_HEIGHT);
    setMargin(false, true, false, true);
    setSpacing(false);

    sizeSelect = new ComboBox(ViewProperties.getCaption("field.serverSize"));
    sizeSelect.setWidth(COMBOBOX_WIDTH);
    sizeSelect.setNullSelectionAllowed(false);

    availabilitySetSelect = new ComboBox(ViewProperties.getCaption("field.availabilitySet"));
    availabilitySetSelect.setWidth(COMBOBOX_WIDTH);
    availabilitySetSelect.setNullSelectionAllowed(false);

    locationField = new TextField(ViewProperties.getCaption("field.location"));
    locationField.setImmediate(true);
    locationField.setWidth(TEXT_WIDTH);

    affinityField = new TextField(ViewProperties.getCaption("field.affinityGroup"));
    affinityField.setImmediate(true);
    affinityField.setWidth(TEXT_WIDTH);

    cloudServiceField = new TextField(ViewProperties.getCaption("field.cloudService"));
    cloudServiceField.setImmediate(true);
    cloudServiceField.setWidth(TEXT_WIDTH);

    subnetSelect = new ComboBox(ViewProperties.getCaption("field.subnet"));
    subnetSelect.setImmediate(true);
    subnetSelect.setWidth(COMBOBOX_WIDTH);
    subnetSelect.setNullSelectionAllowed(false);
    subnetSelect.setItemCaptionPropertyId(CIDR_BLOCK_CAPTION_ID);
    subnetSelect.setItemCaptionMode(AbstractSelect.ITEM_CAPTION_MODE_PROPERTY);

    storageAccountField = new TextField(ViewProperties.getCaption("field.storageAccount"));
    storageAccountField.setImmediate(true);
    storageAccountField.setWidth(COMBOBOX_WIDTH);

    Label spacer = new Label(" ");
    spacer.addStyleName("desc-padding-horizontal");
    spacer.setHeight("5px");

    form.getLayout().addComponent(sizeSelect);
    form.getLayout().addComponent(availabilitySetSelect);
    form.getLayout().addComponent(subnetSelect);
    form.getLayout().addComponent(spacer);

    HorizontalLayout layout = new HorizontalLayout();
    layout.setSpacing(true);
    layout.setMargin(false);

    form.getLayout().addComponent(layout);

    addComponent(form);

    InstanceStatus status = InstanceStatus.fromStatus(instance.getInstance().getStatus());
    if (status != InstanceStatus.STOPPED) {
        // サーバがStopped以外の場合は、詳細設定タブ自体を変更不可とする
        form.setEnabled(false);
    } else {
        // 停止時は、いくつかの項目を変更不可とする
        locationField.setEnabled(false);
        // サーバが作成済みのとき、変更不可
        if (StringUtils.isNotEmpty(instance.getAzureInstance().getInstanceName())) {
            subnetSelect.setEnabled(false);
            // TODO 可用性セットが設定済みの場合も変更可能かもしれないが、
            // 現段階では、APIから可用性セットの情報を取得できないのでサーバー作成済みの場合、変更不可とする
            availabilitySetSelect.setEnabled(false);
        }
    }
}
 
Example 44
Project: XACML   File: ObadviceDictionary.java   Source Code and License Vote up 4 votes
@AutoGenerated
private HorizontalLayout buildHorizontalLayoutToolbar() {
	// common part: create layout
	horizontalLayoutToolbar = new HorizontalLayout();
	horizontalLayoutToolbar.setImmediate(false);
	horizontalLayoutToolbar.setWidth("-1px");
	horizontalLayoutToolbar.setHeight("-1px");
	horizontalLayoutToolbar.setMargin(false);
	horizontalLayoutToolbar.setSpacing(true);
	
	// buttonNew
	buttonNew = new Button();
	buttonNew.setCaption("New");
	buttonNew.setImmediate(true);
	buttonNew
			.setDescription("Add a new advice or obligation to the dictionary.");
	buttonNew.setWidth("-1px");
	buttonNew.setHeight("-1px");
	horizontalLayoutToolbar.addComponent(buttonNew);
	horizontalLayoutToolbar.setComponentAlignment(buttonNew, new Alignment(
			24));
	
	// buttonRemove
	buttonRemove = new Button();
	buttonRemove.setCaption("Remove");
	buttonRemove.setImmediate(true);
	buttonRemove
			.setDescription("Remove the selected advice or obligation from the dictionary.");
	buttonRemove.setWidth("-1px");
	buttonRemove.setHeight("-1px");
	horizontalLayoutToolbar.addComponent(buttonRemove);
	horizontalLayoutToolbar.setComponentAlignment(buttonRemove,
			new Alignment(24));
	
	// buttonClone
	buttonClone = new Button();
	buttonClone.setCaption("Clone");
	buttonClone.setImmediate(true);
	buttonClone.setDescription("Clone the selected obligation/advice.");
	buttonClone.setWidth("-1px");
	buttonClone.setHeight("-1px");
	horizontalLayoutToolbar.addComponent(buttonClone);
	horizontalLayoutToolbar.setComponentAlignment(buttonClone,
			new Alignment(24));
	
	// comboBoxFilter
	comboBoxFilter = new ComboBox();
	comboBoxFilter.setCaption("Filter By Type");
	comboBoxFilter.setImmediate(false);
	comboBoxFilter.setWidth("-1px");
	comboBoxFilter.setHeight("-1px");
	horizontalLayoutToolbar.addComponent(comboBoxFilter);
	
	return horizontalLayoutToolbar;
}
 
Example 45
Project: primecloud-controller   File: WinLoadBalancerConfigListener.java   Source Code and License Vote up 4 votes
@Override
public void attach() {
    // メインフォーム
    Form mainForm = new Form();
    Layout mainLayout = mainForm.getLayout();
    addComponent(mainForm);

    // ロードバランサ名
    nameField = new TextField(ViewProperties.getCaption("field.loadBalancerName"));
    nameField.setReadOnly(true);
    mainLayout.addComponent(nameField);

    // サービス名
    serviceField = new TextField(ViewProperties.getCaption("field.loadBalancerService"));
    serviceField.setReadOnly(true);
    mainLayout.addComponent(serviceField);

    // ロードバランサ設定パネル
    Panel panel = new Panel(ViewProperties.getCaption("field.loadBalancerConfig"));
    ((Layout) panel.getContent()).setMargin(false, false, false, true);
    mainLayout.addComponent(panel);

    // サブフォーム
    subForm = new Form();
    FormLayout sublayout = (FormLayout) this.subForm.getLayout();
    sublayout.setMargin(false);
    sublayout.setSpacing(false);
    panel.getContent().addComponent(subForm);
    subForm.setHeight("200px");

    // ロードバランサポート
    loadBalancerPortField = new TextField(ViewProperties.getCaption("field.loadBalancerPort"));
    loadBalancerPortField.setWidth(TEXT_WIDTH);
    sublayout.addComponent(loadBalancerPortField);

    // サービスポート
    servicePortField = new TextField(ViewProperties.getCaption("field.loadBalancerServicePort"));
    servicePortField.setWidth(TEXT_WIDTH);
    sublayout.addComponent(servicePortField);

    // プロトコル
    protocolSelect = new ComboBox(ViewProperties.getCaption("field.loadBalancerProtocol"));
    protocolSelect.setWidth(TEXT_WIDTH);
    protocolSelect.setImmediate(true);
    sublayout.addComponent(protocolSelect);
    protocolSelect.addListener(new Property.ValueChangeListener() {
        @Override
        public void valueChange(Property.ValueChangeEvent event) {
            protocolValueChange(event);
        }
    });

    // SSLキー
    sslKeySelect = new ComboBox(ViewProperties.getCaption("field.loadBalancerSSLKey"));
    sslKeySelect.setWidth(TEXT_WIDTH);
    sslKeySelect.addContainerProperty(SSLKEY_CAPTION_ID, String.class, null);
    sslKeySelect.setItemCaptionMode(AbstractSelect.ITEM_CAPTION_MODE_PROPERTY);
    sslKeySelect.setItemCaptionPropertyId(SSLKEY_CAPTION_ID);
    sublayout.addComponent(sslKeySelect);

    initValidation();
}
 
Example 46
Project: XACML   File: ApplyEditorWindow.java   Source Code and License Vote up 4 votes
@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);
	
	// textAreaDescription
	textAreaDescription = new TextArea();
	textAreaDescription.setCaption("Enter A Description");
	textAreaDescription.setImmediate(false);
	textAreaDescription.setWidth("50.0%");
	textAreaDescription.setHeight("-1px");
	horizontalLayout_1.addComponent(textAreaDescription);
	
	// textFieldFilter
	textFieldFilter = new TextField();
	textFieldFilter.setCaption("Filter Function By ID");
	textFieldFilter.setImmediate(false);
	textFieldFilter.setWidth("-1px");
	textFieldFilter.setHeight("-1px");
	horizontalLayout_1.addComponent(textFieldFilter);
	horizontalLayout_1.setComponentAlignment(textFieldFilter,
			new Alignment(9));
	
	// comboBoxDatatypeFilter
	comboBoxDatatypeFilter = new ComboBox();
	comboBoxDatatypeFilter.setCaption("Filter By Data Type");
	comboBoxDatatypeFilter.setImmediate(false);
	comboBoxDatatypeFilter.setWidth("-1px");
	comboBoxDatatypeFilter.setHeight("-1px");
	horizontalLayout_1.addComponent(comboBoxDatatypeFilter);
	horizontalLayout_1.setComponentAlignment(comboBoxDatatypeFilter,
			new Alignment(9));
	
	// checkBoxFilterIsBag
	checkBoxFilterIsBag = new CheckBox();
	checkBoxFilterIsBag.setCaption("Is Bag Filter");
	checkBoxFilterIsBag.setImmediate(false);
	checkBoxFilterIsBag.setWidth("-1px");
	checkBoxFilterIsBag.setHeight("-1px");
	horizontalLayout_1.addComponent(checkBoxFilterIsBag);
	horizontalLayout_1.setComponentAlignment(checkBoxFilterIsBag,
			new Alignment(9));
	
	return horizontalLayout_1;
}
 
Example 47
Project: XACML   File: PolicyNameEditorWindow.java   Source Code and License Vote up 4 votes
@AutoGenerated
private FormLayout buildMainLayout() {
	// common part: create layout
	mainLayout = new FormLayout();
	mainLayout.setImmediate(false);
	
	// textFieldPolicyName
	textFieldPolicyName = new TextField();
	textFieldPolicyName.setCaption("Policy File Name");
	textFieldPolicyName.setImmediate(true);
	textFieldPolicyName.setWidth("-1px");
	textFieldPolicyName.setHeight("-1px");
	textFieldPolicyName.setInputPrompt("Enter filename eg. foobar.xml");
	textFieldPolicyName.setRequired(true);
	mainLayout.addComponent(textFieldPolicyName);
	
	// textAreaDescription
	textAreaDescription = new TextArea();
	textAreaDescription.setCaption("Description");
	textAreaDescription.setImmediate(false);
	textAreaDescription.setWidth("100%");
	textAreaDescription.setHeight("-1px");
	textAreaDescription
			.setInputPrompt("Enter a description for the Policy/PolicySet.");
	textAreaDescription.setNullSettingAllowed(true);
	mainLayout.addComponent(textAreaDescription);
	
	// optionPolicySet
	optionPolicySet = new OptionGroup();
	optionPolicySet.setCaption("Policy or PolicySet?");
	optionPolicySet.setImmediate(true);
	optionPolicySet
			.setDescription("Is the root level a Policy or Policy Set.");
	optionPolicySet.setWidth("-1px");
	optionPolicySet.setHeight("-1px");
	optionPolicySet.setRequired(true);
	mainLayout.addComponent(optionPolicySet);
	
	// comboAlgorithms
	comboAlgorithms = new ComboBox();
	comboAlgorithms.setCaption("Combining Algorithm");
	comboAlgorithms.setImmediate(false);
	comboAlgorithms.setDescription("Select the combining algorithm.");
	comboAlgorithms.setWidth("-1px");
	comboAlgorithms.setHeight("-1px");
	comboAlgorithms.setRequired(true);
	mainLayout.addComponent(comboAlgorithms);
	
	// 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 48
Project: extacrm   File: ProductField.java   Source Code and License Vote up 4 votes
@Override
    protected Component initContent() {
        // A vertical layout with undefined width
        final VerticalLayout box = new VerticalLayout();
        box.setSizeUndefined();

        final ComboBox productSelect = new ComboBox();
        productSelect.setInputPrompt("Выберите продукт...");
        productSelect.setImmediate(true);
        productSelect.setNullSelectionAllowed(false);

        // Инициализация контейнера
        final ExtaDbContainer<TProduct> clientsCont = new ExtaDbContainer<>(productCls);
        clientsCont.addContainerFilter(new Compare.Equal("active", true));
        clientsCont.sort(new Object[]{"name"}, new boolean[]{true});

        // Устанавливаем контент выбора
        productSelect.setFilteringMode(FilteringMode.CONTAINS);
        productSelect.setContainerDataSource(clientsCont);
        productSelect.setItemCaptionMode(ItemCaptionMode.PROPERTY);
        productSelect.setItemCaptionPropertyId("name");
        productSelect.addStyleName(ExtaTheme.COMBOBOX_BORDERLESS);

        productSelect.setPropertyDataSource(getPropertyDataSource());
        productSelect.addValueChangeListener(e -> setValue((TProduct) productSelect.getConvertedValue()));
//        productSelect.setValue(getValue());
        clientsCont.setSingleSelectConverter(productSelect);

        productSelect.setWidth(100, Unit.PERCENTAGE);
        box.addComponent(productSelect);
        // The layout shrinks to fit this label
        final Label label = new Label(getFieldTextLabel());
        label.addStyleName("ea-widthfittin-label");
        label.setWidthUndefined();
        label.setHeight("0px"); // Hide: Could be 0px
        box.addComponent(label);

        addValueChangeListener(e -> label.setValue(getFieldTextLabel()));

        return box;
    }
 
Example 49
Project: extacrm   File: InstallmentInSaleEditForm.java   Source Code and License Vote up 4 votes
/**
 * <p>createEditFields.</p>
 *
 * @return a {@link com.vaadin.ui.ComponentContainer} object.
 */
@Override
protected ComponentContainer createEditFields() {
    final ExtaFormLayout form = new ExtaFormLayout();

    form.addComponent(new FormGroupHeader("Продукт"));
    productField = new ProdInstallmentsField("Продукт", "Введите название продукта");
    productField.setRequired(true);
    productField.addValueChangeListener(e -> refreshProductFields());
    form.addComponent(productField);

    stateField = new ProdInstanceStateSelect("Статус рассмотрения", "Укажите статус рассмотрения заявки на продукт");
    form.addComponent(stateField);

    form.addComponent(new FormGroupHeader("Характеристики продукта"));
    vendorLabel = new Label();
    vendorLabel.setCaption("Эммитент");
    form.addComponent(vendorLabel);

    downpaymentLabel = new Label();
    downpaymentLabel.setCaption("Первоначальный взнос");
    form.addComponent(downpaymentLabel);

    periodLabel = new Label();
    periodLabel.setCaption("Период рассрочки");
    form.addComponent(periodLabel);

    form.addComponent(new FormGroupHeader("Параметры рассрочки"));
    downpaymentField = new PercentOfField("Первоначальный взнос", "Введите сумму первоначального взноса по рассрочке");
    downpaymentField.setRequired(true);
    form.addComponent(downpaymentField);

    periodField = new ComboBox("Срок рассрочки");
    periodField.setDescription("Введите период рассрочки (длительность рассрочки)");
    periodField.setImmediate(true);
    periodField.setNullSelectionAllowed(false);
    periodField.setRequired(true);
    periodField.setWidth(6, Unit.EM);
    // Наполняем возможными сроками кредита
    fillPeriodFieldItems();
    form.addComponent(periodField);

    summField = new EditField("Сумма рассрочки", "Введите сумму рассрочки (Также может рассчитываться автоматически)");
    summField.setRequired(true);
    form.addComponent(summField);

    // Размер ежемесячного платежа
    monthlyPayLabel = new Label();
    monthlyPayLabel.setCaption("Ежемесячный платеж");
    form.addComponent(monthlyPayLabel);

    // Ответственный со стороны банка
    responsibleField = new EmployeeField("Ответственный сотрудник", "Укажите ответственного со стороны эммитента рассрочки");
    responsibleField.setCompanySupplier(() -> {
        final ProdInstallments product = productField.getValue();
        if (product != null) {
            return product.getVendor();
        } else
            return null;
    });
    form.addComponent(responsibleField);

    // Инициализация валидаторов
    initValidators();
    // Обновление рассчетных полей
    refreshProductFields();
    refreshInstCosts();
    // Инициализация взаимосвязей
    initRelations();

    return form;
}
 
Example 50
Project: extacrm   File: InsuranceInSaleEditForm.java   Source Code and License Vote up 4 votes
/**
 * <p>createEditFields.</p>
 *
 * @return a {@link com.vaadin.ui.ComponentContainer} object.
 */
@Override
protected ComponentContainer createEditFields() {
    final ExtaFormLayout form = new ExtaFormLayout();

    form.addComponent(new FormGroupHeader("Продукт"));
    productField = new ProdInsuranceField("Продукт", "Введите название продукта");
    productField.setRequired(true);
    productField.addValueChangeListener(e -> refreshProductFields());
    form.addComponent(productField);

    form.addComponent(new FormGroupHeader("Характеристики продукта"));
    vendorLabel = new Label();
    vendorLabel.setCaption("Страховщик");
    form.addComponent(vendorLabel);

    tariffLabel = new Label();
    tariffLabel.setCaption("Тариф");
    tariffLabel.setConverter(lookup(StringToPercentConverter.class));
    form.addComponent(tariffLabel);

    form.addComponent(new FormGroupHeader("Параметры страховки"));
    periodField = new ComboBox("Период страхования");
    periodField.setDescription("Введите период страхования");
    periodField.setImmediate(true);
    periodField.setNullSelectionAllowed(false);
    periodField.setRequired(true);
    periodField.setWidth(6, Unit.EM);
    // Наполняем возможными сроками страховки
    fillPeriodFieldItems();
    form.addComponent(periodField);

    // Ответственный за оформление страховки
    responsibleField = new EmployeeField("Ответственный", "Укажите ответственного за оформление страховки");
    responsibleField.setCompanySupplier(() -> {
        final ProdInsurance product = productField.getValue();
        if (product != null) {
            return product.getVendor();
        } else
            return null;
    });
    form.addComponent(responsibleField);

    form.addComponent(new FormGroupHeader("Стоимость страховки"));
    // Размер страховой премии
    premiumLabel = new Label();
    premiumLabel.setCaption("Страховая премия");
    form.addComponent(premiumLabel);

    // Обновление рассчетных полей
    refreshProductFields();
    refreshInsCosts();
    // Инициализация взаимосвязей
    initRelations();

    return form;
}
 
Example 51
Project: extacrm   File: HirePurchaseInSaleEditForm.java   Source Code and License Vote up 4 votes
/**
 * <p>createEditFields.</p>
 *
 * @return a {@link ComponentContainer} object.
 */
@Override
protected ComponentContainer createEditFields() {
    final ExtaFormLayout form = new ExtaFormLayout();

    form.addComponent(new FormGroupHeader("Продукт"));
    productField = new ProdHirePurchaseField("Продукт", "Введите название продукта");
    productField.setRequired(true);
    productField.addValueChangeListener(e -> refreshProductFields());
    form.addComponent(productField);

    stateField = new ProdInstanceStateSelect("Статус рассмотрения", "Укажите статус рассмотрения заявки на продукт");
    form.addComponent(stateField);

    form.addComponent(new FormGroupHeader("Сопутствующие расходы"));
    expendituresField = new ProductExpendituresField("Статьи расходов",
            "Список дополнительных расходов сопровождающих продукт", (ProductInstance) getEntity());
    form.addComponent(expendituresField);

    form.addComponent(new FormGroupHeader("Характеристики продукта"));
    vendorLabel = new Label();
    vendorLabel.setCaption("Эммитент");
    form.addComponent(vendorLabel);

    downpaymentLabel = new Label();
    downpaymentLabel.setCaption("Первоначальный взнос");
    form.addComponent(downpaymentLabel);

    periodLabel = new Label();
    periodLabel.setCaption("Период рассрочки");
    form.addComponent(periodLabel);

    form.addComponent(new FormGroupHeader("Параметры рассрочки"));
    downpaymentField = new PercentOfField("Первоначальный взнос", "Введите сумму первоначального взноса по рассрочке");
    downpaymentField.setRequired(true);
    form.addComponent(downpaymentField);

    periodField = new ComboBox("Срок рассрочки");
    periodField.setDescription("Введите период рассрочки (длительность рассрочки)");
    periodField.setImmediate(true);
    periodField.setNullSelectionAllowed(false);
    periodField.setRequired(true);
    periodField.setWidth(6, Unit.EM);
    // Наполняем возможными сроками кредита
    fillPeriodFieldItems();
    form.addComponent(periodField);

    summField = new EditField("Сумма рассрочки", "Введите сумму рассрочки (Также может рассчитываться автоматически)");
    summField.setRequired(true);
    form.addComponent(summField);

    // Ответственный со стороны банка
    responsibleField = new EmployeeField("Ответственный сотрудник", "Укажите ответственного со стороны эммитента рассрочки");
    responsibleField.setCompanySupplier(() -> {
        final ProdHirePurchase product = productField.getValue();
        if (product != null) {
            return product.getVendor();
        } else
            return null;
    });
    form.addComponent(responsibleField);

    // Инициализация валидаторов
    initValidators();
    // Обновление рассчетных полей
    refreshProductFields();
    refreshInstCosts();
    // Инициализация взаимосвязей
    initRelations();

    return form;
}
 
Example 52
Project: konekti   File: ProtocolToolbar.java   Source Code and License Vote up 4 votes
@AutoGenerated
private HorizontalLayout buildToolbarLayout() {		
	toolbarLayout = new HorizontalLayout();
	toolbarLayout.setImmediate(false);
	toolbarLayout.setSpacing(true);
	
	ButtonGroup editionButtonGroup = new ButtonGroup();
	toolbarLayout.addComponent(editionButtonGroup);
	
	// btnOpenProtocol
	btnOpenProtocol = new Button();
	btnOpenProtocol.setCaption("Iniciar Job");
	btnOpenProtocol.setImmediate(true);
	btnOpenProtocol.setWidth("-1px");
	btnOpenProtocol.setHeight("-1px");
	btnOpenProtocol.setIcon(new ThemeResource("../konekti/images/icons/job-toolbar/bell--arrow.png"));
	
	editionButtonGroup.addButton(btnOpenProtocol);
	
	// btnRecoverProtocol
	btnRecoverProtocol = new Button();
	btnRecoverProtocol.setCaption("Iniciar Job");
	btnRecoverProtocol.setImmediate(true);
	btnRecoverProtocol.setWidth("-1px");
	btnRecoverProtocol.setHeight("-1px");
	btnRecoverProtocol.setIcon(new ThemeResource("../konekti/images/icons/job-toolbar/bell--arrow.png"));
	
	editionButtonGroup.addButton(btnRecoverProtocol);
	
	lblBoxProtocol = new Label("Buzón Protocolo:");
	lblBoxProtocol.setVisible(false);
	lblBoxProtocol.setWidth("-1px");
	lblBoxProtocol.setHeight("-1px");
	
	toolbarLayout.addComponent(lblBoxProtocol);
	
	cmbBoxProtocol = new ComboBox();
	cmbBoxProtocol.setVisible(false);
	cmbBoxProtocol.setImmediate(true);
	cmbBoxProtocol.setWidth("-1px");
	cmbBoxProtocol.setHeight("-1px");
	cmbBoxProtocol.setNullSelectionAllowed(false);
	cmbBoxProtocol.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
	cmbBoxProtocol.setItemCaptionPropertyId("box");
	
	toolbarLayout.addComponent(cmbBoxProtocol);
	
	lblTypeProtocol = new Label("Tipo Protocolo:");
	lblTypeProtocol.setWidth("-1px");
	lblTypeProtocol.setHeight("-1px");
	
	toolbarLayout.addComponent(lblTypeProtocol);
	
	cmbTypeProtocol = new ComboBox();
	cmbTypeProtocol.setImmediate(true);
	cmbTypeProtocol.setWidth("-1px");
	cmbTypeProtocol.setHeight("-1px");
	cmbTypeProtocol.setNullSelectionAllowed(true);
	cmbTypeProtocol.setItemCaptionMode(Select.ITEM_CAPTION_MODE_PROPERTY);
	cmbTypeProtocol.setItemCaptionPropertyId("direction");
	
	toolbarLayout.addComponent(cmbTypeProtocol);
	
	return toolbarLayout;
}
 
Example 53
Project: konekti   File: AreaViewForm.java   Source Code and License Vote up 4 votes
@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;
}
 
Example 54
Project: VaadinUtils   File: BaseCrudView.java   Source Code and License Vote up 4 votes
private void buildActionLayout()
{
	actionLayout = new HorizontalLayout();
	actionLayout.setWidth("100%");
	actionLayout.setMargin(new MarginInfo(false, true, false, false));

	actionLabel = new Label("&nbsp;Action");
	actionLabel.setContentMode(ContentMode.HTML);
	actionLabel.setWidth("50");

	actionGroupLayout.addStyleName("v-component-group");
	actionLayout.addComponent(actionGroupLayout);
	actionGroupLayout.addComponent(actionLabel);

	actionCombo = new ComboBox(null);
	actionCombo.setWidth("160");
	actionCombo.setNullSelectionAllowed(false);
	actionCombo.setTextInputAllowed(false);
	actionGroupLayout.addComponent(actionCombo);

	addCrudActions();
	actionGroupLayout.addComponent(actionApplyButton);
	actionApplyButton.setId("applyButton");

	actionMessage = new Label("", ContentMode.HTML);
	actionGroupLayout.addComponent(actionMessage);

	String newButtonLabel = getNewButtonLabel();
	if (newButtonLabel == null)
	{
		newButtonLabel = "";
	}
	actionNewButton.setCaption(newButtonLabel);
	actionNewButton.setId("CrudNewButton-" + newButtonLabel.replace(" ", ""));
	actionLayout.addComponent(actionNewButton);

	actionLayout.setComponentAlignment(actionGroupLayout, Alignment.MIDDLE_LEFT);
	actionLayout.setComponentAlignment(actionNewButton, Alignment.MIDDLE_RIGHT);
	actionLayout.setExpandRatio(actionGroupLayout, 1.0f);
	actionLayout.setHeight("35");
}
 
Example 55
Project: academ   File: PanelSesion.java   Source Code and License Vote up 4 votes
@AutoGenerated
private AbsoluteLayout buildMainLayout() {
	// common part: create layout
	mainLayout = new AbsoluteLayout();
	mainLayout.setImmediate(false);
	mainLayout.setWidth("100%");
	mainLayout.setHeight("60px");
	
	// top-level component properties
	setWidth("100.0%");
	setHeight("60px");
	
	// botonCerrarSesion
	buttonCerrarSesion = new Button();
	buttonCerrarSesion.setCaption("Cerrar Sesión");
	buttonCerrarSesion.setImmediate(true);
	buttonCerrarSesion.setWidth("101px");
	buttonCerrarSesion.setHeight("-1px");
	mainLayout.addComponent(buttonCerrarSesion, "top:20.0px;right:19.0px;");
	
	// labelNombreUsuario
	labelNombreUsuario = new Label();
	labelNombreUsuario.setImmediate(false);
	labelNombreUsuario.setWidth("-1px");
	labelNombreUsuario.setHeight("-1px");
	labelNombreUsuario.setValue("Label");
	mainLayout
			.addComponent(labelNombreUsuario, "top:22.0px;right:533.0px;");
	
	// comboBoxPerfil
	comboBoxPerfil = new ComboBox();
	comboBoxPerfil.setImmediate(false);
	comboBoxPerfil.setWidth("158px");
	comboBoxPerfil.setHeight("-1px");
	mainLayout.addComponent(comboBoxPerfil, "top:20.0px;right:142.0px;");
	
	// buttonCambiarPerfil
	buttonCambiarPerfil = new Button();
	buttonCambiarPerfil.setCaption("Cambiar Perfil A:");
	buttonCambiarPerfil.setImmediate(false);
	buttonCambiarPerfil.setWidth("117px");
	buttonCambiarPerfil.setHeight("-1px");
	mainLayout.addComponent(buttonCambiarPerfil,
			"top:18.0px;right:317.0px;");
	
	return mainLayout;
}
 
Example 56
Project: konekti   File: UserRoleCollectionField.java   Source Code and License Vote up 4 votes
@AutoGenerated
private HorizontalLayout buildRoleLayout() {
	// common part: create layout
	roleLayout = new HorizontalLayout();
	roleLayout.setImmediate(false);
	roleLayout.setWidth("100.0%");
	roleLayout.setHeight("-1px");
	roleLayout.setMargin(false);
	
	// cmbRoles
	cmbRoles = new ComboBox();
	cmbRoles.setCaption("Roles:");
	cmbRoles.setImmediate(false);
	cmbRoles.setWidth("-1px");
	cmbRoles.setHeight("-1px");
	roleLayout.addComponent(cmbRoles);
	
	// btnAddRole
	btnAddRole = new Button();
	btnAddRole.setIcon(new ThemeResource(
			"../konekti/images/icons/edition-toolbar/plus.png"));
	btnAddRole.setImmediate(true);
	btnAddRole.setDescription("Añadir Rol");
	btnAddRole.setWidth("-1px");
	btnAddRole.setHeight("-1px");
	roleLayout.addComponent(btnAddRole);
	roleLayout.setComponentAlignment(btnAddRole, new Alignment(9));
	
	// btnEditRole
	btnEditRole = new Button();
	btnEditRole.setIcon(new ThemeResource(
			"../konekti/images/icons/edition-toolbar/pencil.png"));
	btnEditRole.setImmediate(true);
	btnEditRole.setDescription("Editar Rol");
	btnEditRole.setWidth("-1px");
	btnEditRole.setHeight("-1px");
	roleLayout.addComponent(btnEditRole);
	roleLayout.setComponentAlignment(btnEditRole, new Alignment(9));
	
	// btnRemoveRole
	btnRemoveRole = new Button();
	btnRemoveRole.setIcon(new ThemeResource(
			"../konekti/images/icons/edition-toolbar/minus.png"));
	btnRemoveRole.setImmediate(true);
	btnRemoveRole.setDescription("Borrar Rol");
	btnRemoveRole.setWidth("-1px");
	btnRemoveRole.setHeight("-1px");
	roleLayout.addComponent(btnRemoveRole);
	roleLayout.setComponentAlignment(btnRemoveRole, new Alignment(9));
	
	// btnApply
	btnApply = new Button();
	btnApply.setCaption("Aplicar");
	btnApply.setImmediate(true);
	btnApply.setDescription("Guardar cambios");
	btnApply.setWidth("-1px");
	btnApply.setHeight("-1px");
	roleLayout.addComponent(btnApply);
	roleLayout.setComponentAlignment(btnApply, new Alignment(9));
	
	// btnCopyRole
	btnCopyRole = new Button();
	btnCopyRole.setCaption("Copiar");
	btnCopyRole.setImmediate(true);
	btnCopyRole.setDescription("Copiar acción");
	btnCopyRole.setWidth("-1px");
	btnCopyRole.setHeight("-1px");
	roleLayout.addComponent(btnCopyRole);
	roleLayout.setExpandRatio(btnCopyRole, 1.0f);
	roleLayout.setComponentAlignment(btnCopyRole, new Alignment(9));
	
	// cmbArea
	cmbArea = new ComboBox();
	cmbArea.setCaption("Area:");
	cmbArea.setImmediate(false);
	cmbArea.setWidth("-1px");
	cmbArea.setHeight("-1px");
	roleLayout.addComponent(cmbArea);
	
	return roleLayout;
}
 
Example 57
Project: konekti   File: AlarmViewForm.java   Source Code and License Vote up 4 votes
@AutoGenerated
private AbsoluteLayout buildMainLayout() {
	// common part: create layout
	mainLayout = new AbsoluteLayout();
	mainLayout.setImmediate(false);
	mainLayout.setWidth("520px");
	mainLayout.setHeight("280px");
	mainLayout.setMargin(true);
	
	// top-level component properties
	setWidth("520px");
	setHeight("280px");
	
	// alarmDateField
	alarmDateField = new DateField();
	alarmDateField.setCaption("Fecha alarma");
	alarmDateField.setImmediate(false);
	alarmDateField.setWidth("120px");
	alarmDateField.setHeight("-1px");
	alarmDateField.setInvalidAllowed(false);
	alarmDateField.setResolution(DateField.RESOLUTION_SEC);
	mainLayout.addComponent(alarmDateField, "top:17.0px;left:380.0px;");
	
	// areaField
	areaField = new TextField();
	areaField.setCaption("Area trabajo");
	areaField.setImmediate(false);
	areaField.setWidth("160px");
	areaField.setHeight("-1px");
	mainLayout.addComponent(areaField, "top:17.0px;left:200.0px;");
	
	// messageField
	messageField = new TextField();
	messageField.setCaption("Message");
	messageField.setImmediate(false);
	messageField.setWidth("480px");
	messageField.setHeight("164px");
	mainLayout.addComponent(messageField, "top:100.0px;left:20.0px;");
	
	// organizationField
	organizationField = new TextField();
	organizationField.setCaption("Organización");
	organizationField.setImmediate(false);
	organizationField.setWidth("160px");
	organizationField.setHeight("-1px");
	mainLayout.addComponent(organizationField, "top:17.0px;left:20.0px;");
	
	// alarmTypeField
	alarmTypeField = new ComboBox();
	alarmTypeField.setCaption("Tipo alarma");
	alarmTypeField.setImmediate(false);
	alarmTypeField.setWidth("180px");
	alarmTypeField.setHeight("-1px");
	mainLayout.addComponent(alarmTypeField, "top:60.0px;left:20.0px;");
	
	// alarmStatusField
	alarmStatusField = new ComboBox();
	alarmStatusField.setCaption("Estado alarma");
	alarmStatusField.setImmediate(false);
	alarmStatusField.setWidth("180px");
	alarmStatusField.setHeight("-1px");
	mainLayout.addComponent(alarmStatusField, "top:60.0px;left:220.0px;");
	
	return mainLayout;
}
 
Example 58
Project: konekti   File: FeedbackViewForm.java   Source Code and License Vote up 4 votes
@AutoGenerated
private AbsoluteLayout buildMainLayout() {
	// common part: create layout
	mainLayout = new AbsoluteLayout();
	mainLayout.setImmediate(false);
	mainLayout.setWidth("520px");
	mainLayout.setHeight("360px");
	mainLayout.setMargin(true);
	
	// top-level component properties
	setWidth("520px");
	setHeight("360px");
	
	// commentField
	commentField = new TextField();
	commentField.setCaption("Comentario");
	commentField.setImmediate(false);
	commentField.setWidth("480px");
	commentField.setHeight("240px");
	mainLayout.addComponent(commentField, "top:100.0px;left:20.0px;");
	
	// feedbackDateField
	feedbackDateField = new DateField();
	feedbackDateField.setCaption("Fecha sugerencia");
	feedbackDateField.setImmediate(false);
	feedbackDateField.setWidth("160px");
	feedbackDateField.setHeight("-1px");
	feedbackDateField.setInvalidAllowed(false);
	mainLayout.addComponent(feedbackDateField, "top:20.0px;left:340.0px;");
	
	// invoiceField
	invoiceField = new TextField();
	invoiceField.setCaption("Número Factura");
	invoiceField.setImmediate(false);
	invoiceField.setWidth("140px");
	invoiceField.setHeight("-1px");
	mainLayout.addComponent(invoiceField, "top:17.0px;left:20.0px;");
	
	// feedbackStatusField
	feedbackStatusField = new ComboBox();
	feedbackStatusField.setCaption("Estado");
	feedbackStatusField.setImmediate(false);
	feedbackStatusField.setWidth("280px");
	feedbackStatusField.setHeight("-1px");
	mainLayout.addComponent(feedbackStatusField, "top:60.0px;left:20.0px;");
	
	// feedbackTypeField
	feedbackTypeField = new ComboBox();
	feedbackTypeField.setCaption("Tipo");
	feedbackTypeField.setImmediate(false);
	feedbackTypeField.setWidth("180px");
	feedbackTypeField.setHeight("-1px");
	mainLayout.addComponent(feedbackTypeField, "top:60.0px;left:320.0px;");
	
	return mainLayout;
}
 
Example 59
Project: konekti   File: PermissionViewForm.java   Source Code and License Vote up 4 votes
@AutoGenerated
private AbsoluteLayout buildMainLayout() {
	// common part: create layout
	mainLayout = new AbsoluteLayout();
	mainLayout.setImmediate(false);
	mainLayout.setWidth("580px");
	mainLayout.setHeight("280px");
	mainLayout.setMargin(true);
	
	// top-level component properties
	setWidth("580px");
	setHeight("280px");
	
	// activeField
	activeField = new CheckBox();
	activeField.setCaption("Activo");
	activeField.setImmediate(false);
	activeField.setWidth("-1px");
	activeField.setHeight("-1px");
	activeField.setRequired(true);
	mainLayout.addComponent(activeField, "top:14.0px;left:507.0px;");
	
	// commentField
	commentField = new TextField();
	commentField.setCaption("Comentario");
	commentField.setImmediate(true);
	commentField.setWidth("540px");
	commentField.setHeight("160px");
	mainLayout.addComponent(commentField, "top:100.0px;left:20.0px;");
	
	// codeField
	codeField = new TextField();
	codeField.setCaption("Código");
	codeField.setImmediate(false);
	codeField.setWidth("160px");
	codeField.setHeight("-1px");
	codeField.setRequired(true);
	mainLayout.addComponent(codeField, "top:17.0px;left:20.0px;");
	
	// descriptionField
	descriptionField = new TextField();
	descriptionField.setCaption("Descripción");
	descriptionField.setImmediate(false);
	descriptionField.setWidth("541px");
	descriptionField.setHeight("-1px");
	descriptionField.setRequired(true);
	mainLayout.addComponent(descriptionField, "top:56.0px;left:20.0px;");
	
	// menuCommandResourceField
	menuCommandResourceField = new ComboBox();
	menuCommandResourceField.setCaption("Módulo:");
	menuCommandResourceField.setImmediate(true);
	menuCommandResourceField.setWidth("280px");
	menuCommandResourceField.setHeight("-1px");
	menuCommandResourceField.setRequired(true);
	mainLayout.addComponent(menuCommandResourceField,
			"top:17.0px;left:200.0px;");
	
	return mainLayout;
}
 
Example 60
Project: konekti   File: PaginationToolbar.java   Source Code and License Vote up 4 votes
@AutoGenerated
private HorizontalLayout buildMainLayout() {
	// common part: create layout
	mainLayout = new HorizontalLayout();
	mainLayout.setImmediate(false);
	mainLayout.setSpacing(true);
	
	// pageSizeLabel
	pageSizeLabel = new Label();
	pageSizeLabel.setValue("Núm. registros por página");
	mainLayout.addComponent(pageSizeLabel);
	mainLayout.setComponentAlignment(pageSizeLabel, Alignment.MIDDLE_RIGHT);
	
	// pagesizeCombox
	pageSizeCombox = new ComboBox();
	pageSizeCombox.setImmediate(false);
	pageSizeCombox.setWidth("-1px");
	pageSizeCombox.setHeight("-1px");
	mainLayout.addComponent(pageSizeCombox);
	
	// firstPageButton
	firstPageButton = new Button();
	firstPageButton.setIcon(new ThemeResource("../konekti/images/icons/navigation-toolbar/arrow-stop-180.png"));
	firstPageButton.setImmediate(false);
	firstPageButton.setWidth("-1px");
	firstPageButton.setHeight("-1px");
	previousButtonGroup.addButton(firstPageButton);
	
	// previousPageButton
	previousPageButton = new Button();
	previousPageButton.setIcon(new ThemeResource("../konekti/images/icons/navigation-toolbar/arrow-180.png"));
	previousPageButton.setImmediate(true);
	previousPageButton.setWidth("-1px");
	previousPageButton.setHeight("-1px");
	previousButtonGroup.addButton(previousPageButton);
	
	mainLayout.addComponent(previousButtonGroup);
	
	// pageInputTextField
	pageInputTextField = new TextField();
	pageInputTextField.setImmediate(false);
	pageInputTextField.setWidth("85px");
	pageInputTextField.setHeight("-1px");
	pageInputTextField.setInputPrompt("página actual");
	mainLayout.addComponent(pageInputTextField);
	
	// totalPageLabel
	totalPageLabel = new Label();
	totalPageLabel.setImmediate(false);
	totalPageLabel.setWidth("-1px");
	totalPageLabel.setHeight("-1px");
	totalPageLabel.setValue("de  ");
	mainLayout.addComponent(totalPageLabel);
	mainLayout.setComponentAlignment(totalPageLabel, Alignment.MIDDLE_LEFT);
	
	// nextPageButton
	nextPageButton = new Button();
	nextPageButton.setIcon(new ThemeResource("../konekti/images/icons/navigation-toolbar/arrow.png"));
	nextPageButton.setImmediate(true);
	nextPageButton.setWidth("-1px");
	nextPageButton.setHeight("-1px");
	lastButtonGroup.addButton(nextPageButton);
	
	// lastPageButton
	lastPageButton = new Button();
	lastPageButton.setIcon(new ThemeResource("../konekti/images/icons/navigation-toolbar/arrow-stop.png"));
	lastPageButton.setImmediate(false);
	lastPageButton.setWidth("-1px");
	lastPageButton.setHeight("-1px");
	lastButtonGroup.addButton(lastPageButton);
	
	mainLayout.addComponent(lastButtonGroup);
	
	mainLayout.setExpandRatio(lastButtonGroup, 1.0f);
	
	return mainLayout;
}