Skip to content
Permalink
Browse files

[JENKINS-38960 Follow-up] Switch to IconSet

  • Loading branch information...
stephenc committed Oct 19, 2016
1 parent 4b29ab8 commit de1d63daf7c9d5411d199f48e98bc07dfe930412
Showing with 30 additions and 2 deletions.
  1. +30 −2 src/main/java/hudson/maven/MavenModuleSet.java
@@ -45,7 +45,6 @@
import hudson.model.Executor;
import hudson.model.Item;
import hudson.model.ItemGroup;
import static hudson.model.ItemGroupMixIn.loadChildren;
import hudson.model.Job;
import hudson.model.Queue;
import hudson.model.Queue.Task;
@@ -102,6 +101,9 @@
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.math.NumberUtils;
import org.apache.maven.model.building.ModelBuildingRequest;
import org.jenkins.ui.icon.Icon;
import org.jenkins.ui.icon.IconSet;
import org.jenkins.ui.icon.IconSpec;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;
import org.kohsuke.stapler.HttpResponse;
@@ -111,6 +113,8 @@
import org.kohsuke.stapler.StaplerResponse;
import org.kohsuke.stapler.export.Exported;

import static hudson.model.ItemGroupMixIn.loadChildren;

/**
* Group of {@link MavenModule}s.
*
@@ -1300,7 +1304,7 @@ public DescriptorImpl getDescriptor() {
@Extension(ordinal=900)
public static final DescriptorImpl DESCRIPTOR = new DescriptorImpl();

public static final class DescriptorImpl extends AbstractProjectDescriptor {
public static final class DescriptorImpl extends AbstractProjectDescriptor implements IconSpec {
/**
* Globally-defined MAVEN_OPTS.
*/
@@ -1403,6 +1407,15 @@ public String getIconFilePathPattern() {
return "plugin/maven-plugin/images/:size/mavenmoduleset.png";
}

/**
* {@inheritDoc}
*/
@Override
public String getIconClassName() {
return "icon-maven-moduleset";
}


public MavenModuleSet newInstance(ItemGroup parent, String name) {
MavenModuleSet mms = new MavenModuleSet(parent,name);
mms.setSettings(GlobalMavenConfig.get().getSettingsProvider());
@@ -1442,6 +1455,21 @@ public boolean isApplicable(Descriptor descriptor) {
Mailer.class, // for historical reasons, Maven uses MavenMailer
JUnitResultArchiver.class // done by SurefireArchiver
));

static {
IconSet.icons.addIcon(
new Icon("icon-maven-moduleset icon-sm",
"plugin/maven/images/16x16/mavenmoduleset.png", Icon.ICON_SMALL_STYLE));
IconSet.icons.addIcon(
new Icon("icon-maven-moduleset icon-md",
"plugin/maven/images/24x24/mavenmoduleset.png", Icon.ICON_MEDIUM_STYLE));
IconSet.icons.addIcon(
new Icon("icon-maven-moduleset icon-lg",
"plugin/maven/images/32x32/mavenmoduleset.png", Icon.ICON_LARGE_STYLE));
IconSet.icons.addIcon(
new Icon("icon-maven-moduleset icon-xlg",
"plugin/maven/images/48x48/mavenmoduleset.png", Icon.ICON_XLARGE_STYLE));
}
}

private static final Logger LOGGER = Logger.getLogger(MavenModuleSet.class.getName());

0 comments on commit de1d63d

Please sign in to comment.
You can’t perform that action at this time.