public Label createLabel(ReportInputParameter parameter, Field field) { Label label = componentsFactory.createComponent(Label.class); label.setAlignment(field instanceof TokenList ? Alignment.TOP_LEFT : Alignment.MIDDLE_LEFT); label.setWidth(Component.AUTO_SIZE); label.setValue(parameter.getLocName()); return label; }
protected void showStubText() { if (reportBox.getOwnComponents().isEmpty()) { Label label = componentsFactory.createComponent(Label.class); label.setValue(getMessage("showPivotTable.caption")); label.setAlignment(Alignment.MIDDLE_CENTER); label.setStyleName("h1"); reportBox.add(label); } } }
protected void showDiagramStubText() { if (chartBox.getOwnComponents().isEmpty()) { Label label = componentsFactory.createComponent(Label.class); label.setValue(getMessage("showChart.caption")); label.setAlignment(Alignment.MIDDLE_CENTER); label.setStyleName("h1"); chartBox.add(label); } }
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 displayInstances(SearchResult searchResult, String entityName, CssLayout instancesLayout) { Set<SearchResultEntry> entries = searchResult.getEntries(entityName); for (SearchResultEntry entry : entries) { Button instanceBtn = createInstanceButton(entityName, entry); instanceBtn.setAlignment(Alignment.MIDDLE_LEFT); instanceBtn.addStyleName("c-fts-entity"); instancesLayout.add(instanceBtn); HitInfo hi = searchResult.getHitInfo(entry.getId(), entityName); if (hi != null) { List<String> list = new ArrayList<>(hi.getHits().size()); for (Map.Entry<String, String> hitEntry : hi.getHits().entrySet()) { String hitProperty = hitEntry.getKey(); list.add(ftsService.getHitPropertyCaption(entityName, hitProperty) + ": " + hitEntry.getValue()); } Collections.sort(list); for (String caption : list) { Label hitLabel = createHitLabel(caption); hitLabel.addStyleName("c-fts-hit"); hitLabel.addStyleName("fts-hit"); hitLabel.setAlignment(Alignment.MIDDLE_LEFT); instancesLayout.add(hitLabel); } } } }
protected void addAppliedFilter() { if (lastAppliedFilter == null) return; if (!appliedFilters.isEmpty() && appliedFilters.getLast().filter.equals(lastAppliedFilter)) return; this.layout.add(appliedFiltersLayout, CONDITIONS_LOCATION_TOP.equals(conditionsLocation) ? 0 : 1); BoxLayout layout = uiComponents.create(HBoxLayout.class); layout.setSpacing(true); if (!appliedFilters.isEmpty()) { AppliedFilterHolder holder = appliedFilters.getLast(); holder.layout.remove(holder.button); } Label<String> label = uiComponents.create(Label.NAME); label.setValue(lastAppliedFilter.getText()); layout.add(label); label.setAlignment(Alignment.MIDDLE_LEFT); LinkButton button = uiComponents.create(LinkButton.class); button.setIcon("icons/item-remove.png"); button.addClickListener(e -> removeAppliedFilter()); layout.add(button); addAppliedFilterLayoutHook(layout); appliedFiltersLayout.add(layout); appliedFilters.add(new AppliedFilterHolder(lastAppliedFilter, layout, button)); }
protected void showChartsNotIncluded() { reportLookup.setEditable(false); chartBox.removeAll(); Label label = componentsFactory.createComponent(Label.class); label.setValue(getMessage("showChart.noChartComponent")); label.setAlignment(Alignment.MIDDLE_CENTER); label.setStyleName("h1"); chartBox.add(label); }
@Subscribe protected void onInit(InitEvent event) { Window window = getWindow(); Label<String> msgLabel = uiComponents.create(Label.TYPE_STRING); msgLabel.setAlignment(Component.Alignment.TOP_CENTER); msgLabel.addStyleName(HaloTheme.LABEL_H1); msgLabel.setValue(messages.formatMessage(NotFoundScreen.class, "notAssociatedRoute", requestedRoute)); window.add(msgLabel); window.setCaption(messages.formatMessage(NotFoundScreen.class, "tabCaption", requestedRoute)); } }
protected void createLayout() { reloadProcInstance(); if (procTask != null) { reloadProcTask(); } String actExecutionId = procTask == null ? null : procTask.getActExecutionId(); FormFieldGeneratorsFactory fieldGeneratorsFactory = new FormFieldGeneratorsFactory(); List<ProcFormParam> formParams = formDefinition.getParams(); GridLayout grid = componentsFactory.createComponent(GridLayout.class); grid.setRows(formParams.size()); grid.setColumns(2); grid.setSpacing(true); int i = 0; for (ProcFormParam formParam : formParams) { Label label = componentsFactory.createComponent(Label.class); label.setValue(formParam.getLocCaption()); label.setAlignment(Alignment.MIDDLE_LEFT); grid.add(label, 0, i); String paramTypeName = !Strings.isNullOrEmpty(formParam.getTypeName()) ? formParam.getTypeName() : "string"; FormFieldGenerator generator = fieldGeneratorsFactory.createFormFieldGenerator(paramTypeName); Field field = generator.createField(formParam, actExecutionId); field.setWidth(FIELD_WIDTH); grid.add(field, 1, i); componentsMap.put(formParam, field); i++; } add(grid, 0); }
nameLab.setAlignment(Alignment.MIDDLE_LEFT); grid.add(nameLab, 0, i); dash.setAlignment(Alignment.MIDDLE_LEFT); grid.add(dash, 1, i); dash.setAlignment(Alignment.MIDDLE_LEFT); grid.add(dash, 3, i);
Label<String> label = componentsFactory.createComponent(Label.class); label.setValue(field.getLocalizedName()); label.setAlignment(Alignment.TOP_LEFT); label.setStyleName("field-label"); if (AppConfig.getClientType() == ClientType.DESKTOP) {
public ParamEditor(AbstractCondition condition, boolean removeButtonVisible, boolean operationEditable) { this.condition = condition; this.removeButtonVisible = removeButtonVisible; uiComponents = AppBeans.get(UiComponents.class); labelAndOperationLayout = uiComponents.create(HBoxLayout.class); labelAndOperationLayout.setSpacing(true); labelAndOperationLayout.setAlignment(Alignment.MIDDLE_RIGHT); captionLbl = uiComponents.create(Label.NAME); captionLbl.setAlignment(Alignment.MIDDLE_RIGHT); captionLbl.setValue(condition.getLocCaption()); labelAndOperationLayout.add(captionLbl); operationEditor = condition.createOperationEditor().getComponent(); operationEditor.setEnabled(operationEditable); labelAndOperationLayout.add(operationEditor); createParamEditLayout(); condition.addListener(this); }
Label<String> label1 = factory.createComponent(Label.class); label1.setValue(messages.getMessage(getClass(), "show")); label1.setAlignment(Alignment.MIDDLE_LEFT); Label<String> label2 = factory.createComponent(Label.class); label2.setValue(messages.getMessage(getClass(), "rows")); label2.setAlignment(Alignment.MIDDLE_LEFT); ButtonsPanel panel = entityLogTable.getButtonsPanel(); showRowField = factory.createComponent(TextField.class);
protected void createMaxResultsLayout() { maxResultsLayout = uiComponents.create(HBoxLayout.class); maxResultsLayout.setStyleName("c-maxresults"); maxResultsLayout.setSpacing(true); Label<String> maxResultsLabel = uiComponents.create(Label.NAME); maxResultsLabel.setStyleName("c-maxresults-label"); maxResultsLabel.setValue(messages.getMainMessage("filter.maxResults.label1")); maxResultsLabel.setAlignment(Alignment.MIDDLE_RIGHT); maxResultsLayout.add(maxResultsLabel); maxResultsTextField = uiComponents.create(TextField.TYPE_INTEGER); maxResultsTextField.setStyleName("c-maxresults-input"); maxResultsTextField.setMaxLength(4); maxResultsTextField.setWidth(theme.get("cuba.gui.Filter.maxResults.width")); maxResultsLookupField = maxResultsFieldHelper.createMaxResultsLookupField(); maxResultsLookupField.setStyleName("c-maxresults-select"); maxResultsField = textMaxResults ? maxResultsTextField : maxResultsLookupField; maxResultsField.addValueChangeListener(integerValueChangeEvent -> maxResultValueChanged = true); maxResultsLayout.add(maxResultsField); }
modifyLabel.setAlignment(Alignment.MIDDLE_CENTER); modifyLabel.setStyleName("centered"); readOnlyLabel.setAlignment(Alignment.MIDDLE_CENTER); readOnlyLabel.setStyleName("centered"); hideLabel.setAlignment(Alignment.MIDDLE_CENTER); hideLabel.setStyleName("centered");