diff options
author | Yana Stamcheva <yana@jitsi.org> | 2010-09-27 16:02:12 +0000 |
---|---|---|
committer | Yana Stamcheva <yana@jitsi.org> | 2010-09-27 16:02:12 +0000 |
commit | a4ddb0361ebc3848e30eefbf0391c755adb3387c (patch) | |
tree | bce7c351a63766840af4534e9bc5ecbd0c8ac429 /src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListCellRenderer.java | |
parent | 8f7582b1785d9c40ecb306a6d4ed0a6cafc66be4 (diff) | |
download | jitsi-a4ddb0361ebc3848e30eefbf0391c755adb3387c.zip jitsi-a4ddb0361ebc3848e30eefbf0391c755adb3387c.tar.gz jitsi-a4ddb0361ebc3848e30eefbf0391c755adb3387c.tar.bz2 |
Patch provided by Adam Netocny making all contact list classes skinnable.
Diffstat (limited to 'src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListCellRenderer.java')
-rw-r--r-- | src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListCellRenderer.java | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListCellRenderer.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListCellRenderer.java index 8ec1d54..37d10a6 100644 --- a/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListCellRenderer.java +++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListCellRenderer.java @@ -16,6 +16,7 @@ import net.java.sip.communicator.impl.gui.utils.*; import net.java.sip.communicator.service.contactlist.*; import net.java.sip.communicator.service.protocol.*; import net.java.sip.communicator.util.*; +import net.java.sip.communicator.util.skin.*; import net.java.sip.communicator.util.swing.*; /** @@ -26,11 +27,13 @@ import net.java.sip.communicator.util.swing.*; * * @author Yana Stamcheva * @author Lubomir Marinov + * @author Adam Netocny */ public class ContactListCellRenderer extends JPanel implements ListCellRenderer, - Icon + Icon, + Skinnable { /** * The avatar icon height. @@ -52,13 +55,13 @@ public class ContactListCellRenderer /** * The icon indicating an open group. */ - private final ImageIcon openedGroupIcon = + private ImageIcon openedGroupIcon = new ImageIcon(ImageLoader.getImage(ImageLoader.DOWN_ARROW_ICON)); /** * The icon indicating a closed group. */ - private final ImageIcon closedGroupIcon = + private ImageIcon closedGroupIcon = new ImageIcon(ImageLoader.getImage(ImageLoader.RIGHT_ARROW_ICON)); /** @@ -470,4 +473,28 @@ public class ContactListCellRenderer g.dispose(); } } + + /** + * Reloads skin information for this render class. + */ + public void loadSkin() + { + openedGroupIcon + = new ImageIcon(ImageLoader.getImage(ImageLoader.DOWN_ARROW_ICON)); + + closedGroupIcon + = new ImageIcon(ImageLoader.getImage(ImageLoader.RIGHT_ARROW_ICON)); + + int groupForegroundProperty = GuiActivator.getResources() + .getColor("service.gui.CONTACT_LIST_GROUP_FOREGROUND"); + + if (groupForegroundProperty > -1) + groupForegroundColor = new Color (groupForegroundProperty); + + int contactForegroundProperty = GuiActivator.getResources() + .getColor("service.gui.CONTACT_LIST_CONTACT_FOREGROUND"); + + if (contactForegroundProperty > -1) + contactForegroundColor = new Color(contactForegroundProperty); + } } |