81 lines
2.7 KiB
Java
81 lines
2.7 KiB
Java
/*
|
|
* This file is part of Player Analytics (Plan).
|
|
*
|
|
* Plan is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU Lesser General Public License v3 as published by
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* Plan is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU Lesser General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
* along with Plan. If not, see <https://www.gnu.org/licenses/>.
|
|
*/
|
|
package com.djrapitops.plan.extension.annotation;
|
|
|
|
import com.djrapitops.plan.extension.icon.Color;
|
|
import com.djrapitops.plan.extension.icon.Family;
|
|
|
|
import java.lang.annotation.ElementType;
|
|
import java.lang.annotation.Retention;
|
|
import java.lang.annotation.RetentionPolicy;
|
|
import java.lang.annotation.Target;
|
|
|
|
/**
|
|
* Method annotation to provide {@code String[]} array of Group names about a Player.
|
|
* <p>
|
|
* This method annotation only works when used with {@code UUID} or {@code String} as a method parameter (for Players).
|
|
* <p>
|
|
* For example:
|
|
* {@code @GroupProvider public String[] getJobs(UUID playerUUID) {}}
|
|
* <p>
|
|
* Group data is parsed as Table for /server and /network page and similar to {@link StringProvider} for /player page.
|
|
* <p>
|
|
* Requires Capability {@code DATA_EXTENSION_GROUPS}
|
|
*
|
|
* @author AuroraLS3
|
|
*/
|
|
@Retention(RetentionPolicy.RUNTIME)
|
|
@Target(ElementType.METHOD)
|
|
public @interface GroupProvider {
|
|
|
|
/**
|
|
* Text displayed before the value, limited to 50 characters.
|
|
* <p>
|
|
* Should inform the user what the group names represent, for example
|
|
* "Town" or "Job"
|
|
*
|
|
* @return String of max 50 characters, remainder will be clipped.
|
|
*/
|
|
String text() default "Group";
|
|
|
|
/**
|
|
* Determine the color of the table header for this group.
|
|
*
|
|
* @return Preferred color. If none are specified defaults are used.
|
|
*/
|
|
Color groupColor() default Color.NONE;
|
|
|
|
/**
|
|
* Name of Font Awesome icon.
|
|
* <p>
|
|
* See <a href="https://fontawesome.com/icons">FontAwesome</a> (select 'free')) for icons and their {@link Family}.
|
|
*
|
|
* @return Name of the icon, if name is not valid no icon is shown.
|
|
*/
|
|
String iconName() default "circle";
|
|
|
|
/**
|
|
* Family of Font Awesome icon.
|
|
* <p>
|
|
* See <a href="https://fontawesome.com/icons">FontAwesome</a> (select 'free')) for icons and their {@link Family}.
|
|
*
|
|
* @return Family that matches an icon, if there is no icon for this family no icon is shown.
|
|
*/
|
|
Family iconFamily() default Family.SOLID;
|
|
|
|
}
|