Search in sources :

Example 1 with ExtensionTableData

use of com.djrapitops.plan.extension.implementation.results.ExtensionTableData in project Plan by plan-player-analytics.

the class QueriedTables method toQueriedTabs.

public QueriedTabData toQueriedTabs() {
    QueriedTabData tabData = new QueriedTabData();
    for (Map.Entry<Integer, Map<Integer, Table.Factory>> entry : byPluginID.entrySet()) {
        Integer pluginID = entry.getKey();
        for (Table.Factory table : entry.getValue().values()) {
            // Extra Table information
            String tableName = TableAccessor.getTableName(table);
            Color tableColor = TableAccessor.getColor(table);
            // Extra tab information
            String tabName = TableAccessor.getTabName(table);
            ExtensionTabData.Builder tab = tabData.getTab(pluginID, tabName, () -> extractTabInformation(table));
            tab.putTableData(new ExtensionTableData(tableName, table.build(), tableColor));
        }
    }
    return tabData;
}
Also used : ExtensionTabData(com.djrapitops.plan.extension.implementation.results.ExtensionTabData) Table(com.djrapitops.plan.extension.table.Table) ExtensionTableData(com.djrapitops.plan.extension.implementation.results.ExtensionTableData) Color(com.djrapitops.plan.extension.icon.Color) Map(java.util.Map) HashMap(java.util.HashMap)

Aggregations

Color (com.djrapitops.plan.extension.icon.Color)1 ExtensionTabData (com.djrapitops.plan.extension.implementation.results.ExtensionTabData)1 ExtensionTableData (com.djrapitops.plan.extension.implementation.results.ExtensionTableData)1 Table (com.djrapitops.plan.extension.table.Table)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1