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
Fields inherited from class hudson.model.UserProperty
user
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addFavorite
(String job) Add favorite job.Get all favorite jobs.Deprecated.getUser()
boolean
hasFavorite
(String job) Checks if the user has a favorite entry for this job e.g.boolean
isJobFavorite
(String job) reconfigure
(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject form) void
removeFavorite
(String job) Set un-favorite a job.boolean
toggleFavorite
(String job) If job is favorited, then un-favorite it, else favorite it.Methods inherited from class hudson.model.UserProperty
all, setUser
-
Field Details
-
DESCRIPTOR
-
-
Constructor Details
-
FavoriteUserProperty
@DataBoundConstructor public FavoriteUserProperty()
-
-
Method Details
-
getUser
-
getFavorites
Deprecated.Use {#getAllFavorites()}- Returns:
- unmodifiable favorites job set
-
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.StaplerRequest req, net.sf.json.JSONObject form) throws Descriptor.FormException - Specified by:
reconfigure
in interfaceReconfigurableDescribable<UserProperty>
- Overrides:
reconfigure
in 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:
getDescriptor
in interfaceDescribable<UserProperty>
- Overrides:
getDescriptor
in classUserProperty
-
getIconFileName
- Specified by:
getIconFileName
in interfaceAction
-
getDisplayName
- Specified by:
getDisplayName
in interfaceAction
- Specified by:
getDisplayName
in interfaceModelObject
-
getUrlName
- Specified by:
getUrlName
in interfaceAction
-