Fix the problem where the PresetModel drop down was not closing when the ComponentPresetChooserDialog is opened.
This commit is contained in:
parent
f92034db56
commit
ef8499e6a8
@ -65,14 +65,18 @@ public class PresetModel extends AbstractListModel implements ComboBoxModel, Com
|
||||
} else if (item.equals(NONE_SELECTED)) {
|
||||
component.clearPreset();
|
||||
} else if (item.equals(SELECT_DATABASE)) {
|
||||
// FIXME - when the dialog first appears, the preset drop down still is open and has focus.
|
||||
// we need to force focus to the new dialog.
|
||||
SwingUtilities.invokeLater( new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
ComponentPresetChooserDialog dialog =
|
||||
new ComponentPresetChooserDialog( SwingUtilities.getWindowAncestor(PresetModel.this.parent),
|
||||
PresetModel.this.component);
|
||||
dialog.setVisible(true);
|
||||
ComponentPreset preset = dialog.getSelectedComponentPreset();
|
||||
setSelectedItem(preset);
|
||||
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// FIXME: Add undo point here
|
||||
component.loadPreset((ComponentPreset) item);
|
||||
|
Loading…
x
Reference in New Issue
Block a user