Package hudson.plugins.favorite.user
Class FavoriteUserProperty
java.lang.Object
hudson.model.UserProperty
hudson.plugins.favorite.user.FavoriteUserProperty
- All Implemented Interfaces:
ExtensionPoint,Action,Describable<UserProperty>,ModelObject,ReconfigurableDescribable<UserProperty>
@ExportedBean(defaultVisibility=999)
public class FavoriteUserProperty
extends UserProperty
implements Action
Do not use directly.
Instead @Inject
Favorites.-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Field Summary
FieldsFields inherited from class hudson.model.UserProperty
user -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFavorite(String job) Add favorite job.Get all favorite jobs.Deprecated.getUser()booleanhasFavorite(String job) Checks if the user has a favorite entry for this job e.g.booleanisJobFavorite(String job) reconfigure(org.kohsuke.stapler.StaplerRequest2 req, net.sf.json.JSONObject form) voidremoveFavorite(String job) Set un-favorite a job.booleantoggleFavorite(String job) If job is favorited, then un-favorite it, else favorite it.Methods inherited from class hudson.model.UserProperty
all, allByCategoryClass, reconfigure, setUser
-
Field Details
-
DESCRIPTOR
-
-
Constructor Details
-
FavoriteUserProperty
@DataBoundConstructor public FavoriteUserProperty()
-
-
Method Details
-
getUser
-
getFavorites
Deprecated.Use {#getAllFavorites()}- Returns:
- unmodifiable favorites job set
-
getFavoritesSortedByDisplayName
-
getAllFavorites
Get all favorite jobs.- Returns:
- unmodifiable favorites job set
-
addFavorite
Add favorite job.- Parameters:
job- job full name- Throws:
IOException- if error saving status
-
removeFavorite
Set un-favorite a job.- Parameters:
job- full job name- Throws:
IOException- if error saving status
-
toggleFavorite
If job is favorited, then un-favorite it, else favorite it.- Parameters:
job- full job name- Returns:
- true if the new status is favorite, false if new status is not favorite.
- Throws:
IOException- if error saving status
-
reconfigure
public UserProperty reconfigure(org.kohsuke.stapler.StaplerRequest2 req, net.sf.json.JSONObject form) throws Descriptor.FormException - Specified by:
reconfigurein interfaceReconfigurableDescribable<UserProperty>- Overrides:
reconfigurein classUserProperty- Throws:
Descriptor.FormException
-
isJobFavorite
-
hasFavorite
Checks if the user has a favorite entry for this job e.g. this is true when the user has favoriteted or unfavoriteted a job but not true for when a job has not been favorited by this user- Parameters:
job- path- Returns:
- favorite
-
getDescriptor
- Specified by:
getDescriptorin interfaceDescribable<UserProperty>- Overrides:
getDescriptorin classUserProperty
-
getIconFileName
- Specified by:
getIconFileNamein interfaceAction
-
getDisplayName
- Specified by:
getDisplayNamein interfaceAction- Specified by:
getDisplayNamein interfaceModelObject
-
getUrlName
- Specified by:
getUrlNamein interfaceAction
-