Search in sources :

Example 1 with ExtensionDescription

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

the class ExtensionAggregateBooleansQuery 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 2 with ExtensionDescription

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

the class ExtensionAggregateBooleansQuery method extractDescription.

private ExtensionDescription extractDescription(ResultSet set) throws SQLException {
    String name = set.getString("provider_name") + "_aggregate";
    String text = set.getString(ExtensionProviderTable.TEXT) + " / Players";
    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 3 with ExtensionDescription

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

the class ExtensionAggregateDoublesQuery 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 4 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 5 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)

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