File D:\maven-qcr-plugin-testsunitaires\qcr4java\jenkins-master\target\site\qc\core\src\main\java\hudson\model\ViewGroup.java.html

1 /*
2 * The MIT License
3 *
4 * Copyright (c) 2004-2010, Sun Microsystems, Inc., Kohsuke Kawaguchi,
5 * Tom Huybrechts, Alan Harder
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal
9 * in the Software without restriction, including without limitation the rights
10 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 * copies of the Software, and to permit persons to whom the Software is
12 * furnished to do so, subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included in
15 * all copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 * THE SOFTWARE.
24 */
25 package hudson.model;
26
27 import hudson.security.AccessControlled;
28 import hudson.views.ViewsTabBar;
29
30 import java.io.IOException;
31 import java.util.Collection;
32 import java.util.List;
33
34 /**
35 * Container of {@link View}s.
36 *
37 * @author Kohsuke Kawaguchi
38 * @since 1.269
39 */
40 public interface ViewGroup extends Saveable, ModelObject, AccessControlled {
41 /**
42 * Determine whether a view may be deleted.
43 * @since 1.365
44 */
45 boolean canDelete(View view);
46
47 /**
48 * Deletes a view in this group.
49 */
50 void deleteView(View view) throws IOException;
51
52 /**
53 * Gets all the views in this group.
54 *
55 * @return
56 * can be empty but never null.
57 */
58 Collection<View> getViews();
59
60 /**
61 * Gets a view of the given name.
62 *
63 * This also creates the URL binding for views (in the form of ".../view/FOOBAR/...")
64 */
65 View getView(String name);
66
67 /**
68 * If the view group renders one view in {@linkplain #getUrl() its own URL} (like Jenkins top page does),
69 * then that view is called the primary view. In this case, the hyperlink to the primary view points to
70 * the view group itself.
71 * <p>
72 * If the view group doesn't do such rendering, this method can always return null.
73 * <p>
74 * This method was added later to {@link ViewGroup}, so old plugins might not be implementing this.
75 * To work around this, {@link View}s can use {@link View#getOwnerPrimaryView()}.
76 *
77 * @since 1.417
78 */
79 View getPrimaryView();
80
81 /**
82 * Returns the path of this group, relative to the context root,
83 * like "foo/bar/zot/". Note no leading slash but trailing slash.
84 */
85 String getUrl();
86
87 /**
88 * {@link View} calls this method when it's renamed.
89 * This method is intended to work as a notification to the {@link ViewGroup}
90 * (so that it can adjust its internal data structure, for example.)
91 *
92 * <p>
93 * It is the caller's responsibility to ensure that the new name is a
94 * {@linkplain jenkins.model.Jenkins#checkGoodName(String) legal view name}.
95 */
96 void onViewRenamed(View view, String oldName, String newName);
97
98 /**
99 * Gets the TabBar for the views.
100 *
101 * TabBar for views can be provided by extension. Only one TabBar can be active
102 * at a given time (Selectable by user in the global Configuration page).
103 * Default TabBar is provided by Hudson Platform.
104 * @since 1.381
105 */
106 ViewsTabBar getViewsTabBar();
107
108 /**
109 * Returns the {@link ItemGroup} from which the views in this group should render items.
110 *
111 * <p>
112 * Generally speaking, Views render a subset of {@link TopLevelItem}s that belong to this item group.
113 * This method was added later to {@link ViewGroup}, so old plugins might not be implementing this.
114 * To work around this, {@link View}s can use {@link View#getOwnerItemGroup()}.
115 *
116 * @return
117 * Never null. Sometimes this is {@link ModifiableItemGroup} (if the container allows arbitrary addition)
118 * @since 1.417
119 */
120 ItemGroup<? extends TopLevelItem> getItemGroup();
121
122 /**
123 * Returns actions that should be displayed in views.
124 *
125 * <p>
126 * In this interface, the return value is used read-only. This doesn't prevent subtypes
127 * from returning modifiable actions, however.
128 *
129 * <p>
130 * This method was added later to {@link ViewGroup}, so old plugins might not be implementing this.
131 * To work around this, {@link View}s can use {@link View#getOwnerViewActions()}.
132 *
133 * @return
134 * may be empty but never null.
135 * @see Actionable#getActions()
136 * @since 1.417
137 */
138 List<Action> getViewActions();
139
140 }
141