/** Callback for the tree selection event. */
public void valueChanged(TreeSelectionEvent e) {
if (reinit)
return;
DefaultMutableTreeNode node = (DefaultMutableTreeNode) (e.getPath()
.getLastPathComponent());
boolean bHasChange = settingPanel.applyChanges(true);
// construct the sections
if ((settingPanel instanceof LanguageSettingsPanel) && bHasChange) {
reinit = true;
rootNode.removeAllChildren();
treeModel.setRoot(rootNode);
treeModel.reload();
constructSections();
reinit = false;
}
// - remove the settingPanel
mainPanel2.remove(0);
Box vb = Box.createVerticalBox();
Object userObject = node.getUserObject();
if (userObject instanceof OptionPageProvider) {
settingPanel = new OptionPageProviderPanel((OptionPageProvider) userObject, getProject(), getUIFacade());
}
else {
// - ask the settingPanel if parameters are changed
// - Create the new panel
String sNode = (String) (node.getUserObject());
if (sNode.equals(language.getText("languages")))
settingPanel = new LanguageSettingsPanel(appli);
else if (sNode.equals(GanttProject.correctLabel(language
.getText("project"))))