public abstract class TopLevelItemDescriptor extends Descriptor<TopLevelItem> implements IconSpec
Descriptor
for TopLevelItem
s.Descriptor.FormException, Descriptor.PropertyType, Descriptor.Self
clazz
Modifier | Constructor and Description |
---|---|
protected |
TopLevelItemDescriptor()
Infers the type of the corresponding
TopLevelItem from the outer class. |
protected |
TopLevelItemDescriptor(Class<? extends TopLevelItem> clazz) |
Modifier and Type | Method and Description |
---|---|
static ExtensionList<TopLevelItemDescriptor> |
all()
Returns all the registered
TopLevelItem descriptors. |
void |
checkApplicableIn(ItemGroup parent)
Checks if this top level item is applicable within the specified item group.
|
String |
getCategoryId()
Used to categorize this kind of item type.
|
String |
getDescription()
A description of this kind of item type.
|
String |
getDisplayName()
Human readable name of this kind of configurable object.
|
String |
getIconClassName()
Get the Item's Icon class specification e.g.
|
String |
getIconFilePath(String size)
Deprecated.
prefer
getIconClassName() |
String |
getIconFilePathPattern()
Deprecated.
prefer
getIconClassName() |
boolean |
isApplicable(Descriptor descriptor)
TopLevelItemDescriptor s often uses other descriptors to decorate itself. |
boolean |
isApplicableIn(ItemGroup parent)
TopLevelItemDescriptor s often may want to limit the scope within which they can be created. |
abstract TopLevelItem |
newInstance(ItemGroup parent,
String name)
Creates a new
TopLevelItem for the specified parent. |
TopLevelItem |
newInstance(org.kohsuke.stapler.StaplerRequest req)
Deprecated.
since 2007-01-19.
This is not a valid operation for
Item s. |
TopLevelItem |
newInstance(String name)
Deprecated.
as of 1.390
Use
newInstance(ItemGroup, String) |
boolean |
testInstance(TopLevelItem i)
Tests if the given instance belongs to this descriptor, in the sense
that this descriptor can produce items like the given one.
|
addHelpFileRedirect, calcAutoCompleteSettings, calcFillSettings, configure, configure, doHelp, find, find, findByDescribableClassName, findById, getCategory, getCheckMethod, getCheckUrl, getConfigFile, getConfigPage, getCurrentDescriptorByNameUrl, getDescriptorFullUrl, getDescriptorUrl, getGlobalConfigPage, getGlobalPropertyType, getHelpFile, getHelpFile, getHelpFile, getId, getJsonSafeClassName, getKlass, getPlugin, getPossibleViewNames, getPropertyType, getPropertyType, getPropertyTypeOrDie, getRequiredGlobalConfigPagePermission, getT, getViewPage, isInstance, isSubTypeOf, load, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, save, self, toArray, toList, toMap
protected TopLevelItemDescriptor(Class<? extends TopLevelItem> clazz)
protected TopLevelItemDescriptor()
TopLevelItem
from the outer class.
This version works when you follow the common convention, where a descriptor
is written as the static nested class of the describable class.public boolean isApplicable(Descriptor descriptor)
TopLevelItemDescriptor
s often uses other descriptors to decorate itself.
This method allows the subtype of TopLevelItemDescriptor
s to filter them out.
This is useful for a workflow/company specific item type that wants to eliminate options that the user would see.
public boolean isApplicableIn(ItemGroup parent)
TopLevelItemDescriptor
s often may want to limit the scope within which they can be created.
This method allows the subtype of TopLevelItemDescriptor
s to filter them out.public final void checkApplicableIn(ItemGroup parent)
This is just a convenience function.
public boolean testInstance(TopLevelItem i)
TopLevelItemDescriptor
s that act like a wizard and produces different
object types than Descriptor.clazz
can override this method to augment
instance-descriptor relationship.
public String getDisplayName()
Class.getSimpleName()
on Descriptor.clazz
, so for example MyThing
from some.pkg.MyThing.DescriptorImpl
.
Historically some implementations returned null as a way of hiding the descriptor from the UI,
but this is generally managed by an explicit method such as isEnabled
or isApplicable
.
Used as the caption when the user chooses what item type to create.
The descriptor implementation also needs to have newInstanceDetail.jelly
script, which will be used to render the text below the caption
that explains the item type.
getDisplayName
in class Descriptor<TopLevelItem>
@NonNull public String getDescription()
@NonNull public String getCategoryId()
ItemCategory
ItemCategory.UncategorizedCategory#getId()
by default.@CheckForNull @Deprecated public String getIconFilePathPattern()
getIconClassName()
:size
represents the different
icon sizes used commonly in Jenkins project: 16x16, 24x24, 32x32 or 48x48FreeStyleProject.DescriptorImpl.getIconFilePathPattern()
@CheckForNull @Deprecated public String getIconFilePath(String size)
getIconClassName()
size
- A string with values that represent the common sizes: 16x16, 24x24, 32x32 or 48x48public String getIconClassName()
Note: do NOT include icon size specifications (such as 'icon-sm').
getIconClassName
in interface IconSpec
@Deprecated public TopLevelItem newInstance(org.kohsuke.stapler.StaplerRequest req) throws Descriptor.FormException
Item
s.newInstance
in class Descriptor<TopLevelItem>
Descriptor.FormException
@Deprecated public TopLevelItem newInstance(String name)
newInstance(ItemGroup, String)
TopLevelItem
.public abstract TopLevelItem newInstance(ItemGroup parent, String name)
TopLevelItem
for the specified parent.public static ExtensionList<TopLevelItemDescriptor> all()
TopLevelItem
descriptors.Copyright © 2004–2021. All rights reserved.