// valueChanged() - when the value gets changed
////////////////////////////////////////////////////////////////////////
public void valueChanged(ListSelectionEvent e)
{
//get the selected value here
ComposerLabel lbl = (ComposerLabel)mComposerList.getSelectedValue();
//set the description
mDescriptionLbl.setText(lbl.getDescription());
//remove all the old settings first
mSettingsWrapper.removeAll();
//get the settings panel
ComposerSettingsPanel settingsPanel = lbl.getSettingsPanel();
//try to do all this here
try
{
//make the settings label visible
mSettingsLbl.setVisible(true);
//add this new panel
mSettingsWrapper.add(settingsPanel);
//give this panel a size
settingsPanel.setSize(500, 300);
//if we don't have any components, get rid
//of the settings label, so the user does
//not think they made a mistake
if(settingsPanel.getComponentCount() == 0)
{
mSettingsLbl.setVisible(false);
}
}
catch(Exception ex)
{
System.out.println("\n\n\nBUMMER!\n\n\n");
ex.printStackTrace();
GUIUtils.ShowDialog(ex, lbl.getName() + " does not have a settings panel", GUIUtils.MESSAGE, mMainScreen);
}
//do all our repainting here
mSettingsWrapper.validate();
mSettingsWrapper.invalidate();