Truncation of Extension table column names

This commit is contained in:
Rsl1122 2019-09-05 17:22:09 +03:00
parent f26fb1ca84
commit 2da10001dc
2 changed files with 6 additions and 1 deletions

View File

@ -2,6 +2,10 @@ plugins {
id "com.jfrog.bintray" version "1.8.4"
}
dependencies {
compileOnly group: 'org.apache.commons', name: 'commons-lang3', version: '3.9'
}
ext.apiVersion = '5.0-R0.3'
bintray {

View File

@ -19,6 +19,7 @@ package com.djrapitops.plan.extension.table;
import com.djrapitops.plan.extension.ElementOrder;
import com.djrapitops.plan.extension.icon.Color;
import com.djrapitops.plan.extension.icon.Icon;
import org.apache.commons.lang3.StringUtils;
import java.util.ArrayList;
import java.util.Arrays;
@ -109,7 +110,7 @@ public final class Table {
}
private Factory column(int indx, String columnName, Icon icon) {
building.columns[indx] = columnName;
building.columns[indx] = StringUtils.truncate(columnName, 50);
building.icons[indx] = icon != null ? Icon.called(icon.getName()).of(icon.getFamily()).build() : Icon.called("question").build();
return this;
}