# This patch file was generated by NetBeans IDE # Following Index: paths are relative to: /home/matthias/NetBeansProjects/core-main # This patch can be applied using context Tools: Patch action on respective folder. # It uses platform neutral UTF-8 encoding and \n newlines. # Above lines and this line are ignored by the patching process. Index: db/src/org/netbeans/modules/db/explorer/dlg/AddIndexDialog.java --- db/src/org/netbeans/modules/db/explorer/dlg/AddIndexDialog.java Base (BASE) +++ db/src/org/netbeans/modules/db/explorer/dlg/AddIndexDialog.java Locally Modified (Based On LOCAL) @@ -65,6 +65,7 @@ public class AddIndexDialog { boolean result = false; Dialog dialog = null; + DialogDescriptor descriptor; JTextField namefld; CheckBoxListener cbxlistener; JCheckBox cbx_uq; @@ -208,7 +209,9 @@ } }; - DialogDescriptor descriptor = new DialogDescriptor(pane, NbBundle.getMessage (AddIndexDialog.class, "AddIndexTitle"), true, listener); //NOI18N + descriptor = new DialogDescriptor(pane, NbBundle.getMessage (AddIndexDialog.class, "AddIndexTitle"), true, listener); //NOI18N + // Initally no column is checked => an index can't be created + descriptor.setValid(false); // inbuilt close of the dialog is only after CANCEL button click // after OK button is dialog closed by hand Object [] closingOptions = {DialogDescriptor.CANCEL_OPTION}; @@ -257,7 +260,13 @@ String name = cbx.getName(); if (cbx.isSelected()) set.add(name); else set.remove(name); + // Only allow creation of index if at least one column is selected + if(set.size() > 0) { + descriptor.setValid(true); + } else { + descriptor.setValid(false); } + } public Set getSelectedColumns() {