|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface StaticTableStyleInterface
Defines an interface for accessing a table's styles. This will usually be implemented in tandem with the primary interface to tables, StaticTableInterface.
A style is a set of property keys (Strings) with associated values (Objects) that are used as formatting defaults and rendering hints by a view.
A table can have default styles, or styles associated with individual
elements -- cells, columns, rows, and labels -- or both. If there is no
style available for a particular element or category of elements,
null
may be returned for any of the get-methods.
Consumers of this interface (e.g. views) should listen for PropertyBagChangedEvents from the default styles. However, if the styles associated with individual elements change or if a default style is replaced, it is the implementation's responsibility to notify a consumer via an appropriate changed event. Use PropertyChangeEvent for default style replacements, and the appropriate TableElementChangedEvent subclass for styles associated with individual elements. It might seem as though consumers could also listen to changes from the non-default styles. Well they could, but it could be very inefficient if there were lots of them, in addition to being difficult to manage if the same style was used with multiple elements as the consumer would not readily know they were shared. The difficulty here is best explained via example: first, the consumer queries the style associated with row one and registers itself as a listener; then it does the same with row two; then when row one is scrolled out of view, it releases resources associated with row one which includes removing itself as a listener to row one's style; however, if row one and row two were sharing a style, this would inadvertently remove the consumer as a listener of row two. Thus, it's best if the model implementation which presumably knows these relationships generates the changed events for such styles. The consumer can handle listening to the default styles directly since there is a fixed number of them.
StaticTableTypeStylesInterface
,
CellStyle
,
ColumnStyle
,
RowStyle
Method Summary | |
---|---|
com.sas.collection.StaticPropertyBagInterface |
getCellStyle(int rowIndex,
int colIndex)
Returns the style for a given cell. |
com.sas.collection.StaticPropertyBagInterface |
getColumnLabelStyle(int colIndex)
Returns the style for a given column's label. |
com.sas.collection.StaticPropertyBagInterface |
getColumnStyle(int colIndex)
Returns the style for a given column. |
com.sas.collection.StaticPropertyBagInterface |
getDefaultCellStyle()
Returns the default style for all cells. |
com.sas.collection.StaticPropertyBagInterface |
getDefaultColumnStyle()
Returns the default style for all columns. |
com.sas.collection.StaticPropertyBagInterface |
getDefaultLabelStyle()
Returns the default style for all labels. |
com.sas.collection.StaticPropertyBagInterface |
getDefaultRowStyle()
Returns the default style for all rows. |
com.sas.collection.StaticPropertyBagInterface |
getRowLabelStyle(int rowIndex)
Returns the style for a given row's label. |
com.sas.collection.StaticPropertyBagInterface |
getRowStyle(int rowIndex)
Returns the style for a given row. |
boolean |
isCellStylesSupported()
Returns whether styles are available for individual cells. |
boolean |
isColumnLabelStylesSupported()
Returns whether styles are available for individual column labels. |
boolean |
isColumnStylesSupported()
Returns whether styles are available for individual columns. |
boolean |
isRowLabelStylesSupported()
Returns whether styles are available for individual row labels. |
boolean |
isRowStylesSupported()
Returns whether styles are available for individual rows. |
Method Detail |
---|
com.sas.collection.StaticPropertyBagInterface getDefaultCellStyle() throws com.sas.table.TableException
null
.
TableException
- Thrown if the query can not be satisfied (e.g. i/o-failure).com.sas.collection.StaticPropertyBagInterface getDefaultColumnStyle() throws com.sas.table.TableException
null
.
TableException
- Thrown if the query can not be satisfied (e.g. i/o-failure).com.sas.collection.StaticPropertyBagInterface getDefaultLabelStyle() throws com.sas.table.TableException
null
.
TableException
- Thrown if the query can not be satisfied (e.g. i/o-failure).com.sas.collection.StaticPropertyBagInterface getDefaultRowStyle() throws com.sas.table.TableException
null
.
TableException
- Thrown if the query can not be satisfied (e.g. i/o-failure).com.sas.collection.StaticPropertyBagInterface getCellStyle(int rowIndex, int colIndex) throws com.sas.table.TableException
false
.
rowIndex
- A one-based index that identifies the cell's row.colIndex
- A one-based index that identifies the cell's column.
null
.
TableException
- Thrown if the query can not be satisfied (e.g. i/o-failure).isCellStylesSupported()
com.sas.collection.StaticPropertyBagInterface getColumnStyle(int colIndex) throws com.sas.table.TableException
false
.
colIndex
- A one-based index that identifies the column.
null
.
TableException
- Thrown if the query can not be satisfied (e.g. i/o-failure).isColumnStylesSupported()
com.sas.collection.StaticPropertyBagInterface getColumnLabelStyle(int colIndex) throws com.sas.table.TableException
false
.
colIndex
- A one-based index that identifies the column.
null
.
TableException
- Thrown if the query can not be satisfied (e.g. i/o-failure).isColumnLabelStylesSupported()
com.sas.collection.StaticPropertyBagInterface getRowStyle(int rowIndex) throws com.sas.table.TableException
false
.
rowIndex
- A one-based index that identifies the row.
null
.
TableException
- Thrown if the query can not be satisfied (e.g. i/o-failure).isRowStylesSupported()
com.sas.collection.StaticPropertyBagInterface getRowLabelStyle(int rowIndex) throws com.sas.table.TableException
false
.
rowIndex
- A one-based index that identifies the row.
null
.
TableException
- Thrown if the query can not be satisfied (e.g. i/o-failure).isRowLabelStylesSupported()
boolean isCellStylesSupported() throws com.sas.table.TableException
true
if getCellStyle() should be called for each cell,
and false
otherwise.
TableException
- Thrown if the query can not be satisfied (e.g. i/o-failure).getCellStyle(int, int)
boolean isColumnStylesSupported() throws com.sas.table.TableException
true
if getColumnStyle() should be called for each column,
and false
otherwise.
TableException
- Thrown if the query can not be satisfied (e.g. i/o-failure).getColumnStyle(int)
boolean isColumnLabelStylesSupported() throws com.sas.table.TableException
true
if getColumnLabelStyle() should be called for each column label,
and false
otherwise.
TableException
- Thrown if the query can not be satisfied (e.g. i/o-failure).getColumnLabelStyle(int)
boolean isRowStylesSupported() throws com.sas.table.TableException
true
if getRowStyle() should be called for each row,
and false
otherwise.
TableException
- Thrown if the query can not be satisfied (e.g. i/o-failure).getRowStyle(int)
boolean isRowLabelStylesSupported() throws com.sas.table.TableException
true
if getRowLabelStyle() should be called for each row label,
and false
otherwise.
TableException
- Thrown if the query can not be satisfied (e.g. i/o-failure).getRowLabelStyle(int)
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |