|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.gadgets.dashboard.internal.impl.DashboardImpl
public class DashboardImpl
Implements methods for operating on a backing DashboardState object.
| Constructor Summary | |
|---|---|
DashboardImpl(DashboardState state,
StateConverter stateConverter,
GadgetRequestContext gadgetRequestContext)
|
|
| Method Summary | |
|---|---|
void |
addGadget(DashboardState.ColumnIndex column,
Gadget gadget)
Add a gadget to the first position of the specified column |
void |
addGadget(Gadget gadget)
|
void |
appendGadget(DashboardState.ColumnIndex columnIndex,
Gadget gadget)
Add a gadget to the end of the specified column |
void |
appendGadget(Gadget gadget)
Add a gadget to the default tab. |
void |
assertGadgetLayoutIsValid(Layout layout,
GadgetLayout gadgetLayout)
Checks to make sure there are no gadgets in out of bounds columns. |
void |
changeGadgetColor(GadgetId gadgetId,
Color color)
Change the color of the gadgets chrome. |
void |
changeLayout(Layout layout,
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(GadgetId gadgetId)
Lookup a Gadget in this Dashboard given the gadget's id. |
List<DashboardChange> |
getChanges()
Returns an immutable list of changes that have been made to this Dashboard, in the order that they
occurred. |
Iterable<Gadget> |
getGadgetsInColumn(DashboardState.ColumnIndex column)
|
DashboardId |
getId()
|
Layout |
getLayout()
|
int |
getNumberOfGadgets()
Get the total number of gadgets on this dashboard |
DashboardState |
getState()
|
String |
getTitle()
|
void |
rearrangeGadgets(GadgetLayout gadgetLayout)
Rearrange and reposition the gadgets on the dashboard according to the specified layout. |
void |
removeGadget(GadgetId gadgetId)
Remove the gadget with the provided id from the dashboard. |
void |
updateGadgetUserPrefs(GadgetId gadgetId,
Map<String,String> prefValues)
Save user prefs for a gadget |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DashboardImpl(DashboardState state,
StateConverter stateConverter,
GadgetRequestContext gadgetRequestContext)
| Method Detail |
|---|
public DashboardId getId()
getId in interface Dashboardpublic String getTitle()
getTitle in interface Dashboardpublic Layout getLayout()
getLayout in interface Dashboardpublic Iterable<Gadget> getGadgetsInColumn(DashboardState.ColumnIndex column)
getGadgetsInColumn in interface Dashboardpublic void appendGadget(Gadget gadget)
Dashboard
appendGadget in interface Dashboardgadget - the gadget being added
public void appendGadget(DashboardState.ColumnIndex columnIndex,
Gadget gadget)
Dashboard
appendGadget in interface DashboardcolumnIndex - index of column to append the gadget togadget - the gadget being addedpublic void addGadget(Gadget gadget)
addGadget in interface Dashboard
public void addGadget(DashboardState.ColumnIndex column,
Gadget gadget)
Dashboard
addGadget in interface Dashboardcolumn - index of the column to add the gadget togadget - the gadget being added
public void changeLayout(Layout layout,
GadgetLayout gadgetLayout)
throws GadgetLayoutException
Dashboard
changeLayout in interface Dashboardlayout - New layout to use for the dashboardgadgetLayout - New positioning of the gadgets
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
public void rearrangeGadgets(GadgetLayout gadgetLayout)
throws GadgetLayoutException
Dashboard
rearrangeGadgets in interface DashboardgadgetLayout - Layout to match
GadgetLayoutException - thrown if the layout is invalid
public void changeGadgetColor(GadgetId gadgetId,
Color color)
Dashboard
changeGadgetColor in interface DashboardgadgetId - Id of gadget to change the color of.color - Color to change the chrome to
public void updateGadgetUserPrefs(GadgetId gadgetId,
Map<String,String> prefValues)
Dashboard
updateGadgetUserPrefs in interface DashboardgadgetId - Id of gadget to change the color of.prefValues - preferences to savepublic void removeGadget(GadgetId gadgetId)
Dashboard
removeGadget in interface DashboardgadgetId - id of the gadget to removepublic DashboardState getState()
getState in interface Dashboardpublic Gadget findGadget(GadgetId gadgetId)
Dashboard
findGadget in interface DashboardgadgetId - The gadgetId of the gadget to lookup
public List<DashboardChange> getChanges()
DashboardDashboard, in the order that they
occurred.
getChanges in interface DashboardDashboardpublic void clearChanges()
DashboardDashboard
clearChanges in interface Dashboardpublic int getNumberOfGadgets()
Dashboard
getNumberOfGadgets in interface Dashboard
public void assertGadgetLayoutIsValid(Layout layout,
GadgetLayout gadgetLayout)
throws GadgetLayoutException
layout - the layout to verify againstgadgetLayout - the gadget layout to verify
GadgetLayoutException - if the gadgetLayout contains more columns than this layout allows
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||