The widget ids are listed by the web service /api/widgets
*
* @param widgetId id of an existing widget
* @param columnId column starts with 1. The widget is ignored if the column id does not match the layout.
*/
public Widget addWidget(String widgetId, int columnId) {
if (columnId < 1) {
throw new IllegalArgumentException("Widget column starts with 1");
}
Widget widget = new Widget(widgetId);
widgetsByColumn.put(columnId, widget);
return widget;
}
public Collection Before version 3.1 no dashboard was global.
*
* @since 3.1
*/
public boolean isGlobal() {
return global;
}
/**
* A dashboard is global when it doesn't display information from a projet but rather more general information.
* Before version 3.1 no dashboard was global.
*
* @since 3.1
*/
public Dashboard setGlobal(boolean global) {
this.global = global;
return this;
}
/**
* A dashboard can be activated for all anonymous users or users who haven't configured their own dashboards.
* Before version 3.1 every dashboard created through this extension point was automatically activated.
* This is still the default behavior.
*
* @since 3.1
*/
public boolean isActivated() {
return activated;
}
/**
* Set whether the dashboard is activated for all anonymous users or users who haven't configured their own dashboards.
*
* @since 3.1
*/
public Dashboard setActivated(boolean activated) {
this.activated = activated;
return this;
}
/**
* Note that this class is an inner class to avoid confusion with the extension point org.sonar.api.web.Widget.
*/
public static final class Widget {
private String id;
private Map
* Note: you should use the i18n mechanism for the description.
*
* @param description the description to set
*/
public Dashboard setDescription(String description) {
this.description = description;
return this;
}
/**
* Returns the layout. Default value is the 2 columns mode with width 50%/50%.
*
* @return the layout
*/
public DashboardLayout getLayout() {
return layout;
}
public Dashboard setLayout(DashboardLayout dl) {
if (dl == null) {
throw new IllegalArgumentException("The layout can not be null");
}
this.layout = dl;
return this;
}
/**
* A dashboard is global when it doesn't display information from a projet but rather more general information.
*