com.atlassian.gadgets.dashboard.internal
Interface Dashboard

All Known Implementing Classes:
DashboardImpl

public interface Dashboard


Method Summary
 void addGadget(com.atlassian.gadgets.dashboard.DashboardState.ColumnIndex column, Gadget gadget)
          Add a gadget to the first position of the specified column
 void addGadget(Gadget gadget)
           
 void appendGadget(com.atlassian.gadgets.dashboard.DashboardState.ColumnIndex column, Gadget gadget)
          Add a gadget to the end of the specified column
 void appendGadget(Gadget gadget)
          Add a gadget to the default tab.
 void changeGadgetColor(com.atlassian.gadgets.GadgetId gadgetId, com.atlassian.gadgets.dashboard.Color color)
          Change the color of the gadgets chrome.
 void changeLayout(com.atlassian.gadgets.dashboard.Layout layout, com.atlassian.gadgets.dashboard.spi.GadgetLayout gadgetLayout)
          Change the layout of the dashboard and use the gadget layout to update the gadget positioning.
 void clearChanges()
          Clears the stored list of changes that have been made to this Dashboard
 Gadget findGadget(com.atlassian.gadgets.GadgetId gadgetId)
          Lookup a Gadget in this Dashboard given the gadget's id.
 List<com.atlassian.gadgets.dashboard.spi.changes.DashboardChange> getChanges()
          Returns an immutable list of changes that have been made to this Dashboard, in the order that they occurred.
 Iterable<Gadget> getGadgetsInColumn(com.atlassian.gadgets.dashboard.DashboardState.ColumnIndex column)
           
 com.atlassian.gadgets.dashboard.DashboardId getId()
           
 com.atlassian.gadgets.dashboard.Layout getLayout()
           
 int getNumberOfGadgets()
          Get the total number of gadgets on this dashboard
 com.atlassian.gadgets.dashboard.DashboardState getState()
           
 String getTitle()
           
 void rearrangeGadgets(com.atlassian.gadgets.dashboard.spi.GadgetLayout layout)
          Rearrange and reposition the gadgets on the dashboard according to the specified layout.
 void removeGadget(com.atlassian.gadgets.GadgetId gadgetId)
          Remove the gadget with the provided id from the dashboard.
 void updateGadgetUserPrefs(com.atlassian.gadgets.GadgetId gadgetId, Map<String,String> prefValues)
          Save user prefs for a gadget
 

Method Detail

getId

com.atlassian.gadgets.dashboard.DashboardId getId()

getTitle

String getTitle()

getLayout

com.atlassian.gadgets.dashboard.Layout getLayout()

getGadgetsInColumn

Iterable<Gadget> getGadgetsInColumn(com.atlassian.gadgets.dashboard.DashboardState.ColumnIndex column)

getState

com.atlassian.gadgets.dashboard.DashboardState getState()

findGadget

Gadget findGadget(com.atlassian.gadgets.GadgetId gadgetId)
Lookup a Gadget in this Dashboard given the gadget's id.

Parameters:
gadgetId - The gadgetId of the gadget to lookup
Returns:
The Gadget or null if none could be found matching the id

getChanges

List<com.atlassian.gadgets.dashboard.spi.changes.DashboardChange> getChanges()
Returns an immutable list of changes that have been made to this Dashboard, in the order that they occurred.

Returns:
immutable list of changes that have been made to this Dashboard

clearChanges

void clearChanges()
Clears the stored list of changes that have been made to this Dashboard


appendGadget

void appendGadget(Gadget gadget)
Add a gadget to the default tab. Let the dashboard pick which column it should go in.

Parameters:
gadget - the gadget being added

addGadget

void addGadget(Gadget gadget)

appendGadget

void appendGadget(com.atlassian.gadgets.dashboard.DashboardState.ColumnIndex column,
                  Gadget gadget)
Add a gadget to the end of the specified column

Parameters:
column - index of column to append the gadget to
gadget - the gadget being added

addGadget

void addGadget(com.atlassian.gadgets.dashboard.DashboardState.ColumnIndex column,
               Gadget gadget)
Add a gadget to the first position of the specified column

Parameters:
column - index of the column to add the gadget to
gadget - the gadget being added

getNumberOfGadgets

int getNumberOfGadgets()
Get the total number of gadgets on this dashboard

Returns:
the total number of gadgets on the dashboard

removeGadget

void removeGadget(com.atlassian.gadgets.GadgetId gadgetId)
Remove the gadget with the provided id from the dashboard.

Parameters:
gadgetId - id of the gadget to remove

rearrangeGadgets

void rearrangeGadgets(com.atlassian.gadgets.dashboard.spi.GadgetLayout layout)
                      throws GadgetLayoutException
Rearrange and reposition the gadgets on the dashboard according to the specified layout.

Parameters:
layout - Layout to match
Throws:
GadgetLayoutException - thrown if the layout is invalid

changeLayout

void changeLayout(com.atlassian.gadgets.dashboard.Layout layout,
                  com.atlassian.gadgets.dashboard.spi.GadgetLayout gadgetLayout)
                  throws GadgetLayoutException
Change the layout of the dashboard and use the gadget layout to update the gadget positioning.

Parameters:
layout - New layout to use for the dashboard
gadgetLayout - New positioning of the gadgets
Throws:
GadgetLayoutException - thrown if the positioning of the gadgets is not valid for the new layout - e.g. threre are gadgets in columns that don't exist in the new layout

changeGadgetColor

void changeGadgetColor(com.atlassian.gadgets.GadgetId gadgetId,
                       com.atlassian.gadgets.dashboard.Color color)
                       throws com.atlassian.gadgets.GadgetNotFoundException,
                              GadgetNotLoadedException
Change the color of the gadgets chrome.

Parameters:
gadgetId - Id of gadget to change the color of.
color - Color to change the chrome to
Throws:
com.atlassian.gadgets.GadgetNotFoundException - if the gadget could not be found by ID
GadgetNotLoadedException - if the gadget wasn't loaded

updateGadgetUserPrefs

void updateGadgetUserPrefs(com.atlassian.gadgets.GadgetId gadgetId,
                           Map<String,String> prefValues)
                           throws com.atlassian.gadgets.GadgetNotFoundException,
                                  GadgetNotLoadedException
Save user prefs for a gadget

Parameters:
gadgetId - Id of gadget to change the color of.
prefValues - preferences to save
Throws:
com.atlassian.gadgets.GadgetNotFoundException - if the gadget could not be found by ID
GadgetNotLoadedException - if the gadget wasn't loaded


Copyright © 2012 Atlassian. All Rights Reserved.