/** * @return screen caption which is set in XML or via {@link #setCaption(String)} */ @Override public String getCaption() { return frame.getCaption(); }
protected void updateWindowCaption() { Window window = getWindow(); String filterTitle; if (filterMode == FilterMode.GENERIC_MODE && filterEntity != null && filterEntity != adHocFilter) { filterTitle = getFilterCaption(filterEntity); } else { filterTitle = null; } window.setDescription(filterTitle); if (initialWindowCaption == null) { initialWindowCaption = window.getCaption(); } windowManager.setWindowCaption(window, initialWindowCaption, filterTitle); String newCaption = Strings.isNullOrEmpty(filterTitle) ? caption : caption + ": " + filterTitle; captionChangedListener.accept(newCaption); }
button.setCaption(StringUtils.trimToEmpty(window.getCaption())); button.addClickListener(this::navigationButtonClicked); button.setSizeUndefined(); linksLayout.addComponent(separatorLab); } else { Label captionLabel = new Label(window.getCaption()); captionLabel.setStyleName("c-breadcrumbs-win-caption"); captionLabel.setSizeUndefined();
public void saveScreenHistory(Screen frameOwner) { WindowContext windowContext = frameOwner.getWindow().getContext(); if (security.isEntityOpPermitted(ScreenHistoryEntity.class, EntityOp.CREATE) && (frameOwner instanceof EditorScreen) && windowContext.getLaunchMode() != OpenMode.DIALOG && (screenIds.contains(frameOwner.getId()))) { String caption = frameOwner.getWindow().getCaption(); UUID entityId = null; Entity entity = ((EditorScreen) frameOwner).getEditedEntity(); if (entity != null) { if (PersistenceHelper.isNew(entity)) { return; } if (StringUtils.isBlank(caption)) { caption = messages.getTools().getEntityCaption(entity.getMetaClass()) + " " + metadata.getTools().getInstanceName(entity); } entityId = (UUID) entity.getId(); } ScreenHistoryEntity screenHistoryEntity = metadata.create(ScreenHistoryEntity.class); screenHistoryEntity.setCaption(StringUtils.abbreviate(caption, 255)); screenHistoryEntity.setUrl(makeLink(frameOwner)); screenHistoryEntity.setEntityId(entityId); addAdditionalFields(screenHistoryEntity, entity); CommitContext cc = new CommitContext(Collections.singleton(screenHistoryEntity)); dataManager.commit(cc); } }