|
||||||||||
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(com.atlassian.gadgets.dashboard.DashboardState state,
StateConverter stateConverter,
com.atlassian.gadgets.GadgetRequestContext gadgetRequestContext)
|
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 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(com.atlassian.gadgets.dashboard.Layout layout,
com.atlassian.gadgets.dashboard.spi.GadgetLayout gadgetLayout)
Checks to make sure there are no gadgets in out of bounds columns. |
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 gadgetLayout)
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DashboardImpl(com.atlassian.gadgets.dashboard.DashboardState state, StateConverter stateConverter, com.atlassian.gadgets.GadgetRequestContext gadgetRequestContext)
Method Detail |
---|
public com.atlassian.gadgets.dashboard.DashboardId getId()
getId
in interface Dashboard
public String getTitle()
getTitle
in interface Dashboard
public com.atlassian.gadgets.dashboard.Layout getLayout()
getLayout
in interface Dashboard
public Iterable<Gadget> getGadgetsInColumn(com.atlassian.gadgets.dashboard.DashboardState.ColumnIndex column)
getGadgetsInColumn
in interface Dashboard
public void appendGadget(Gadget gadget)
Dashboard
appendGadget
in interface Dashboard
gadget
- the gadget being addedpublic void appendGadget(com.atlassian.gadgets.dashboard.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(com.atlassian.gadgets.dashboard.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(com.atlassian.gadgets.dashboard.Layout layout, com.atlassian.gadgets.dashboard.spi.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(com.atlassian.gadgets.dashboard.spi.GadgetLayout gadgetLayout) throws GadgetLayoutException
Dashboard
rearrangeGadgets
in interface Dashboard
gadgetLayout
- Layout to match
GadgetLayoutException
- thrown if the layout is invalidpublic void changeGadgetColor(com.atlassian.gadgets.GadgetId gadgetId, com.atlassian.gadgets.dashboard.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(com.atlassian.gadgets.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(com.atlassian.gadgets.GadgetId gadgetId)
Dashboard
removeGadget
in interface Dashboard
gadgetId
- id of the gadget to removepublic com.atlassian.gadgets.dashboard.DashboardState getState()
getState
in interface Dashboard
public Gadget findGadget(com.atlassian.gadgets.GadgetId gadgetId)
Dashboard
findGadget
in interface Dashboard
gadgetId
- The gadgetId of the gadget to lookup
public List<com.atlassian.gadgets.dashboard.spi.changes.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(com.atlassian.gadgets.dashboard.Layout layout, com.atlassian.gadgets.dashboard.spi.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 |