You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@causeway.apache.org by da...@apache.org on 2023/12/14 00:21:02 UTC
(causeway) branch master updated: CAUSEWAY-3660 : fixes icon duplication
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/causeway.git
The following commit(s) were added to refs/heads/master by this push:
new b41d2d7362 CAUSEWAY-3660 : fixes icon duplication
b41d2d7362 is described below
commit b41d2d7362ad10cec93b2247df5e0237262d32e0
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Dec 14 00:20:34 2023 +0000
CAUSEWAY-3660 : fixes icon duplication
---
.../entity/icontitle/EntityIconAndTitlePanel.java | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/components/entity/icontitle/EntityIconAndTitlePanel.java b/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/components/entity/icontitle/EntityIconAndTitlePanel.java
index be613002b0..0bebb571b6 100644
--- a/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/components/entity/icontitle/EntityIconAndTitlePanel.java
+++ b/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/components/entity/icontitle/EntityIconAndTitlePanel.java
@@ -133,13 +133,14 @@ extends PanelAbstract<ManagedObject, ObjectAdapterModel> {
Wkt.labelAdd(link, ID_ENTITY_TITLE, title.abbreviatedTitle());
// If the link title is abbreviated or not shown, add the full-title to the tooltip body.
- if(isTitleSuppressed()
- || title.isTitleAbbreviated()) {
- WktTooltips.addTooltip(link, title.tooltipTitle(), title.tooltipBodyIncludingFullTitle());
+ if(isTitleSuppressed() || title.isTitleAbbreviated()) {
+ String body = title.isFullTitleEqualToBody() ? title.tooltipBody() : title.tooltipBodyIncludingFullTitle();
+ WktTooltips.addTooltip(link, title.tooltipTitle(), body);
} else if(title.isTooltipTitleEqualToBody()) {
WktTooltips.addTooltip(link, title.tooltipBody());
} else {
- WktTooltips.addTooltip(link, title.tooltipTitle(), title.tooltipBody());
+ String body = title.isFullTitleEqualToBody() ? title.tooltipBody() : title.tooltipBodyIncludingFullTitle();
+ WktTooltips.addTooltip(link, title.tooltipTitle(), body);
}
}
@@ -194,6 +195,12 @@ extends PanelAbstract<ManagedObject, ObjectAdapterModel> {
return _Strings.nullToEmpty(tooltipTitle)
.equalsIgnoreCase(_Strings.nullToEmpty(tooltipBody));
}
+
+ public boolean isFullTitleEqualToBody() {
+ return _Strings.nullToEmpty(fullTitle)
+ .equalsIgnoreCase(_Strings.nullToEmpty(tooltipBody));
+ }
+
/**
* Whether not {@link #abbreviatedTitle()} equals {@link #fullTitle()}.
* <p>
@@ -207,6 +214,7 @@ extends PanelAbstract<ManagedObject, ObjectAdapterModel> {
+ "\n-\n"
+ _Strings.nullToEmpty(tooltipBody);
}
+
}
private TitleRecord cachedTitle;