mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-25 05:23:51 +00:00
Refactoring - Moved desktop LongNamesUtil into respective package and
removed unsued methods
This commit is contained in:
1 parent
5c35074630
commit
9f967afb72
3 files changed
+3
-29
No files matched your search
+1
-1
@@ -13,7 +13,7 @@ import com.google.gwt.user.client.EventListener;
|
||||
import com.google.gwt.user.client.ui.Composite;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sap.sailing.gwt.common.client.LinkUtil;
|
||||
import com.sap.sailing.gwt.home.client.shared.LongNamesUtil;
|
||||
import com.sap.sailing.gwt.home.desktop.utils.LongNamesUtil;
|
||||
import com.sap.sailing.gwt.home.shared.app.PlaceNavigation;
|
||||
import com.sap.sailing.gwt.home.shared.utils.EventDatesFormatterUtil;
|
||||
import com.sap.sailing.gwt.home.shared.utils.LabelTypeUtil;
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ import com.google.gwt.uibinder.client.UiField;
|
||||
import com.google.gwt.user.client.ui.Composite;
|
||||
import com.google.gwt.user.client.ui.SimplePanel;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.sap.sailing.gwt.home.client.shared.LongNamesUtil;
|
||||
import com.sap.sailing.gwt.home.desktop.utils.LongNamesUtil;
|
||||
import com.sap.sailing.gwt.home.shared.partials.videoplayer.VideoPlayer;
|
||||
import com.sap.sailing.gwt.ui.shared.media.SailingVideoDTO;
|
||||
|
||||
|
||||
+1
-27
@@ -1,4 +1,4 @@
|
||||
package com.sap.sailing.gwt.home.client.shared;
|
||||
package com.sap.sailing.gwt.home.desktop.utils;
|
||||
|
||||
import com.google.gwt.safehtml.shared.SafeHtml;
|
||||
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
|
||||
@@ -6,19 +6,10 @@ import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
|
||||
/**
|
||||
* A utility class for handling long names
|
||||
* @author Frank
|
||||
*
|
||||
*/
|
||||
public class LongNamesUtil {
|
||||
private static String NAME_SPLIT_RULE1 = " - ";
|
||||
|
||||
public static String shortenLongName(String name, int maxLength) {
|
||||
String result = name;
|
||||
if (name.length() > maxLength) {
|
||||
name = name.substring(0, maxLength - 3) + "...";
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static SafeHtml breakLongName(String name) {
|
||||
SafeHtmlBuilder builder = new SafeHtmlBuilder();
|
||||
if(name != null) {
|
||||
@@ -39,21 +30,4 @@ public class LongNamesUtil {
|
||||
return builder.toSafeHtml();
|
||||
}
|
||||
|
||||
/**
|
||||
* Temp -> remove as soon as we have a display name for a leaderboardGroup
|
||||
*/
|
||||
public static String shortenLeaderboardGroupName(String eventName, String leaderboardGroupName) {
|
||||
String result = leaderboardGroupName;
|
||||
if (result.startsWith(eventName) && !eventName.equals(leaderboardGroupName)) {
|
||||
result = result.substring(eventName.length(), result.length());
|
||||
result = result.trim();
|
||||
|
||||
if (result.startsWith("-") || result.startsWith("/")) {
|
||||
result = result.substring(1, result.length());
|
||||
result = result.trim();
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user