Java源码示例:org.jenkins.ui.icon.Icon

示例1
@Override
public String getIconFileName() {
    String iconClassName = getIconClassName();
    Icon icon = IconSet.icons.getIconByClassSpec(iconClassName + " icon-md");
    if (icon != null) {
        JellyContext ctx = new JellyContext();
        ctx.setVariable("resURL",
            Stapler.getCurrentRequest().getContextPath() + Jenkins.RESOURCE_PATH);
        return icon.getQualifiedUrl(ctx);
    }
    return null;
}
 
示例2
public static String iconFileName(String name, Size size) {
    Icon icon = icons.getIconByClassSpec(classSpec(name, size));
    if (icon == null) {
        return null;
    }

    JellyContext ctx = new JellyContext();
    ctx.setVariable("resURL",
        Stapler.getCurrentRequest().getContextPath() + Jenkins.RESOURCE_PATH);
    return icon.getQualifiedUrl(ctx);
}
 
示例3
private static void addIcon(String name) {
    for (Size size : Size.values()) {
        icons.addIcon(
            new Icon(classSpec(name, size), ICON_PATH + size.dimensions + "/" + name + ".png",
                size.style));
    }
}
 
示例4
/**
 * {@inheritDoc}
 */
@Override
public String getIconFileName() {
    String iconClassName = getIconClassName();
    if (iconClassName != null) {
        Icon icon = IconSet.icons.getIconByClassSpec(iconClassName + " icon-md");
        if (icon != null) {
            JellyContext ctx = new JellyContext();
            ctx.setVariable("resURL", Stapler.getCurrentRequest().getContextPath() + Jenkins.RESOURCE_PATH);
            return icon.getQualifiedUrl(ctx);
        }
    }
    return null;
}
 
示例5
public static String iconFileName(String name, Size size) {
    Icon icon = icons.getIconByClassSpec(classSpec(name, size));
    if (icon == null) {
        return null;
    }

    JellyContext ctx = new JellyContext();
    ctx.setVariable("resURL", Stapler.getCurrentRequest().getContextPath() + Jenkins.RESOURCE_PATH);
    return icon.getQualifiedUrl(ctx);
}
 
示例6
@Override
public String getIconFileName() {
    String iconClassName = getIconClassName();
    if (iconClassName != null) {
        Icon icon = IconSet.icons.getIconByClassSpec(iconClassName + " icon-md");
        if (icon != null) {
            JellyContext ctx = new JellyContext();
            ctx.setVariable("resURL", Stapler.getCurrentRequest().getContextPath() + Jenkins.RESOURCE_PATH);
            return icon.getQualifiedUrl(ctx);
        }
    }
    return null;
}
 
示例7
private static void addIcon(String name) {
    for (Size size : Size.values()) {
        icons.addIcon(new Icon(classSpec(name, size), ICON_PATH + size.dimensions + "/" + name + ".png", size.style));
    }
}
 
示例8
private void registerIcons() {
    IconSet.icons.addIcon(new Icon("icon-docker-logo icon-sm", "docker-commons/images/16x16/docker.png", Icon.ICON_SMALL_STYLE, IconType.PLUGIN));
    IconSet.icons.addIcon(new Icon("icon-docker-logo icon-md", "docker-commons/images/24x24/docker.png", Icon.ICON_MEDIUM_STYLE, IconType.PLUGIN));
    IconSet.icons.addIcon(new Icon("icon-docker-logo icon-lg", "docker-commons/images/32x32/docker.png", Icon.ICON_LARGE_STYLE, IconType.PLUGIN));
    IconSet.icons.addIcon(new Icon("icon-docker-logo icon-xlg", "docker-commons/images/48x48/docker.png", Icon.ICON_XLARGE_STYLE, IconType.PLUGIN));
}