Skip to content

Commit

Permalink
Merge branch 'JENKINS-31162' of github.com:recena/jenkins into JENKIN…
Browse files Browse the repository at this point in the history
…S-31162-withUI
  • Loading branch information
gusreiber committed Mar 15, 2016
2 parents 34908ef + a39a7f8 commit 0303b20
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 31 deletions.
11 changes: 2 additions & 9 deletions core/src/main/java/hudson/model/ItemGroupMixIn.java
Expand Up @@ -351,9 +351,8 @@ public static Categories getCategories(Authentication a, ItemGroup c) {

// Information about Item.
metadata.put("class", effectiveClazz);
metadata.put("iconClassName", "item-icon-" + effectiveClazz.substring(descriptor.clazz.getName().lastIndexOf(".") + 1).toLowerCase());
metadata.put("weight", ItemCategoryConfigurator.getWeight(descriptor));
metadata.put("name", descriptor.getDisplayName());
metadata.put("displayName", descriptor.getDisplayName());
metadata.put("description", ItemCategoryConfigurator.getDescription(descriptor));

Category category = categories.getItem(ic.getId());
Expand All @@ -362,16 +361,10 @@ public static Categories getCategories(Authentication a, ItemGroup c) {
} else {
List<Map<String, Serializable>> temp = new ArrayList<Map<String, Serializable>>();
temp.add(metadata);
category = new Category(ic.getId(), ic.getDisplayName(), ic.getDescription(), ic.getIconClassName(),
ic.getWeight(), ic.getMinToShow(), temp);
category = new Category(ic.getId(), ic.getDisplayName(), ic.getDescription(), ic.getWeight(), ic.getMinToShow(), temp);
categories.getItems().add(category);
}
}
if (Jenkins.getInstance().getAllItems().size() > 0) {
Category copy = new Category("category-id-copy", "Copy existing Item", "", "category-icon-copy",
ItemCategory.MIN_WEIGHT, ItemCategory.MIN_TOSHOW, new ArrayList<Map<String, Serializable>>());
categories.getItems().add(copy);
}
return categories;
}

Expand Down
11 changes: 1 addition & 10 deletions core/src/main/java/jenkins/model/item_category/Category.java
Expand Up @@ -22,20 +22,16 @@ public class Category implements Serializable {

private String description;

private String iconClassName;

private int weight;

private int minToShow;

private List<Map<String, Serializable>> items;

public Category(String id, String name, String description, String iconClassName, int weight, int minToShow,
List<Map<String, Serializable>> items) {
public Category(String id, String name, String description, int weight, int minToShow, List<Map<String, Serializable>> items) {
this.id= id;
this.name = name;
this.description = description;
this.iconClassName = iconClassName;
this.weight = weight;
this.minToShow = minToShow;
this.items = items;
Expand All @@ -56,11 +52,6 @@ public String getDescription() {
return description;
}

@Exported
public String getIconClassName() {
return iconClassName;
}

@Exported
public int getWeight() {
return weight;
Expand Down
12 changes: 0 additions & 12 deletions core/src/main/java/jenkins/model/item_category/ItemCategory.java
Expand Up @@ -23,13 +23,6 @@ public abstract class ItemCategory implements ModelObject, ExtensionPoint {
*/
public abstract String getId();

/**
* The icon class specification e.g. 'category-icon-folder', 'category-icon-basicprojects', etc.
*
* @return the icon class specification
*/
public abstract String getIconClassName();

/**
* The description in plain text
*
Expand Down Expand Up @@ -62,11 +55,6 @@ public String getId() {
return "category-id-basicprojects";
}

@Override
public String getIconClassName() {
return "category-icon-basicprojects";
}

@Override
public String getDescription() {
return Messages.ItemCategory_BasicProjects_Description();
Expand Down

0 comments on commit 0303b20

Please sign in to comment.