|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.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 Dashboard
public String getTitle()
getTitle
in interface Dashboard
public Layout getLayout()
getLayout
in interface Dashboard
public Iterable<Gadget> getGadgetsInColumn(DashboardState.ColumnIndex column)
getGadgetsInColumn
in interface Dashboard
public void appendGadget(Gadget gadget)
Dashboard
appendGadget
in interface Dashboard
gadget
- the gadget being addedpublic void appendGadget(DashboardState.ColumnIndex columnIndex, Gadget gadget)
Dashboard
appendGadget
in interface Dashboard
columnIndex
- 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 Dashboard
column
- index of the column to add the gadget togadget
- the gadget being addedpublic void changeLayout(Layout layout, GadgetLayout gadgetLayout) throws GadgetLayoutException
Dashboard
changeLayout
in interface Dashboard
layout
- 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 layoutpublic void rearrangeGadgets(GadgetLayout gadgetLayout) throws GadgetLayoutException
Dashboard
rearrangeGadgets
in interface Dashboard
gadgetLayout
- Layout to match
GadgetLayoutException
- thrown if the layout is invalidpublic void changeGadgetColor(GadgetId gadgetId, Color color)
Dashboard
changeGadgetColor
in interface Dashboard
gadgetId
- Id of gadget to change the color of.color
- Color to change the chrome topublic void updateGadgetUserPrefs(GadgetId gadgetId, Map<String,String> prefValues)
Dashboard
updateGadgetUserPrefs
in interface Dashboard
gadgetId
- Id of gadget to change the color of.prefValues
- preferences to savepublic void removeGadget(GadgetId gadgetId)
Dashboard
removeGadget
in interface Dashboard
gadgetId
- id of the gadget to removepublic DashboardState getState()
getState
in interface Dashboard
public Gadget findGadget(GadgetId gadgetId)
Dashboard
findGadget
in interface Dashboard
gadgetId
- The gadgetId of the gadget to lookup
public List<DashboardChange> getChanges()
Dashboard
Dashboard
, in the order that they
occurred.
getChanges
in interface Dashboard
Dashboard
public void clearChanges()
Dashboard
Dashboard
clearChanges
in interface Dashboard
public 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 |