[hg] main-silver: #223138: Celleditors in dataview are not usabl...

  • From: Jaroslav Havlin < >
  • To:
  • Subject: [hg] main-silver: #223138: Celleditors in dataview are not usabl...
  • Date: Mon, 03 Dec 2012 09:13:38 -0800

changeset b700e3bd4014 in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/b700e3bd4014
description:
        #223138: Celleditors in dataview are not usable in nimbus laf

diffstat:

 
db.dataview/src/org/netbeans/modules/db/dataview/table/ResultSetTableCellEditor.java
          |  9 ++++++++-
 
db.dataview/src/org/netbeans/modules/db/dataview/table/celleditor/BooleanTableCellEditor.java
 |  2 +-
 
db.dataview/src/org/netbeans/modules/db/dataview/table/celleditor/NumberFieldEditor.java
      |  2 +-
 
db.dataview/src/org/netbeans/modules/db/dataview/table/celleditor/StringTableCellEditor.java
  |  2 +-
 4 files changed, 11 insertions(+), 4 deletions(-)

diffs (55 lines):

diff --git 
a/db.dataview/src/org/netbeans/modules/db/dataview/table/ResultSetTableCellEditor.java
 
b/db.dataview/src/org/netbeans/modules/db/dataview/table/ResultSetTableCellEditor.java
--- 
a/db.dataview/src/org/netbeans/modules/db/dataview/table/ResultSetTableCellEditor.java
+++ 
b/db.dataview/src/org/netbeans/modules/db/dataview/table/ResultSetTableCellEditor.java
@@ -60,7 +60,14 @@
     protected Object val;
     protected boolean editable = true;
     protected JTable table;
-    protected static final boolean isGtk = "GTK".equals 
(UIManager.getLookAndFeel ().getID ()); //NOI18N
+    protected static final boolean suppressEditorBorder;
+
+    static {
+        boolean suppressBorder = false;
+        suppressBorder |= "GTK".equals(UIManager.getLookAndFeel().getID());  
//NOI18N
+        suppressBorder |= 
"Nimbus".equals(UIManager.getLookAndFeel().getName());  //NOI18N
+        suppressEditorBorder = suppressBorder;
+    }
 
     public ResultSetTableCellEditor(final JTextField textField) {
         super(textField);
diff --git 
a/db.dataview/src/org/netbeans/modules/db/dataview/table/celleditor/BooleanTableCellEditor.java
 
b/db.dataview/src/org/netbeans/modules/db/dataview/table/celleditor/BooleanTableCellEditor.java
--- 
a/db.dataview/src/org/netbeans/modules/db/dataview/table/celleditor/BooleanTableCellEditor.java
+++ 
b/db.dataview/src/org/netbeans/modules/db/dataview/table/celleditor/BooleanTableCellEditor.java
@@ -61,7 +61,7 @@
         this.table = table;
         Component c = super.getTableCellEditorComponent(table, value, 
isSelected, row, column);
         setEditable(column, c, table.isCellEditable(row, column));
-        if (isGtk && c instanceof JComponent) {
+        if (suppressEditorBorder && c instanceof JComponent) {
             ((JComponent) c).setBorder(BorderFactory.createEmptyBorder());
         }
         return c;
diff --git 
a/db.dataview/src/org/netbeans/modules/db/dataview/table/celleditor/NumberFieldEditor.java
 
b/db.dataview/src/org/netbeans/modules/db/dataview/table/celleditor/NumberFieldEditor.java
--- 
a/db.dataview/src/org/netbeans/modules/db/dataview/table/celleditor/NumberFieldEditor.java
+++ 
b/db.dataview/src/org/netbeans/modules/db/dataview/table/celleditor/NumberFieldEditor.java
@@ -59,7 +59,7 @@
     public Component getTableCellEditorComponent(final JTable table, Object 
value, boolean isSelected, int row, int column) {
         this.table = table;
         Component c = super.getTableCellEditorComponent(table, value, 
isSelected, row, column);
-        if (isGtk && c instanceof JComponent) {
+        if (suppressEditorBorder && c instanceof JComponent) {
             ((JComponent) c).setBorder(BorderFactory.createEmptyBorder());
         }
         setEditable(column, c, table.isCellEditable(row, column));
diff --git 
a/db.dataview/src/org/netbeans/modules/db/dataview/table/celleditor/StringTableCellEditor.java
 
b/db.dataview/src/org/netbeans/modules/db/dataview/table/celleditor/StringTableCellEditor.java
--- 
a/db.dataview/src/org/netbeans/modules/db/dataview/table/celleditor/StringTableCellEditor.java
+++ 
b/db.dataview/src/org/netbeans/modules/db/dataview/table/celleditor/StringTableCellEditor.java
@@ -117,7 +117,7 @@
             }
         };
         panel.add(c);
-        if (isGtk) {
+        if (suppressEditorBorder) {
             c.setBorder(BorderFactory.createEmptyBorder());
         }
         panel.add(customEditorButton, BorderLayout.EAST);

[hg] main-silver: #223138: Celleditors in dataview are not usabl...

Jaroslav Havlin 12/03/2012

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 20131025.e7cbc9d). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close