org.sonar.api.web
Class Dashboard

java.lang.Object
  extended by org.sonar.api.web.Dashboard

public final class Dashboard
extends Object

Definition of a dashboard.

Its name and description can be retrieved using the i18n mechanism, using the keys "dashboard.<id>.name" and "dashboard.<id>.description".

Since:
2.13

Nested Class Summary
static class Dashboard.Widget
          Note that this class is an inner class to avoid confusion with the extension point org.sonar.api.web.Widget.
 
Method Summary
 Dashboard.Widget addWidget(String widgetId, int columnId)
          Add a widget with the given parameters, and return the newly created Dashboard.Widget object if one wants to add parameters to it.
static Dashboard create()
          Creates a new Dashboard.
 String getDescription()
          Returns the description of the dashboard.
 DashboardLayout getLayout()
          Returns the layout.
 Collection<Dashboard.Widget> getWidgets()
           
 List<Dashboard.Widget> getWidgetsOfColumn(int columnId)
           
 Dashboard setDescription(String description)
          Sets the description of the dashboard.
 Dashboard setLayout(DashboardLayout dl)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static Dashboard create()
Creates a new Dashboard.


addWidget

public Dashboard.Widget addWidget(String widgetId,
                                  int columnId)
Add a widget with the given parameters, and return the newly created Dashboard.Widget object if one wants to add parameters to it.

The widget ids are listed by the web service /api/widgets

Parameters:
widgetId - id of an existing widget
columnId - column starts with 1. The widget is ignored if the column id does not match the layout.

getWidgets

public Collection<Dashboard.Widget> getWidgets()

getWidgetsOfColumn

public List<Dashboard.Widget> getWidgetsOfColumn(int columnId)

getDescription

public String getDescription()
Returns the description of the dashboard.

Returns:
the description

setDescription

public Dashboard setDescription(String description)
Sets the description of the dashboard.

Note: you should use the i18n mechanism for the description.

Parameters:
description - the description to set

getLayout

public DashboardLayout getLayout()
Returns the layout. Default value is the 2 columns mode with width 50%/50%.

Returns:
the layout

setLayout

public Dashboard setLayout(DashboardLayout dl)


Copyright © 2009-2012 SonarSource. All Rights Reserved.