/hudson-core/src/main/java/hudson/views/ViewsTabBar.java

http://github.com/hudson/hudson · Java · 61 lines · 16 code · 3 blank · 42 comment · 0 complexity · 8f6adbcaf4655f41c8888b363be29c9a MD5 · raw file

  1. /*
  2. * The MIT License
  3. *
  4. * Copyright (c) 2010, Winston.Prakash@oracle.com
  5. *
  6. * Permission is hereby granted, free of charge, to any person obtaining a copy
  7. * of this software and associated documentation files (the "Software"), to deal
  8. * in the Software without restriction, including without limitation the rights
  9. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10. * copies of the Software, and to permit persons to whom the Software is
  11. * furnished to do so, subject to the following conditions:
  12. *
  13. * The above copyright notice and this permission notice shall be included in
  14. * all copies or substantial portions of the Software.
  15. *
  16. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  19. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  20. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  21. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  22. * THE SOFTWARE.
  23. */
  24. package hudson.views;
  25. import hudson.DescriptorExtensionList;
  26. import hudson.ExtensionPoint;
  27. import hudson.model.AbstractDescribableImpl;
  28. import hudson.model.Descriptor;
  29. import hudson.model.Hudson;
  30. import hudson.model.ListView;
  31. /**
  32. * Extension point for adding a ViewsTabBar header to Projects {@link ListView}.
  33. *
  34. * <p>
  35. * This object must have the <tt>viewTabs.jelly</tt>. This view
  36. * is called once when the project views main panel is built.
  37. * The "views" attribute is set to the "Collection of views".
  38. *
  39. * <p>
  40. * There also must be a default constructor, which is invoked to create a Views TabBar in
  41. * the default configuration.
  42. *
  43. * @author Winston Prakash
  44. * @since 1.381
  45. * @see ViewsTabBarDescriptor
  46. */
  47. public abstract class ViewsTabBar extends AbstractDescribableImpl<ViewsTabBar> implements ExtensionPoint {
  48. /**
  49. * Returns all the registered {@link ViewsTabBar} descriptors.
  50. */
  51. public static DescriptorExtensionList<ViewsTabBar, Descriptor<ViewsTabBar>> all() {
  52. return Hudson.getInstance().<ViewsTabBar, Descriptor<ViewsTabBar>>getDescriptorList(ViewsTabBar.class);
  53. }
  54. @Override
  55. public ViewsTabBarDescriptor getDescriptor() {
  56. return (ViewsTabBarDescriptor)super.getDescriptor();
  57. }
  58. }