drawer.getCurrEnv().getPojo().setName(input.trim());
setMapTitle(drawer.getCurrEnv().getPojo().getName());
}//GEN-LAST:event_mnuRenameEnvironmentActionPerformed
private void mnuDeleteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuDeleteActionPerformed
EnvironmentLogic oldenv = drawer.getCurrEnv();
JLabel confirmLbl = new JLabel(I18n.msg("confirm_env_delete"));
JLabel selectLbl = new JLabel(I18n.msg("select_env_to_reassing_objects"));
ArrayList<Object> possibilities = new ArrayList<Object>();
possibilities.add(I18n.msg("delete_envobj_alongside_environment"));
possibilities.addAll(EnvironmentPersistence.getEnvironments());
possibilities.remove(oldenv);
JComboBox envCombo = new JComboBox(possibilities.toArray());
int result = JOptionPane.showConfirmDialog(null,
new Object[]{confirmLbl,selectLbl,envCombo},
I18n.msg("confirm_deletion_title"),
JOptionPane.OK_CANCEL_OPTION
);
if (result == JOptionPane.OK_OPTION) {
if (envCombo.getSelectedItem() instanceof EnvironmentLogic) {
// assign objects to new environment
EnvironmentLogic env = (EnvironmentLogic) envCombo.getSelectedItem();
for (EnvObjectLogic obj : EnvObjectPersistence.getObjectByEnvironment(oldenv.getPojo().getUUID())) {
obj.setEnvironment(env);
}
setEnvironment(env);
} else {