Here are the examples of the java api com.vaadin.ui.ComboBox.setItemCaptionPropertyId() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
5 Examples
19
Source : GxSelectAssigneeForm.java
with Apache License 2.0
from ijazfx
with Apache License 2.0
from ijazfx
@Override
protected void addFieldsToForm(FormLayout form) {
replacedignee = new ComboBox("replacedign to");
replacedigneeDataSource = new BeanItemContainer<>(Gxreplacedignee.clreplaced);
replacedignee.setContainerDataSource(replacedigneeDataSource);
replacedignee.sereplacedemCaptionPropertyId("fullName");
replacedignee.addValueChangeListener(event -> {
if (!isBinding())
getEnreplacedy().setreplacedignee((Gxreplacedignee) event.getProperty().getValue());
});
replacedignee.setRequired(true);
form.addComponent(replacedignee);
}
18
Source : TRAbstractEntityComboBox.java
with Apache License 2.0
from ijazfx
with Apache License 2.0
from ijazfx
public TRAbstractEnreplacedyComboBox<T> build() {
if (!isBuilt) {
addButton = new MButton(FontAwesome.PLUS, event -> {
try {
onAddButtonClick(initializeEnreplacedy(enreplacedyClreplaced.newInstance()));
} catch (Exception e) {
L.warn(e.getMessage(), e);
}
}).withStyleName(ValoTheme.BUTTON_ICON_ONLY);
editButton = new MButton(FontAwesome.PENCIL, event -> {
try {
T item = (T) comboBox.getValue();
if (item != null) {
preEdit(item);
openEditorForm(item);
}
} catch (Exception e) {
L.warn(e.getMessage(), e);
}
}).withStyleName(ValoTheme.BUTTON_ICON_ONLY);
editButton.setEnabled(false);
deleteButton = new MButton(FontAwesome.TRASH, event -> {
if (shouldShowDeleteConfirmation()) {
ConfirmDialog.show(UI.getCurrent(), "Are you sure to remove selected record?", e -> {
if (e.isConfirmed()) {
try {
T item = (T) comboBox.getValue();
if (item != null) {
if (onDeleteEnreplacedy(item)) {
beanItemContainer.removeItem(item);
if (delegate != null) {
delegate.onDelete(item);
}
}
}
} catch (Exception ex) {
L.warn(e.getMessage(), ex);
}
}
});
} else {
T item = (T) comboBox.getValue();
if (item != null) {
if (onDeleteEnreplacedy(item)) {
beanItemContainer.removeItem(item);
if (delegate != null) {
delegate.onDelete(item);
}
}
}
}
}).withStyleName(ValoTheme.BUTTON_ICON_ONLY);
deleteButton.setEnabled(false);
comboBox = new ComboBox();
beanItemContainer = new BeanItemContainer<>(enreplacedyClreplaced);
comboBox.setContainerDataSource(beanItemContainer);
comboBox.sereplacedemCaptionPropertyId(comboBoxVisibleProperty());
comboBox.setInputPrompt(comboBoxInputPrompt());
comboBox.addValueChangeListener(enreplacedy -> {
if (delegate != null) {
delegate.onItemSelect((T) comboBox.getValue());
}
if (comboBox.getValue() != null) {
editButton.setEnabled(true);
deleteButton.setEnabled(true);
}
});
layout = new CssLayout(addButton, comboBox, editButton, deleteButton);
layout.setStyleName(ValoTheme.LAYOUT_COMPONENT_GROUP);
addComponent(layout);
postBuild();
isBuilt = true;
refresh();
}
return this;
}
15
Source : BindSecurityGroupWindow.java
with Apache License 2.0
from opensecuritycontroller
with Apache License 2.0
from opensecuritycontroller
private ComboBox getPolicyComboBox(List<PolicyDto> policyDtoList) {
ComboBox policy = new ComboBox("Select Policy");
policy.setTextInputAllowed(false);
policy.setNullSelectionAllowed(false);
policy.setImmediate(true);
policy.setRequired(true);
policy.setRequiredError("Policy cannot be empty");
BeanItemContainer<PolicyDto> policyListContainer = new BeanItemContainer<>(PolicyDto.clreplaced, policyDtoList);
policy.setContainerDataSource(policyListContainer);
policy.sereplacedemCaptionPropertyId("policyName");
if (policyListContainer.size() > 0) {
policy.select(policyListContainer.getIdByIndex(0));
}
policy.setEnabled(false);
return policy;
}
13
Source : BaseDeploymentSpecWindow.java
with Apache License 2.0
from opensecuritycontroller
with Apache License 2.0
from opensecuritycontroller
private void populateNetworks(ComboBox networkComboBox, List<OsNetworkDto> networkList) {
try {
networkComboBox.removeAllItems();
if (networkList != null) {
// Calling List Network Service
BeanItemContainer<OsNetworkDto> networkListContainer = new BeanItemContainer<>(OsNetworkDto.clreplaced, networkList);
networkComboBox.setContainerDataSource(networkListContainer);
networkComboBox.sereplacedemCaptionPropertyId("name");
if (networkList.size() > 0) {
networkComboBox.select(networkListContainer.getIdByIndex(0));
}
}
} catch (Exception e) {
ViewUtil.iscNotification(e.getMessage(), Notification.Type.ERROR_MESSAGE);
log.error("Error getting Network List", e);
}
}
10
Source : BaseDAWindow.java
with Apache License 2.0
from opensecuritycontroller
with Apache License 2.0
from opensecuritycontroller
private ComboBox createDomainComboBox(List<DomainDto> dl) {
ComboBox domainComboBox = new ComboBox();
BeanItemContainer<DomainDto> domainContainer = new BeanItemContainer<DomainDto>(DomainDto.clreplaced, dl);
ApplianceManagerConnectorDto mc = (ApplianceManagerConnectorDto) this.managerConnector.getValue();
domainComboBox.setContainerDataSource(domainContainer);
domainComboBox.setTextInputAllowed(false);
domainComboBox.setNullSelectionAllowed(false);
domainComboBox.sereplacedemCaptionPropertyId("name");
domainComboBox.setEnabled(mc.isPolicyMappingSupported());
if (domainComboBox.gereplacedemIds().size() > 0) {
domainComboBox.select(domainContainer.getIdByIndex(0));
}
return domainComboBox;
}