@Override public void init(Map<String, Object> params) { Map<String, Locale> map = globalConfig.getAvailableLocales(); for (Map.Entry<String, Locale> entry : map.entrySet()) { localesScrollBox.add(createLocaleListComponent(entry.getValue(), entry.getKey())); } }
@Override public void init(Map<String, Object> params) { screenFrame = openWindow(screenId, WindowManager.OpenType.DIALOG, widgetRepository.getWidgetParams(widget)); screenFrame.close(Window.CLOSE_ACTION_ID, true); screenFrame.setSizeFull(); scroll.add(screenFrame.getFrame()); } }
protected void addValueToLayout(final Object value, String str) { BoxLayout itemLayout = uiComponents.create(HBoxLayout.class); itemLayout.setId("itemLayout"); itemLayout.setSpacing(true); Label<String> itemLab = uiComponents.create(Label.NAME); if (options instanceof MapOptions) { //noinspection unchecked Map<String, Object> optionsMap = ((MapOptions) options).getItemsCollection(); str = optionsMap.entrySet() .stream() .filter(entry -> Objects.equals(entry.getValue(), value)) .findFirst() .get().getKey(); } itemLab.setValue(str); itemLayout.add(itemLab); itemLab.setAlignment(Alignment.MIDDLE_LEFT); LinkButton delItemBtn = uiComponents.create(LinkButton.class); delItemBtn.setIcon("icons/item-remove.png"); delItemBtn.addClickListener(e -> { valuesMap.remove(value); valuesLayout.remove(itemLayout); }); itemLayout.add(delItemBtn); if (BooleanUtils.isFalse(editable)) { delItemBtn.setEnabled(false); } valuesLayout.add(itemLayout); valuesMap.put(value, str); }
protected void initNoSearchTerm() { setCaption(getMessage("caption")); Label<String> label = componentsFactory.createComponent(Label.class); label.setValue(getMessage("noSearchTerm")); label.setStyleName("h2"); contentBox.add(label); }
protected void addAttribute(Set<LoggedAttribute> enabledAttributes, String name, boolean editable) { CheckBox checkBox = factory.createComponent(CheckBox.class); if (enabledAttributes != null && isEntityHaveAttribute(name, enabledAttributes)) { checkBox.setValue(true); } checkBox.setId(name); checkBox.setCaption(name); checkBox.setEditable(editable); checkBox.addValueChangeListener(e -> checkAllCheckboxes()); attributesBoxScroll.add(checkBox); }
@Override public void init(Map<String, Object> params) { super.init(params); if (exception != null) { Label<String> traceLabel = uiComponents.create(Label.NAME); traceLabel.setValue(getExceptionMessage(exception)); com.vaadin.ui.Label vaadinLbl = traceLabel.unwrap(com.vaadin.ui.Label.class); vaadinLbl.setContentMode(ContentMode.PREFORMATTED); resultLabel.setValue(getMessage("operationResult.exception")); resultContainer.add(traceLabel); } else if (result != null) { Label<String> valueHolder = uiComponents.create(Label.NAME); valueHolder.setValue(AttributeHelper.convertToString(result)); com.vaadin.ui.Label vaadinLbl = valueHolder.unwrap(com.vaadin.ui.Label.class); vaadinLbl.setContentMode(ContentMode.PREFORMATTED); resultLabel.setValue(getMessage("operationResult.result")); resultContainer.add(valueHolder); } else { resultLabel.setValue(getMessage("operationResult.void")); } }
@Override public void init(Map<String, Object> params) { lookupFrame = openWindow(lookupWindowId, WindowManager.OpenType.DIALOG, widgetRepository.getWidgetParams(widget)); for (ListComponent c : findListComponents(lookupFrame)) { c.getDatasource().addItemChangeListener(e -> events.publish(new ItemsSelectedEvent(widget, c.getSelected()))); } lookupFrame.close(Window.CLOSE_ACTION_ID, true); lookupFrame.setSizeFull(); scroll.add(lookupFrame.getFrame()); }
protected void compileEditPane(MultiplePermissionTarget item) { GridLayout editGrid = uiComponents.create(GridLayout.class); editGrid.setFrame(frame); editGrid.setId("editGrid"); editGrid.setWidth("100%"); editGrid.setColumns(4); editGrid.setMargin(true); editGrid.setColumnExpandRatio(0, 1f); editGrid.setColumnExpandRatio(1, 0); editGrid.setColumnExpandRatio(2, 0); editGrid.setColumnExpandRatio(3, 0); editGrid.setRows(item.getPermissions().size() + 2); compileDefaultControls(editGrid); initPermissionControls(item, editGrid); editGridContainer.add(editGrid); applyPermissions(hasPermissionsToModifyPermission); }