This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 204552
Collapse All | Expand All

(-)nb-trunk/db.core//src/org/netbeans/modules/db/sql/execute/ui/Bundle.properties (+6 lines)
Lines 71-82 Link Here
71
ACSD_Match=Matching SQL matchbox
71
ACSD_Match=Matching SQL matchbox
72
ACSD_Save=Limit the number of SQL statements to save
72
ACSD_Save=Limit the number of SQL statements to save
73
ACSD_Insert=Insert SQL statement in the SQL editor
73
ACSD_Insert=Insert SQL statement in the SQL editor
74
ACSD_Delete=Delete SQL statement from history
74
ACSD_Apply=Save SQL limit to preferences
75
ACSD_Apply=Save SQL limit to preferences
75
76
76
ASCN_ConnectionCombo=Connections Used Combo box 
77
ASCN_ConnectionCombo=Connections Used Combo box 
77
ACSN_Match=Matching SQL matchbox
78
ACSN_Match=Matching SQL matchbox
78
ACSN_Save=SQL limit field
79
ACSN_Save=SQL limit field
79
ACSN_Insert=&Insert
80
ACSN_Insert=&Insert
81
ACSN_Delete=&Delete
80
ACSN_Apply=&Apply
82
ACSN_Apply=&Apply
81
83
82
LBL_Connection=Connection
84
LBL_Connection=Connection
Lines 99-101 Link Here
99
101
100
102
101
SQLHistoryPanel_PleaseWait=Please wait...
103
SQLHistoryPanel_PleaseWait=Please wait...
104
LBL_Delete=&Delete
105
LBL_DeleteAll=Delete All
106
DESC_DeleteAll=Really delete all entries from the SQL history?
107
ACSD_DeleteAll=Delete all SQL statements from history
(-)nb-trunk/db.core//src/org/netbeans/modules/db/sql/execute/ui/SQLHistoryPanel.form (-8 / +49 lines)
Lines 21-31 Link Here
21
              <Group type="103" groupAlignment="0" attributes="0">
21
              <Group type="103" groupAlignment="0" attributes="0">
22
                  <Group type="102" attributes="0">
22
                  <Group type="102" attributes="0">
23
                      <Group type="103" groupAlignment="0" attributes="0">
23
                      <Group type="103" groupAlignment="0" attributes="0">
24
                          <Component id="jScrollPane1" pref="645" max="32767" attributes="0"/>
24
                          <Component id="jScrollPane1" pref="568" max="32767" attributes="0"/>
25
                          <Group type="102" attributes="0">
25
                          <Group type="102" attributes="0">
26
                              <Component id="jLabel1" min="-2" max="-2" attributes="0"/>
26
                              <Component id="jLabel1" min="-2" max="-2" attributes="0"/>
27
                              <EmptySpace type="unrelated" max="-2" attributes="0"/>
27
                              <EmptySpace type="unrelated" max="-2" attributes="0"/>
28
                              <Component id="connectionUrlComboBox" pref="301" max="32767" attributes="0"/>
28
                              <Component id="connectionUrlComboBox" pref="224" max="32767" attributes="0"/>
29
                              <EmptySpace type="separate" max="-2" attributes="0"/>
29
                              <EmptySpace type="separate" max="-2" attributes="0"/>
30
                              <Component id="jLabel2" min="-2" max="-2" attributes="0"/>
30
                              <Component id="jLabel2" min="-2" max="-2" attributes="0"/>
31
                              <EmptySpace type="unrelated" max="-2" attributes="0"/>
31
                              <EmptySpace type="unrelated" max="-2" attributes="0"/>
Lines 33-43 Link Here
33
                          </Group>
33
                          </Group>
34
                      </Group>
34
                      </Group>
35
                      <EmptySpace max="-2" attributes="0"/>
35
                      <EmptySpace max="-2" attributes="0"/>
36
                      <Component id="insertSQLButton" min="-2" max="-2" attributes="0"/>
36
                      <Group type="103" groupAlignment="0" attributes="0">
37
                          <Component id="insertSQLButton" pref="87" max="32767" attributes="1"/>
38
                          <Component id="deleteSQLButtton" alignment="0" pref="87" max="32767" attributes="1"/>
39
                          <Component id="deleteAllSQLButton" alignment="0" max="32767" attributes="0"/>
40
                      </Group>
37
                      <EmptySpace max="-2" attributes="0"/>
41
                      <EmptySpace max="-2" attributes="0"/>
38
                  </Group>
42
                  </Group>
39
                  <Group type="102" alignment="0" attributes="0">
43
                  <Group type="102" alignment="0" attributes="0">
40
                      <Component id="inputWarningLabel" pref="228" max="32767" attributes="0"/>
44
                      <Component id="inputWarningLabel" pref="174" max="32767" attributes="0"/>
41
                      <EmptySpace min="-2" pref="493" max="-2" attributes="0"/>
45
                      <EmptySpace min="-2" pref="493" max="-2" attributes="0"/>
42
                  </Group>
46
                  </Group>
43
                  <Group type="102" alignment="0" attributes="0">
47
                  <Group type="102" alignment="0" attributes="0">
Lines 63-71 Link Here
63
              </Group>
67
              </Group>
64
              <EmptySpace type="unrelated" max="-2" attributes="0"/>
68
              <EmptySpace type="unrelated" max="-2" attributes="0"/>
65
              <Group type="103" groupAlignment="0" attributes="0">
69
              <Group type="103" groupAlignment="0" attributes="0">
66
                  <Component id="insertSQLButton" alignment="0" min="-2" max="-2" attributes="0"/>
67
                  <Group type="102" alignment="1" attributes="0">
70
                  <Group type="102" alignment="1" attributes="0">
68
                      <Component id="jScrollPane1" pref="268" max="32767" attributes="0"/>
71
                      <Component id="insertSQLButton" min="-2" max="-2" attributes="0"/>
72
                      <EmptySpace pref="141" max="32767" attributes="0"/>
73
                      <Component id="deleteAllSQLButton" min="-2" max="-2" attributes="0"/>
74
                      <EmptySpace max="-2" attributes="0"/>
75
                      <Component id="deleteSQLButtton" min="-2" max="-2" attributes="0"/>
76
                  </Group>
77
                  <Component id="jScrollPane1" alignment="1" pref="228" max="32767" attributes="0"/>
78
              </Group>
69
                      <EmptySpace max="-2" attributes="0"/>
79
                      <EmptySpace max="-2" attributes="0"/>
70
                      <Group type="103" groupAlignment="3" attributes="0">
80
                      <Group type="103" groupAlignment="3" attributes="0">
71
                          <Component id="sqlLimitTextField" alignment="3" min="-2" max="-2" attributes="0"/>
81
                          <Component id="sqlLimitTextField" alignment="3" min="-2" max="-2" attributes="0"/>
Lines 74-81 Link Here
74
                      </Group>
84
                      </Group>
75
                      <EmptySpace max="-2" attributes="0"/>
85
                      <EmptySpace max="-2" attributes="0"/>
76
                      <Component id="inputWarningLabel" min="-2" pref="26" max="-2" attributes="0"/>
86
                      <Component id="inputWarningLabel" min="-2" pref="26" max="-2" attributes="0"/>
77
                  </Group>
78
              </Group>
79
              <EmptySpace max="-2" attributes="0"/>
87
              <EmptySpace max="-2" attributes="0"/>
80
          </Group>
88
          </Group>
81
      </Group>
89
      </Group>
Lines 132-137 Link Here
132
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
140
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
133
          <ResourceString bundle="org/netbeans/modules/db/sql/execute/ui/Bundle.properties" key="LBL_Insert" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
141
          <ResourceString bundle="org/netbeans/modules/db/sql/execute/ui/Bundle.properties" key="LBL_Insert" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
134
        </Property>
142
        </Property>
143
        <Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
144
          <ResourceString bundle="org/netbeans/modules/db/sql/execute/ui/Bundle.properties" key="ACSD_Insert" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
145
        </Property>
135
        <Property name="enabled" type="boolean" value="false"/>
146
        <Property name="enabled" type="boolean" value="false"/>
136
      </Properties>
147
      </Properties>
137
      <AccessibilityProperties>
148
      <AccessibilityProperties>
Lines 242-246 Link Here
242
        <Property name="verifyInputWhenFocusTarget" type="boolean" value="false"/>
253
        <Property name="verifyInputWhenFocusTarget" type="boolean" value="false"/>
243
      </Properties>
254
      </Properties>
244
    </Component>
255
    </Component>
256
    <Component class="javax.swing.JButton" name="deleteSQLButtton">
257
      <Properties>
258
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
259
          <ResourceString bundle="org/netbeans/modules/db/sql/execute/ui/Bundle.properties" key="LBL_Delete" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
260
        </Property>
261
        <Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
262
          <ResourceString bundle="org/netbeans/modules/db/sql/execute/ui/Bundle.properties" key="ACSD_Delete" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
263
        </Property>
264
        <Property name="enabled" type="boolean" value="false"/>
265
      </Properties>
266
      <Events>
267
        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="deleteSQLButttonActionPerformed"/>
268
      </Events>
269
      <AuxValues>
270
        <AuxValue name="generateMnemonicsCode" type="java.lang.Boolean" value="true"/>
271
      </AuxValues>
272
    </Component>
273
    <Component class="javax.swing.JButton" name="deleteAllSQLButton">
274
      <Properties>
275
        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
276
          <ResourceString bundle="org/netbeans/modules/db/sql/execute/ui/Bundle.properties" key="LBL_DeleteAll" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
277
        </Property>
278
        <Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
279
          <ResourceString bundle="org/netbeans/modules/db/sql/execute/ui/Bundle.properties" key="ACSD_DeleteAll" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
280
        </Property>
281
      </Properties>
282
      <Events>
283
        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="deleteAllSQLButtonActionPerformed"/>
284
      </Events>
285
    </Component>
245
  </SubComponents>
286
  </SubComponents>
246
</Form>
287
</Form>
(-)nb-trunk/db.core//src/org/netbeans/modules/db/sql/execute/ui/SQLHistoryPanel.java (-9 / +81 lines)
Lines 84-92 Link Here
84
import javax.swing.text.Caret;
84
import javax.swing.text.Caret;
85
import javax.swing.text.Document;
85
import javax.swing.text.Document;
86
import org.netbeans.api.editor.EditorRegistry;
86
import org.netbeans.api.editor.EditorRegistry;
87
import org.netbeans.modules.db.sql.history.SQLHistory;
87
import org.netbeans.modules.db.sql.history.SQLHistoryEntry;
88
import org.netbeans.modules.db.sql.history.SQLHistoryEntry;
88
import org.netbeans.modules.db.sql.history.SQLHistoryManager;
89
import org.netbeans.modules.db.sql.history.SQLHistoryManager;
89
import org.netbeans.modules.db.sql.loader.SQLDataLoader;
90
import org.netbeans.modules.db.sql.loader.SQLDataLoader;
91
import org.openide.DialogDisplayer;
92
import org.openide.NotifyDescriptor;
90
import org.openide.awt.MouseUtils;
93
import org.openide.awt.MouseUtils;
91
import org.openide.util.Exceptions;
94
import org.openide.util.Exceptions;
92
import org.openide.util.NbBundle;
95
import org.openide.util.NbBundle;
Lines 168-175 Link Here
168
                    public void valueChanged(ListSelectionEvent e) {
171
                    public void valueChanged(ListSelectionEvent e) {
169
                        if (sqlTableSelektion.isSelectionEmpty()) {
172
                        if (sqlTableSelektion.isSelectionEmpty()) {
170
                            insertSQLButton.setEnabled(false);
173
                            insertSQLButton.setEnabled(false);
174
                            deleteSQLButtton.setEnabled(false);
171
                        } else {
175
                        } else {
172
                            insertSQLButton.setEnabled(true);
176
                            insertSQLButton.setEnabled(true);
177
                            deleteSQLButtton.setEnabled(true);
173
                        }
178
                        }
174
                    }
179
                    }
175
                });
180
                });
Lines 188-194 Link Here
188
193
189
        String url = (String) connectionUrlComboBox.getSelectedItem();
194
        String url = (String) connectionUrlComboBox.getSelectedItem();
190
195
191
        if ( url != null && !url.equals(NbBundle.getMessage(SQLHistoryPanel.class, "LBL_URLComboBoxAllConnectionsItem"))) {
196
        if (url != null && !url.equals(NbBundle.getMessage(SQLHistoryPanel.class, "LBL_URLComboBoxAllConnectionsItem"))) {
192
            rowFilter.add(new EqualsFilter(url, 0));
197
            rowFilter.add(new EqualsFilter(url, 0));
193
        }
198
        }
194
199
Lines 208-214 Link Here
208
        urls.add(0, NbBundle.getMessage(SQLHistoryPanel.class, "LBL_URLComboBoxAllConnectionsItem"));
213
        urls.add(0, NbBundle.getMessage(SQLHistoryPanel.class, "LBL_URLComboBoxAllConnectionsItem"));
209
        Object selected = connectionUrlComboBox.getSelectedItem();
214
        Object selected = connectionUrlComboBox.getSelectedItem();
210
        connectionUrlComboBox.setModel(new DefaultComboBoxModel(urls.toArray()));
215
        connectionUrlComboBox.setModel(new DefaultComboBoxModel(urls.toArray()));
211
        if(selected != null && urls.contains(selected)) {
216
        if (selected != null && urls.contains(selected)) {
212
            connectionUrlComboBox.setSelectedItem(selected);
217
            connectionUrlComboBox.setSelectedItem(selected);
213
        } else {
218
        } else {
214
            connectionUrlComboBox.setSelectedIndex(0);
219
            connectionUrlComboBox.setSelectedIndex(0);
Lines 245-250 Link Here
245
        sqlLimitTextField = new javax.swing.JTextField();
250
        sqlLimitTextField = new javax.swing.JTextField();
246
        sqlLimitButton = new javax.swing.JButton();
251
        sqlLimitButton = new javax.swing.JButton();
247
        inputWarningLabel = new javax.swing.JLabel();
252
        inputWarningLabel = new javax.swing.JLabel();
253
        deleteSQLButtton = new javax.swing.JButton();
254
        deleteAllSQLButton = new javax.swing.JButton();
248
255
249
        jLabel1.setText(org.openide.util.NbBundle.getMessage(SQLHistoryPanel.class, "LBL_Connection")); // NOI18N
256
        jLabel1.setText(org.openide.util.NbBundle.getMessage(SQLHistoryPanel.class, "LBL_Connection")); // NOI18N
250
257
Lines 254-259 Link Here
254
        searchTextField.setMinimumSize(new java.awt.Dimension(20, 22));
261
        searchTextField.setMinimumSize(new java.awt.Dimension(20, 22));
255
262
256
        org.openide.awt.Mnemonics.setLocalizedText(insertSQLButton, org.openide.util.NbBundle.getMessage(SQLHistoryPanel.class, "LBL_Insert")); // NOI18N
263
        org.openide.awt.Mnemonics.setLocalizedText(insertSQLButton, org.openide.util.NbBundle.getMessage(SQLHistoryPanel.class, "LBL_Insert")); // NOI18N
264
        insertSQLButton.setToolTipText(org.openide.util.NbBundle.getMessage(SQLHistoryPanel.class, "ACSD_Insert")); // NOI18N
257
        insertSQLButton.setEnabled(false);
265
        insertSQLButton.setEnabled(false);
258
        insertSQLButton.addActionListener(new java.awt.event.ActionListener() {
266
        insertSQLButton.addActionListener(new java.awt.event.ActionListener() {
259
            public void actionPerformed(java.awt.event.ActionEvent evt) {
267
            public void actionPerformed(java.awt.event.ActionEvent evt) {
Lines 313-318 Link Here
313
        inputWarningLabel.setRequestFocusEnabled(false);
321
        inputWarningLabel.setRequestFocusEnabled(false);
314
        inputWarningLabel.setVerifyInputWhenFocusTarget(false);
322
        inputWarningLabel.setVerifyInputWhenFocusTarget(false);
315
323
324
        org.openide.awt.Mnemonics.setLocalizedText(deleteSQLButtton, org.openide.util.NbBundle.getMessage(SQLHistoryPanel.class, "LBL_Delete")); // NOI18N
325
        deleteSQLButtton.setToolTipText(org.openide.util.NbBundle.getMessage(SQLHistoryPanel.class, "ACSD_Delete")); // NOI18N
326
        deleteSQLButtton.setEnabled(false);
327
        deleteSQLButtton.addActionListener(new java.awt.event.ActionListener() {
328
            public void actionPerformed(java.awt.event.ActionEvent evt) {
329
                deleteSQLButttonActionPerformed(evt);
330
            }
331
        });
332
333
        deleteAllSQLButton.setText(org.openide.util.NbBundle.getMessage(SQLHistoryPanel.class, "LBL_DeleteAll")); // NOI18N
334
        deleteAllSQLButton.setToolTipText(org.openide.util.NbBundle.getMessage(SQLHistoryPanel.class, "ACSD_DeleteAll")); // NOI18N
335
        deleteAllSQLButton.addActionListener(new java.awt.event.ActionListener() {
336
            public void actionPerformed(java.awt.event.ActionEvent evt) {
337
                deleteAllSQLButtonActionPerformed(evt);
338
            }
339
        });
340
316
        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
341
        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
317
        this.setLayout(layout);
342
        this.setLayout(layout);
318
        layout.setHorizontalGroup(
343
        layout.setHorizontalGroup(
Lines 322-341 Link Here
322
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
347
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
323
                    .addGroup(layout.createSequentialGroup()
348
                    .addGroup(layout.createSequentialGroup()
324
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
349
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
325
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 645, Short.MAX_VALUE)
350
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 568, Short.MAX_VALUE)
326
                            .addGroup(layout.createSequentialGroup()
351
                            .addGroup(layout.createSequentialGroup()
327
                                .addComponent(jLabel1)
352
                                .addComponent(jLabel1)
328
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
353
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
329
                                .addComponent(connectionUrlComboBox, 0, 301, Short.MAX_VALUE)
354
                                .addComponent(connectionUrlComboBox, 0, 224, Short.MAX_VALUE)
330
                                .addGap(18, 18, 18)
355
                                .addGap(18, 18, 18)
331
                                .addComponent(jLabel2)
356
                                .addComponent(jLabel2)
332
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
357
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
333
                                .addComponent(searchTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 147, javax.swing.GroupLayout.PREFERRED_SIZE)))
358
                                .addComponent(searchTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 147, javax.swing.GroupLayout.PREFERRED_SIZE)))
334
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
359
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
335
                        .addComponent(insertSQLButton)
360
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
361
                            .addComponent(insertSQLButton, javax.swing.GroupLayout.DEFAULT_SIZE, 87, Short.MAX_VALUE)
362
                            .addComponent(deleteSQLButtton, javax.swing.GroupLayout.DEFAULT_SIZE, 87, Short.MAX_VALUE)
363
                            .addComponent(deleteAllSQLButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
336
                        .addContainerGap())
364
                        .addContainerGap())
337
                    .addGroup(layout.createSequentialGroup()
365
                    .addGroup(layout.createSequentialGroup()
338
                        .addComponent(inputWarningLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 228, Short.MAX_VALUE)
366
                        .addComponent(inputWarningLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 174, Short.MAX_VALUE)
339
                        .addGap(493, 493, 493))
367
                        .addGap(493, 493, 493))
340
                    .addGroup(layout.createSequentialGroup()
368
                    .addGroup(layout.createSequentialGroup()
341
                        .addComponent(sqlLimitLabel)
369
                        .addComponent(sqlLimitLabel)
Lines 355-370 Link Here
355
                    .addComponent(connectionUrlComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE))
383
                    .addComponent(connectionUrlComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE))
356
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
384
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
357
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
385
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
358
                    .addComponent(insertSQLButton)
359
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
386
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
360
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 268, Short.MAX_VALUE)
387
                        .addComponent(insertSQLButton)
388
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 141, Short.MAX_VALUE)
389
                        .addComponent(deleteAllSQLButton)
390
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
391
                        .addComponent(deleteSQLButtton))
392
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 228, Short.MAX_VALUE))
361
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
393
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
362
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
394
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
363
                            .addComponent(sqlLimitTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
395
                            .addComponent(sqlLimitTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
364
                            .addComponent(sqlLimitButton)
396
                            .addComponent(sqlLimitButton)
365
                            .addComponent(sqlLimitLabel))
397
                            .addComponent(sqlLimitLabel))
366
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
398
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
367
                        .addComponent(inputWarningLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)))
399
                .addComponent(inputWarningLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
368
                .addContainerGap())
400
                .addContainerGap())
369
        );
401
        );
370
402
Lines 395-400 Link Here
395
    verifySQLLimit();
427
    verifySQLLimit();
396
}//GEN-LAST:event_sqlLimitButtonActionPerformed
428
}//GEN-LAST:event_sqlLimitButtonActionPerformed
397
429
430
    private void deleteSQLButttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteSQLButttonActionPerformed
431
        deleteSQL();
432
    }//GEN-LAST:event_deleteSQLButttonActionPerformed
433
434
    private void deleteAllSQLButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteAllSQLButtonActionPerformed
435
        deleteAllSQL();
436
    }//GEN-LAST:event_deleteAllSQLButtonActionPerformed
437
398
    private void insertSQL() {
438
    private void insertSQL() {
399
        try {
439
        try {
400
            JEditorPane pane = (JEditorPane) EditorRegistry.lastFocusedComponent();
440
            JEditorPane pane = (JEditorPane) EditorRegistry.lastFocusedComponent();
Lines 416-421 Link Here
416
        }
456
        }
417
    }
457
    }
418
458
459
    private void deleteSQL() {
460
        SQLHistoryManager shm = SQLHistoryManager.getInstance();
461
        SQLHistory history = shm.getSQLHistory();
462
        int min = sqlTableSelektion.getMinSelectionIndex();
463
        int max = sqlTableSelektion.getMaxSelectionIndex();
464
        for (int i = min; i <= max; i++) {
465
            if (sqlHistoryTable.isRowSelected(i)) {
466
                int modelIndex = sqlHistoryTable.convertRowIndexToModel(i);
467
                SQLHistoryEntry sql = (SQLHistoryEntry) htm.getValueAt(modelIndex, 3);
468
                history.remove(sql);
469
            }
470
        }
471
        shm.save();
472
        htm.refresh();
473
    }
474
475
    private void deleteAllSQL() {
476
        NotifyDescriptor d = new NotifyDescriptor.Confirmation(
477
                NbBundle.getMessage(SQLHistoryPanel.class, "DESC_DeleteAll"),
478
                NbBundle.getMessage(SQLHistoryPanel.class, "LBL_DeleteAll"),
479
                NotifyDescriptor.YES_NO_OPTION);
480
        if (DialogDisplayer.getDefault().notify(d) == NotifyDescriptor.YES_OPTION) {
481
            SQLHistoryManager shm = SQLHistoryManager.getInstance();
482
            SQLHistory history = shm.getSQLHistory();
483
            history.clear();
484
            shm.save();
485
            htm.refresh();
486
        }
487
    }
488
419
    private void verifySQLLimit() {
489
    private void verifySQLLimit() {
420
        String enteredLimitString = sqlLimitTextField.getText();
490
        String enteredLimitString = sqlLimitTextField.getText();
421
        String currentLimit = Integer.toString(SQLHistoryManager.getInstance().getListSize());
491
        String currentLimit = Integer.toString(SQLHistoryManager.getInstance().getListSize());
Lines 481-486 Link Here
481
    }
551
    }
482
    // Variables declaration - do not modify//GEN-BEGIN:variables
552
    // Variables declaration - do not modify//GEN-BEGIN:variables
483
    private javax.swing.JComboBox connectionUrlComboBox;
553
    private javax.swing.JComboBox connectionUrlComboBox;
554
    private javax.swing.JButton deleteAllSQLButton;
555
    private javax.swing.JButton deleteSQLButtton;
484
    private javax.swing.JLabel inputWarningLabel;
556
    private javax.swing.JLabel inputWarningLabel;
485
    private javax.swing.JButton insertSQLButton;
557
    private javax.swing.JButton insertSQLButton;
486
    private javax.swing.JLabel jLabel1;
558
    private javax.swing.JLabel jLabel1;

Return to bug 204552