com.atlassian.gadgets.dashboard
Enum Layout

java.lang.Object
  extended by java.lang.Enum<Layout>
      extended by com.atlassian.gadgets.dashboard.Layout
All Implemented Interfaces:
Serializable, Comparable<Layout>

public enum Layout
extends Enum<Layout>

Dashboards can be laid out in multiple ways: with a single column (A), with two columns of equal size (AA), with two columns where one is smaller and the other is larger (AB), etc. A larger column is said to be "greedy" because it takes up more room than any of the other columns in the tab. A normal column is said to be "fair" because it tries to share space equally with the other tabs.


Enum Constant Summary
A
          single column
AA
          two columns of equal size
AAA
          three columns, each of equal size
AB
          two columns, the first being smaller than the second
ABA
          three columns, the first and third are of equal size with the second column larger than the others
BA
          two columns, the first being larger than the second
 
Method Summary
 boolean contains(DashboardState.ColumnIndex column)
          Checks if the column exists in this layout.
 Iterable<DashboardState.ColumnIndex> getColumnRange()
          Return an immutable Iterable over the ColumnIndexes that exist in this layout.
 int getNumberOfColumns()
          Returns the number of columns in this layout.
 boolean isColumnSizingFair(DashboardState.ColumnIndex column)
          Checks if the column shares the space with the other columns on the screen equally or if it is greedy and should take up more space.
static Layout valueOf(String name)
          Returns the enum constant of this type with the specified name.
static Layout[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

A

public static final Layout A
single column


AA

public static final Layout AA
two columns of equal size


AB

public static final Layout AB
two columns, the first being smaller than the second


BA

public static final Layout BA
two columns, the first being larger than the second


AAA

public static final Layout AAA
three columns, each of equal size


ABA

public static final Layout ABA
three columns, the first and third are of equal size with the second column larger than the others

Method Detail

values

public static Layout[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (Layout c : Layout.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static Layout valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getNumberOfColumns

public int getNumberOfColumns()
Returns the number of columns in this layout.

Returns:
the number of columns in this layout

contains

public boolean contains(DashboardState.ColumnIndex column)
Checks if the column exists in this layout.

Parameters:
column - Column to check exists in this layout
Returns:
true if the column exists in this layout, false otherwise

getColumnRange

public Iterable<DashboardState.ColumnIndex> getColumnRange()
Return an immutable Iterable over the ColumnIndexes that exist in this layout.

Returns:
an immutable Iterable over the ColumnIndexes that exist in this layout.

isColumnSizingFair

public boolean isColumnSizingFair(DashboardState.ColumnIndex column)
Checks if the column shares the space with the other columns on the screen equally or if it is greedy and should take up more space.

Parameters:
column - column index to check for sizing fairness
Returns:
whether the column tries to share space equally and fairly with other columns
Throws:
IllegalArgumentException - thrown if the column is not contained in this layout


Copyright © 2011 Atlassian. All Rights Reserved.