PageRenderTime 28ms CodeModel.GetById 21ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/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 */
24package hudson.views;
25
26import hudson.DescriptorExtensionList;
27import hudson.ExtensionPoint;
28import hudson.model.AbstractDescribableImpl;
29import hudson.model.Descriptor;
30import hudson.model.Hudson;
31import hudson.model.ListView;
32
33/**
34 * Extension point for adding a ViewsTabBar header to Projects {@link ListView}.
35 *
36 * <p>
37 * This object must have the <tt>viewTabs.jelly</tt>. This view
38 * is called once when the project views main panel is built.
39 * The "views" attribute is set to the "Collection of views".
40 *
41 * <p>
42 * There also must be a default constructor, which is invoked to create a Views TabBar in
43 * the default configuration.
44 *
45 * @author Winston Prakash
46 * @since 1.381
47 * @see ViewsTabBarDescriptor
48 */
49public abstract class ViewsTabBar extends AbstractDescribableImpl<ViewsTabBar> implements ExtensionPoint {
50    /**
51     * Returns all the registered {@link ViewsTabBar} descriptors.
52     */
53    public static DescriptorExtensionList<ViewsTabBar, Descriptor<ViewsTabBar>> all() {
54        return Hudson.getInstance().<ViewsTabBar, Descriptor<ViewsTabBar>>getDescriptorList(ViewsTabBar.class);
55    }
56
57    @Override
58    public ViewsTabBarDescriptor getDescriptor() {
59        return (ViewsTabBarDescriptor)super.getDescriptor();
60    }
61}