com.metaeffekt.artifact.analysis.dashboard.SvgIcon Maven / Gradle / Ivy
The newest version!
/*
* Copyright 2021-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.metaeffekt.artifact.analysis.dashboard;
import j2html.tags.UnescapedText;
import static j2html.TagCreator.rawHtml;
/**
* Enum representing SVG icons.
* This enum provides a set of pre-defined SVG icons that can be used in web applications.
* The icons are sourced from https://icons.getbootstrap.com/.
* Each icon is defined with a path string that represents the SVG path data.
* If a newly added icon does not show up as expected, make sure to replace all "0 ." with "0 ." to
* prevent the HTML library from removing the space. Sometimes the first M
command is sometimes also
* affected by this issue: "M .2" -> "M .2".
*/
public enum SvgIcon {
LAYOUT_TEXT_SIDEBAR(" "),
ARROW_LEFT_CIRCLE_FILL(" "),
GEAR_FILL(" "),
PIE_CHART_FILL(" "),
BOOK(" "),
QUOTE(" "),
FLAG_FILL(" "),
THREE_DOTS(" "),
THREE_DOTS_VERTICAL(" "),
PLUS_CIRCLE_FILL(" "),
EXCLAMATION_DIAMOND_FILL(" "),
CHECK_CIRCLE_FILL(" "),
X_OCTAGON_FILL(" "),
EXCLAMATION_TRIANGLE_FILL(" "),
ALERT(" "),
INFO_CIRCLE(" "),
INFO_FILL(" "),
SUN(" "),
SUN_FILL(" "),
MOON_FILL(" "),
BAR_CHART_FILL(" "),
BORDER_WIDTH(" "),
PENCIL_FILL(" "),
CLIPBOARD(" "),
CLIPBOARD_CHECK(" "),
;
private final String path;
SvgIcon(String path) {
this.path = path.replace("0 .", "0 .");
}
public UnescapedText getTag(int size) {
return getTag(path, size);
}
public static UnescapedText getTag(String path, int size) {
return rawHtml("");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy