jenkins.plugins.jobicon
Class CustomIconProperty.DescriptorImpl

java.lang.Object
  extended by hudson.model.Descriptor<hudson.model.JobProperty<?>>
      extended by hudson.model.JobPropertyDescriptor
          extended by jenkins.plugins.jobicon.CustomIconProperty.DescriptorImpl
All Implemented Interfaces:
hudson.model.Saveable
Enclosing class:
CustomIconProperty

@Extension
public static final class CustomIconProperty.DescriptorImpl
extends hudson.model.JobPropertyDescriptor


Nested Class Summary
 
Nested classes/interfaces inherited from class hudson.model.Descriptor
hudson.model.Descriptor.FormException, hudson.model.Descriptor.PropertyType, hudson.model.Descriptor.Self
 
Field Summary
 
Fields inherited from class hudson.model.Descriptor
clazz
 
Fields inherited from interface hudson.model.Saveable
NOOP
 
Constructor Summary
CustomIconProperty.DescriptorImpl()
           
 
Method Summary
 void doDeleteIcon(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
          Delete an icon.
 void doGlobalIconsTable(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
          Serves the icon table snippet
 void doStartUpload(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
          Serves the upload form
 void doUpload(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, String job)
          Upload an image file.
 String getDisplayName()
           
 List<String> getIcons()
          Retrieves the list of available icons.
 List<List<String>> getIconsAsListOfList(int colCount)
          Return a matrix of icon filenames.
 boolean isApplicable(Class<? extends hudson.model.Job> jobType)
           
 boolean isIconListEmpty()
          Indicates if any icon has been loaded.
 CustomIconProperty newInstance(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject formData)
           
 
Methods inherited from class hudson.model.JobPropertyDescriptor
all, getPropertyDescriptors
 
Methods inherited from class hudson.model.Descriptor
addHelpFileRedirect, calcAutoCompleteSettings, calcFillSettings, configure, configure, doHelp, find, find, getCheckUrl, getConfigPage, getCurrentDescriptorByNameUrl, getDescriptorFullUrl, getDescriptorUrl, getGlobalConfigPage, getGlobalPropertyType, getHelpFile, getHelpFile, getHelpFile, getId, getJsonSafeClassName, getKlass, getPossibleViewNames, getPropertyType, getPropertyType, getT, getViewPage, isInstance, isSubTypeOf, load, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, save, self, toArray, toList, toMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CustomIconProperty.DescriptorImpl

public CustomIconProperty.DescriptorImpl()
Method Detail

getDisplayName

public String getDisplayName()
Specified by:
getDisplayName in class hudson.model.Descriptor<hudson.model.JobProperty<?>>

isApplicable

public boolean isApplicable(Class<? extends hudson.model.Job> jobType)
Overrides:
isApplicable in class hudson.model.JobPropertyDescriptor

newInstance

public CustomIconProperty newInstance(org.kohsuke.stapler.StaplerRequest req,
                                      net.sf.json.JSONObject formData)
                               throws hudson.model.Descriptor.FormException
Overrides:
newInstance in class hudson.model.JobPropertyDescriptor
Throws:
hudson.model.Descriptor.FormException

doStartUpload

public void doStartUpload(org.kohsuke.stapler.StaplerRequest req,
                          org.kohsuke.stapler.StaplerResponse rsp)
                   throws IOException,
                          javax.servlet.ServletException
Serves the upload form

Parameters:
req - the stapler request
rsp - the stapler response
Throws:
IOException
javax.servlet.ServletException

doGlobalIconsTable

public void doGlobalIconsTable(org.kohsuke.stapler.StaplerRequest req,
                               org.kohsuke.stapler.StaplerResponse rsp)
                        throws IOException,
                               javax.servlet.ServletException
Serves the icon table snippet

Parameters:
req - the stapler request
rsp - the stapler response
Throws:
IOException
javax.servlet.ServletException

doDeleteIcon

public void doDeleteIcon(org.kohsuke.stapler.StaplerRequest req,
                         org.kohsuke.stapler.StaplerResponse rsp)
                  throws IOException,
                         javax.servlet.ServletException,
                         InterruptedException
Delete an icon. The request parameter icon contains the id.

Parameters:
req - the stapler request
rsp - the stapler response
Throws:
IOException
javax.servlet.ServletException
InterruptedException

doUpload

public void doUpload(org.kohsuke.stapler.StaplerRequest req,
                     org.kohsuke.stapler.StaplerResponse rsp,
                     @QueryParameter
                     String job)
              throws IOException,
                     javax.servlet.ServletException,
                     InterruptedException,
                     NoSuchAlgorithmException
Upload an image file.

Parameters:
req - the stapler request
rsp - the stapler response
job - the job name
Throws:
IOException
javax.servlet.ServletException
InterruptedException
NoSuchAlgorithmException

getIcons

public List<String> getIcons()
                      throws IOException,
                             InterruptedException
Retrieves the list of available icons. Sort the icons by filenames.

Returns:
the list of icon filenames
Throws:
IOException - if an error occurs while reading the icons directory
InterruptedException

isIconListEmpty

public boolean isIconListEmpty()
                        throws IOException,
                               InterruptedException
Indicates if any icon has been loaded.

Returns:
true if no icon is available, false otherwise
Throws:
IOException - if an error occurs while reading the icons directory
InterruptedException

getIconsAsListOfList

public List<List<String>> getIconsAsListOfList(int colCount)
                                        throws IOException,
                                               InterruptedException
Return a matrix of icon filenames. This matrix is used to display the table of available icons in the job configuration page.

Parameters:
colCount - the number of columns of the matrix.
Returns:
the icon filenames as a matrix (as a list of rows)
Throws:
IOException - if an error occurs while reading the icons directory
InterruptedException


Copyright © 2004-2012. All Rights Reserved.