|
||||||||||
| 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(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 Dashboardpublic String getTitle()
getTitle in interface Dashboardpublic com.atlassian.gadgets.dashboard.Layout getLayout()
getLayout in interface Dashboardpublic Iterable<Gadget> getGadgetsInColumn(com.atlassian.gadgets.dashboard.DashboardState.ColumnIndex column)
getGadgetsInColumn in interface Dashboardpublic void appendGadget(Gadget gadget)
Dashboard
appendGadget in interface Dashboardgadget - the gadget being added
public void appendGadget(com.atlassian.gadgets.dashboard.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(com.atlassian.gadgets.dashboard.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(com.atlassian.gadgets.dashboard.Layout layout,
com.atlassian.gadgets.dashboard.spi.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(com.atlassian.gadgets.dashboard.spi.GadgetLayout gadgetLayout)
throws GadgetLayoutException
Dashboard
rearrangeGadgets in interface DashboardgadgetLayout - Layout to match
GadgetLayoutException - thrown if the layout is invalid
public void changeGadgetColor(com.atlassian.gadgets.GadgetId gadgetId,
com.atlassian.gadgets.dashboard.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(com.atlassian.gadgets.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(com.atlassian.gadgets.GadgetId gadgetId)
Dashboard
removeGadget in interface DashboardgadgetId - id of the gadget to removepublic com.atlassian.gadgets.dashboard.DashboardState getState()
getState in interface Dashboardpublic Gadget findGadget(com.atlassian.gadgets.GadgetId gadgetId)
Dashboard
findGadget in interface DashboardgadgetId - The gadgetId of the gadget to lookup
public List<com.atlassian.gadgets.dashboard.spi.changes.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(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 | |||||||||