use of com.vaadin.flow.component.checkbox.Checkbox in project furms by unity-idm.
the class InvitationsView method createInvitationGrid.
private Grid<InvitationGridModel> createInvitationGrid(Map<InvitationId, Checkbox> checkboxes, Component mainContextMenu) {
final Grid<InvitationGridModel> grid;
grid = new DenseGrid<>(InvitationGridModel.class);
grid.addComponentColumn(invitationGridModel -> {
Checkbox checkbox = new Checkbox();
checkboxes.put(invitationGridModel.id, checkbox);
return new HorizontalLayout(checkbox, new Label(invitationGridModel.resourceName));
}).setHeader(new HorizontalLayout(mainContextMenu, new Label(getTranslation("view.user-settings.invitations.grid.1"))));
grid.addColumn(x -> x.role).setHeader(getTranslation("view.user-settings.invitations.grid.2")).setSortable(true);
grid.addColumn(x -> x.originator).setHeader(getTranslation("view.user-settings.invitations.grid.3")).setSortable(true);
grid.addColumn(x -> x.expiration.format(dateTimeFormatter)).setHeader(getTranslation("view.user-settings.invitations.grid.4")).setSortable(true);
grid.addComponentColumn(x -> createContextMenu(x.id)).setHeader(getTranslation("view.user-settings.invitations.grid.5")).setTextAlign(ColumnTextAlign.END);
return grid;
}
use of com.vaadin.flow.component.checkbox.Checkbox in project furms by unity-idm.
the class SettingsView method sshKeyFromMandatory.
private Checkbox sshKeyFromMandatory(Binder<SiteSettingsDto> binder) {
Checkbox sshKeyFromMandatoryCheckbox = new Checkbox(getTranslation("view.site-admin.settings.form.sshKeyFromOptionMandatory"));
binder.forField(sshKeyFromMandatoryCheckbox).bind(SiteSettingsDto::isSshKeyFromOptionMandatory, SiteSettingsDto::setSshKeyFromOptionMandatory);
return sshKeyFromMandatoryCheckbox;
}
use of com.vaadin.flow.component.checkbox.Checkbox in project furms by unity-idm.
the class SettingsView method prohibitOldSSHKey.
private Checkbox prohibitOldSSHKey(Binder<SiteSettingsDto> binder) {
Checkbox prohibitOldSSHkeys = new Checkbox(getTranslation("view.site-admin.settings.form.prohibitOldSSHkeys"));
binder.forField(prohibitOldSSHkeys).bind(SiteSettingsDto::isProhibitOldsshKeys, SiteSettingsDto::setProhibitOldsshKeys);
return prohibitOldSSHkeys;
}
use of com.vaadin.flow.component.checkbox.Checkbox in project linkki by linkki-framework.
the class OverflowIssues method vaadinBugCheckbox.
// Vaadin Bug https://github.com/vaadin/flow-components/issues/2873
private void vaadinBugCheckbox() {
add(new Label("Checkbox Outline should be rectangular:"));
HorizontalLayout wrapper = new HorizontalLayout();
Checkbox cb = new Checkbox();
cb.setLabel("I am a checkbox");
cb.getStyle().set("outline", "auto");
wrapper.add(cb);
add(wrapper);
}
use of com.vaadin.flow.component.checkbox.Checkbox in project linkki by linkki-framework.
the class UICheckBoxIntegrationTest method testSetReadOnly.
@Test
void testSetReadOnly() {
Checkbox checkBox = getComponentById("dynamicReadonlyCheckBox");
assertThat(checkBox, is(instanceOf(LinkkiCheckBox.class)));
assertThat(checkBox.isReadOnly(), is(false));
assertThat(checkBox.isEnabled(), is(true));
assertThat(checkBox.getElement().hasAttribute("readonly"), is(false));
getDefaultPmo().setDynamicReadonlyCheckBoxReadOnly(true);
modelChanged();
assertThat(checkBox.isReadOnly(), is(true));
assertThat(checkBox.isEnabled(), is(false));
assertThat(checkBox.getElement().hasAttribute("readonly"), is(true));
}
Aggregations