// Check to see whether we have already created
// the IconData for this background color
Skin skin = context.getSkin();
IconData icons = (IconData)skin.getProperty(_ICONS_KEY);
Icon bottomStart = context.getIcon(
AF_PANEL_SIDE_BAR_BOTTOM_START_ICON_NAME);
if (icons == null || bottomStart == null ||
(!icons.bottomStart.equals(bottomStart)))
{
// If we haven't created the IconData yet, create it now
// OR if the ones we created are not the ones we need to create
// (this can happen if sidebar is used in a composite component.)
// we then cache it away as an optimization.
Icon bottomEnd = context.getIcon(
AF_PANEL_SIDE_BAR_BOTTOM_END_ICON_NAME);
Icon bottomBackground = context.getIcon(
AF_PANEL_SIDE_BAR_BOTTOM_BACKGROUND_ICON_NAME);
Icon topStart = context.getIcon(
AF_PANEL_SIDE_BAR_TOP_START_ICON_NAME);
Icon topEnd = context.getIcon(
AF_PANEL_SIDE_BAR_TOP_END_ICON_NAME);
Icon topBackground = context.getIcon(
AF_PANEL_SIDE_BAR_TOP_BACKGROUND_ICON_NAME);
Icon startBackground = context.getIcon(
AF_PANEL_SIDE_BAR_START_BACKGROUND_ICON_NAME);
Icon endBackground = context.getIcon(
AF_PANEL_SIDE_BAR_END_BACKGROUND_ICON_NAME);
icons = new IconData(bottomStart,
bottomEnd,
bottomBackground,