forked from jenkinsci/jenkins
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7827304
commit b746fba
Showing
8 changed files
with
86 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
package jenkins.search; | ||
|
||
import edu.umd.cs.findbugs.annotations.NonNull; | ||
import hudson.Extension; | ||
import hudson.ExtensionList; | ||
import hudson.ExtensionPoint; | ||
import hudson.model.ModelObject; | ||
|
||
public interface SearchGroup extends ExtensionPoint, ModelObject { | ||
|
||
static ExtensionList<SearchGroup> all() { | ||
return ExtensionList.lookup(SearchGroup.class); | ||
} | ||
|
||
static @NonNull <T extends SearchGroup> T get(Class<T> type) { | ||
T category = all().get(type); | ||
if (category == null) { | ||
throw new AssertionError("Group not found. It seems the " + type + " is not annotated with @Extension and so not registered"); | ||
} | ||
return category; | ||
} | ||
|
||
@Extension | ||
class UnclassifiedSearchGroup implements SearchGroup { | ||
|
||
@Override | ||
public String getDisplayName() { | ||
return "Other"; | ||
} | ||
} | ||
|
||
@Extension | ||
class JobSearchGroup implements SearchGroup { | ||
|
||
@Override | ||
public String getDisplayName() { | ||
return "Projects"; | ||
} | ||
} | ||
|
||
@Extension | ||
class ComputerSearchGroup implements SearchGroup { | ||
|
||
@Override | ||
public String getDisplayName() { | ||
return "Computers"; | ||
} | ||
} | ||
|
||
@Extension | ||
class ViewSearchGroup implements SearchGroup { | ||
|
||
@Override | ||
public String getDisplayName() { | ||
return "Views"; | ||
} | ||
} | ||
|
||
@Extension | ||
class UserSearchGroup implements SearchGroup { | ||
|
||
@Override | ||
public String getDisplayName() { | ||
return "Users"; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters