DefaultMutableTreeNode node = container.getTreePanel().getSelectedNode();
if (node != null && node.isLeaf()) {
Object selectedObject = node.getUserObject();
if(selectedObject instanceof PluginDataModel){
PluginDataModel selectedPlug = (PluginDataModel)selectedObject;
AbstractPlugablePanel panel = container.getPluginsMap().get(selectedPlug);
statusPanel.setText(selectedPlug.getName());
statusPanel.setIcon(panel.getIcon());
CardLayout cl = (CardLayout)(plugsPanel.getLayout());
cl.show(plugsPanel, selectedPlug.getName());
container.setFocusTraversalPolicy(panel.getFocusPolicy());
container.setMainPanelPreferredSize(panel.getPreferredSize());
}
}
}