Search in sources :

Example 6 with ExtensionDescription

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

the class ExtensionAggregateDoublesQuery method extractTabDataByPluginID.

private QueriedTabData extractTabDataByPluginID(ResultSet set) throws SQLException {
    QueriedTabData tabData = new QueriedTabData();
    while (set.next()) {
        int pluginID = set.getInt("plugin_id");
        String tabName = Optional.ofNullable(set.getString("tab_name")).orElse("");
        ExtensionTabData.Builder extensionTab = tabData.getTab(pluginID, tabName, () -> extractTabInformation(tabName, set));
        ExtensionDescription extensionDescription = extractDescription(set);
        extractAndPutDataTo(extensionTab, extensionDescription, set);
    }
    return tabData;
}
Also used : ExtensionTabData(com.djrapitops.plan.extension.implementation.results.ExtensionTabData) ExtensionDescription(com.djrapitops.plan.extension.implementation.results.ExtensionDescription)

Example 7 with ExtensionDescription

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

the class ExtensionAggregateNumbersQuery method extractDescription.

private ExtensionDescription extractDescription(ResultSet set) throws SQLException {
    String name = set.getString("provider_name");
    String text = set.getString(ExtensionProviderTable.TEXT);
    String description = set.getString(ExtensionProviderTable.DESCRIPTION);
    int priority = set.getInt("provider_priority");
    String iconName = set.getString("provider_icon_name");
    Family family = Family.getByName(set.getString("provider_icon_family")).orElse(Family.SOLID);
    Color color = Color.getByName(set.getString("provider_icon_color")).orElse(Color.NONE);
    Icon icon = new Icon(family, iconName, color);
    return new ExtensionDescription(name, text, description, icon, priority);
}
Also used : Color(com.djrapitops.plan.extension.icon.Color) ExtensionDescription(com.djrapitops.plan.extension.implementation.results.ExtensionDescription) Family(com.djrapitops.plan.extension.icon.Family) Icon(com.djrapitops.plan.extension.icon.Icon)

Example 8 with ExtensionDescription

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

the class ExtensionAggregateNumbersQuery method extractTabDataByPluginID.

private QueriedTabData extractTabDataByPluginID(ResultSet set) throws SQLException {
    QueriedTabData tabData = new QueriedTabData();
    while (set.next()) {
        int pluginID = set.getInt("plugin_id");
        String tabName = Optional.ofNullable(set.getString("tab_name")).orElse("");
        ExtensionTabData.Builder extensionTab = tabData.getTab(pluginID, tabName, () -> extractTabInformation(tabName, set));
        ExtensionDescription extensionDescription = extractDescription(set);
        extractAndPutDataTo(extensionTab, extensionDescription, set);
    }
    return tabData;
}
Also used : ExtensionTabData(com.djrapitops.plan.extension.implementation.results.ExtensionTabData) ExtensionDescription(com.djrapitops.plan.extension.implementation.results.ExtensionDescription)

Example 9 with ExtensionDescription

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

the class ExtensionAggregatePercentagesQuery method extractDescription.

private ExtensionDescription extractDescription(ResultSet set) throws SQLException {
    String name = set.getString("provider_name");
    String text = set.getString(ExtensionProviderTable.TEXT);
    String description = set.getString(ExtensionProviderTable.DESCRIPTION);
    int priority = set.getInt("provider_priority");
    String iconName = set.getString("provider_icon_name");
    Family family = Family.getByName(set.getString("provider_icon_family")).orElse(Family.SOLID);
    Color color = Color.getByName(set.getString("provider_icon_color")).orElse(Color.NONE);
    Icon icon = new Icon(family, iconName, color);
    return new ExtensionDescription(name, text, description, icon, priority);
}
Also used : Color(com.djrapitops.plan.extension.icon.Color) ExtensionDescription(com.djrapitops.plan.extension.implementation.results.ExtensionDescription) Family(com.djrapitops.plan.extension.icon.Family) Icon(com.djrapitops.plan.extension.icon.Icon)

Example 10 with ExtensionDescription

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

the class ExtensionAggregatePercentagesQuery method extractTabDataByPluginID.

private QueriedTabData extractTabDataByPluginID(ResultSet set) throws SQLException {
    QueriedTabData tabData = new QueriedTabData();
    while (set.next()) {
        int pluginID = set.getInt("plugin_id");
        String tabName = Optional.ofNullable(set.getString("tab_name")).orElse("");
        ExtensionTabData.Builder extensionTab = tabData.getTab(pluginID, tabName, () -> extractTabInformation(tabName, set));
        ExtensionDescription extensionDescription = extractDescription(set);
        extractAndPutDataTo(extensionTab, extensionDescription, set);
    }
    return tabData;
}
Also used : ExtensionTabData(com.djrapitops.plan.extension.implementation.results.ExtensionTabData) ExtensionDescription(com.djrapitops.plan.extension.implementation.results.ExtensionDescription)

Aggregations

ExtensionDescription (com.djrapitops.plan.extension.implementation.results.ExtensionDescription)10 Color (com.djrapitops.plan.extension.icon.Color)5 Family (com.djrapitops.plan.extension.icon.Family)5 Icon (com.djrapitops.plan.extension.icon.Icon)5 ExtensionTabData (com.djrapitops.plan.extension.implementation.results.ExtensionTabData)5