[hg] main-silver: #235927: The DB Insert window cannot Scroll ho...

  • From: Libor Fischmeistr < >
  • To:
  • Subject: [hg] main-silver: #235927: The DB Insert window cannot Scroll ho...
  • Date: Tue, 03 Dec 2013 19:59:01 +0000

changeset 04d979524ef0 in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/04d979524ef0
description:
        #235927: The DB Insert window cannot Scroll horizontally

diffstat:

 
db.dataview/src/org/netbeans/modules/db/dataview/output/InsertRecordTableUI.java
 |  9 +++++++--
 db.dataview/src/org/netbeans/modules/db/dataview/table/ResultSetJXTable.java 
    |  3 +--
 2 files changed, 8 insertions(+), 4 deletions(-)

diffs (41 lines):

diff --git 
a/db.dataview/src/org/netbeans/modules/db/dataview/output/InsertRecordTableUI.java
 
b/db.dataview/src/org/netbeans/modules/db/dataview/output/InsertRecordTableUI.java
--- 
a/db.dataview/src/org/netbeans/modules/db/dataview/output/InsertRecordTableUI.java
+++ 
b/db.dataview/src/org/netbeans/modules/db/dataview/output/InsertRecordTableUI.java
@@ -44,6 +44,7 @@
 import org.netbeans.modules.db.dataview.table.ResultSetJXTable;
 import java.sql.Types;
 import java.util.Arrays;
+import javax.swing.table.TableModel;
 import org.jdesktop.swingx.JXTable;
 import org.netbeans.modules.db.dataview.meta.DBColumn;
 
@@ -54,9 +55,13 @@
 
     boolean isRowSelectionAllowed = rowSelectionAllowed;
 
-    public InsertRecordTableUI() {
-        if (getColumnModel().getColumnCount() < 7) {
+    @Override
+    public void setModel(TableModel dataModel) {
+        super.setModel(dataModel);
+        if (dataModel.getColumnCount() < 7) {
             setAutoResizeMode(JXTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS);
+        } else {
+            setHorizontalScrollEnabled(true);
         }
     }   
 
diff --git 
a/db.dataview/src/org/netbeans/modules/db/dataview/table/ResultSetJXTable.java
 
b/db.dataview/src/org/netbeans/modules/db/dataview/table/ResultSetJXTable.java
--- 
a/db.dataview/src/org/netbeans/modules/db/dataview/table/ResultSetJXTable.java
+++ 
b/db.dataview/src/org/netbeans/modules/db/dataview/table/ResultSetJXTable.java
@@ -123,9 +123,8 @@
         getTableHeader().setReorderingAllowed(false);
         setColumnControlVisible(true);
         
getColumnControl().setToolTipText(org.openide.util.NbBundle.getMessage(ResultSetJXTable.class,
 "ResultSetJXTable.columnControl.tooltip"));
+        setFillsViewportHeight(true);
         setHorizontalScrollEnabled(true);
-        setAutoResizeMode(JXTable.AUTO_RESIZE_OFF);
-        setFillsViewportHeight(true);
 
         
setHighlighters(HighlighterFactory.createAlternateStriping(ROW_COLOR, 
ALTERNATE_ROW_COLOR));
         addHighlighter(new ColorHighlighter(HighlightPredicate.ROLLOVER_ROW, 
ROLLOVER_ROW_COLOR, null));

[hg] main-silver: #235927: The DB Insert window cannot Scroll ho...

Libor Fischmeistr 12/03/2013

Project Features

About this Project

DB was started in November 2009, is owned by Antonin Nebuzelsky, and has 113 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20140418.2d69abc). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close