@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public class ContextMenuIconUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
addMenuItem(ModelObjectWithContextMenu.ContextMenu menu,
Action action)
Adds a menu item for the specified action.
|
static void |
addMenuItem(ModelObjectWithContextMenu.ContextMenu menu,
String prefix,
Action action)
Adds a menu item for the specified action with the supplied prefix offset.
|
static void |
addMenuItem(ModelObjectWithContextMenu.ContextMenu menu,
String prefix,
Action action,
ModelObjectWithContextMenu.ContextMenu subMenu)
Adds a menu item for the specified action with the supplied prefix offset and optional sub menu.
|
static String |
buildUrl(String... segments)
Combine segments of an URL in the style expected by
ModelObjectWithContextMenu.MenuItem. |
static Icon |
getIcon(Action action)
IconSet support has not been implemented for ModelObjectWithContextMenu.ContextMenu as of
Jenkins 2.5. |
static Icon |
getIconByClassSpec(String spec)
Navigate the signature changes in different versions of
IconSet. |
static String |
getMenuItemIconUrl(String url)
Converts a regular icon url into a menu item icon url
|
static String |
getMenuItemIconUrlByClassSpec(String spec)
Gets the qualified URL for an icon spec.
|
static String |
getQualifiedUrl(Icon icon)
Gets the qualified URL of the specified icon.
|
@NonNull public static String buildUrl(String... segments)
ModelObjectWithContextMenu.MenuItem.segments - the segments.public static void addMenuItem(@NonNull
ModelObjectWithContextMenu.ContextMenu menu,
@CheckForNull
String prefix,
@NonNull
Action action,
@CheckForNull
ModelObjectWithContextMenu.ContextMenu subMenu)
menu - the menu to add to.prefix - the prefix offset of the action urls.action - the action.subMenu - the sub menu.public static void addMenuItem(@NonNull
ModelObjectWithContextMenu.ContextMenu menu,
@CheckForNull
String prefix,
@NonNull
Action action)
menu - the menu to add to.prefix - the prefix offset of the action urls.action - the action.public static void addMenuItem(@NonNull
ModelObjectWithContextMenu.ContextMenu menu,
@NonNull
Action action)
menu - the menu to add to.action - the action.@CheckForNull public static String getMenuItemIconUrlByClassSpec(@CheckForNull String spec)
spec - the icon spec.public static String getMenuItemIconUrl(String url)
url - the "regular" icon url.@CheckForNull public static Icon getIconByClassSpec(String spec)
IconSet.spec - the spec to look up.Icon or null@CheckForNull public static Icon getIcon(@NonNull Action action)
IconSet support has not been implemented for ModelObjectWithContextMenu.ContextMenu as of
Jenkins 2.5. Hacks to work around
some of the fun method signature migrations in IconSet.action - the action.Icon or nullCopyright © 2016–2021. All rights reserved.