--- jsampler/trunk/src/org/jsampler/view/std/JSManageMidiMapsPane.java 2009/03/15 14:33:48 1865 +++ jsampler/trunk/src/org/jsampler/view/std/JSManageMidiMapsPane.java 2009/03/15 19:40:29 1866 @@ -40,6 +40,7 @@ import javax.swing.event.ListSelectionListener; import org.jsampler.CC; +import org.jsampler.HF; import org.jsampler.MidiInstrumentMap; import org.jsampler.view.MidiMapTable; @@ -86,6 +87,7 @@ midiMapTable.getActionMap().put("removeMidiMap", actionRemoveMap); } + @Override public void valueChanged(ListSelectionEvent e) { if(e.getValueIsAdjusting()) return; @@ -125,6 +127,7 @@ putValue(SHORT_DESCRIPTION, s); } + @Override public void actionPerformed(ActionEvent e) { addMidiInstrumentMap(); @@ -141,6 +144,7 @@ setEnabled(false); } + @Override public void actionPerformed(ActionEvent e) { editMidiInstrumentMap(midiMapTable.getSelectedMidiInstrumentMap()); @@ -157,9 +161,15 @@ setEnabled(false); } + @Override public void actionPerformed(ActionEvent e) { MidiInstrumentMap map = midiMapTable.getSelectedMidiInstrumentMap(); + if(map.getAllMidiInstruments().length > 0) { + String s = i18n.getMessage("JSManageMidiMapsPane.removeMap", map.getName()); + String s2 = i18n.getMessage("JSManageMidiMapsPane.removeMap?"); + if(!HF.showYesNoDialog(JSManageMidiMapsPane.this, s2, s)) return; + } CC.getSamplerModel().removeBackendMidiInstrumentMap(map.getMapId()); } }