com.atlassian.jira.pageobjects.gadgets
Class GadgetContainer

java.lang.Object
  extended by com.atlassian.jira.pageobjects.gadgets.GadgetContainer

public class GadgetContainer
extends Object

The container of gadgets on the dashboard page

Since:
v5.1
See Also:
DashboardPage

Field Summary
protected  com.atlassian.pageobjects.elements.PageElement addDialogLink
           
protected  com.atlassian.pageobjects.elements.PageElement dashboard
           
protected  com.atlassian.pageobjects.PageBinder pageBinder
           
 
Constructor Summary
GadgetContainer()
           
 
Method Summary
 boolean canAddGadget()
           
<G extends it.com.atlassian.gadgets.pages.Gadget>
G
get(Class<G> gadgetClass, String gadgetId)
          Equivalent to getGadget(Class, String).
 it.com.atlassian.gadgets.pages.Gadget get(String gadgetId)
          Equivalent to getGadget(String).
<G extends it.com.atlassian.gadgets.pages.Gadget>
G
getByTitle(Class<G> gadgetClass, String gadgetTitle)
          Equivalent to getGadgetByTitle(Class, String).
 it.com.atlassian.gadgets.pages.Gadget getByTitle(String gadgetTitle)
          Equivalent to getGadgetByTitle(String)}.
 it.com.atlassian.gadgets.pages.DashboardToolsMenu getDashboardTools()
           
<G extends it.com.atlassian.gadgets.pages.Gadget>
G
getGadget(Class<G> gadgetClass, String gadgetId)
           
 it.com.atlassian.gadgets.pages.Gadget getGadget(String gadgetId)
           
<G extends it.com.atlassian.gadgets.pages.Gadget>
G
getGadgetByTitle(Class<G> gadgetClass, String gadgetTitle)
          Get gadget of given type by it's title as visible on the dashboard.
 it.com.atlassian.gadgets.pages.Gadget getGadgetByTitle(String gadgetTitle)
          Get gadget by it's title as visible on the dashboard.
 LoginGadget getLoginGadget()
          Login gadget is always on the Dashboard if not logged in.
protected  com.atlassian.pageobjects.elements.PageElement getTabContainer()
           
protected  List<com.atlassian.pageobjects.elements.PageElement> getTabContainers()
           
 boolean hasGaddget(String gadgetId)
           
 boolean hasTabs()
           
 it.com.atlassian.gadgets.pages.AddGadgetDialog openAddGadgetDialog()
           
 it.com.atlassian.gadgets.pages.DashboardToolsMenu openDashboardTools()
           
 DashboardPage switchDashboard(String dashboardName)
          Switches dashboard using the side tabs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pageBinder

@Inject
protected com.atlassian.pageobjects.PageBinder pageBinder

addDialogLink

protected com.atlassian.pageobjects.elements.PageElement addDialogLink

dashboard

protected com.atlassian.pageobjects.elements.PageElement dashboard
Constructor Detail

GadgetContainer

public GadgetContainer()
Method Detail

getTabContainer

protected com.atlassian.pageobjects.elements.PageElement getTabContainer()

getTabContainers

protected List<com.atlassian.pageobjects.elements.PageElement> getTabContainers()

hasTabs

public boolean hasTabs()

canAddGadget

public boolean canAddGadget()

openAddGadgetDialog

public it.com.atlassian.gadgets.pages.AddGadgetDialog openAddGadgetDialog()

getLoginGadget

public LoginGadget getLoginGadget()
Login gadget is always on the Dashboard if not logged in.

Returns:
Login gadget
Throws:
IllegalStateException - if an user is logged in

hasGaddget

public boolean hasGaddget(String gadgetId)

getGadget

public it.com.atlassian.gadgets.pages.Gadget getGadget(String gadgetId)

getGadget

public <G extends it.com.atlassian.gadgets.pages.Gadget> G getGadget(Class<G> gadgetClass,
                                                                     String gadgetId)

get

public it.com.atlassian.gadgets.pages.Gadget get(String gadgetId)
Equivalent to getGadget(String).

Parameters:
gadgetId - gadget ID
Returns:
gadget corresponding to the ID.

get

public <G extends it.com.atlassian.gadgets.pages.Gadget> G get(Class<G> gadgetClass,
                                                               String gadgetId)
Equivalent to getGadget(Class, String).

Parameters:
gadgetId - gadget ID
gadgetClass - expected gadget type
Returns:
gadget corresponding to the ID.

getGadgetByTitle

public it.com.atlassian.gadgets.pages.Gadget getGadgetByTitle(String gadgetTitle)
Get gadget by it's title as visible on the dashboard.

Parameters:
gadgetTitle - title of the gadget
Returns:
gadget
Throws:
IllegalArgumentException - if gadget with given title does not exist

getGadgetByTitle

public <G extends it.com.atlassian.gadgets.pages.Gadget> G getGadgetByTitle(Class<G> gadgetClass,
                                                                            String gadgetTitle)
Get gadget of given type by it's title as visible on the dashboard.

Parameters:
gadgetClass - expected gadget type
gadgetTitle - title of the gadget
Returns:
gadget of given type with given title
Throws:
IllegalArgumentException - if gadget with given title does not exist

getByTitle

public it.com.atlassian.gadgets.pages.Gadget getByTitle(String gadgetTitle)
Equivalent to getGadgetByTitle(String)}.

Parameters:
gadgetTitle - title of the gadget
Returns:
gadget with given title.
Throws:
IllegalArgumentException - if gadget with given title does not exist

getByTitle

public <G extends it.com.atlassian.gadgets.pages.Gadget> G getByTitle(Class<G> gadgetClass,
                                                                      String gadgetTitle)
Equivalent to getGadgetByTitle(Class, String).

Parameters:
gadgetClass - expected gadget type
gadgetTitle - gadget title
Returns:
gadget with given title.

getDashboardTools

public it.com.atlassian.gadgets.pages.DashboardToolsMenu getDashboardTools()

openDashboardTools

public it.com.atlassian.gadgets.pages.DashboardToolsMenu openDashboardTools()

switchDashboard

public DashboardPage switchDashboard(String dashboardName)
Switches dashboard using the side tabs. This will only work if hasTabs() returns true.

Parameters:
dashboardName - name of the dashboard to switch to
Returns:
this dashboard page instance
Throws:
IllegalStateException - if there is no tabs (e.g. user not logged in or there is only one dashboard configured for the user), or there is no dashboard with given name


Copyright © 2002-2012 Atlassian. All Rights Reserved.