powered by Jive Software

Spark. How to customize VCardPanel?

ChatRoomImpl has private field VCardPanel, which displays detailed information about contact.

Is there any way to customize it? Or replace It by my own panel from plugin?

Currently the only way to add details to VCardPanel is iterate through all the components placed in ChatToolBar:

for (Component comp : chatRoom.getToolBar().getComponents()) {
     if (comp instanceof VCardPanel) {
            // here we can do some changes to VCardPanel       }
}

But VCardPanel have only private metods. I can’t modify it from plugin, and I can’t extend it without full rewrite.

It only can be modified as regular JPanel by adding new components.

Another way is remove VCardPanel from ChatToolBar and add own JPanel on it’s place.

So there is need simple way to get VCardPanel from ChatToolBar, and a way to customize VCardPanel without hacks and writing duplicated code