[Schmitzm-commits] r1861 - in trunk: schmitzm-core/src/main/java/de/schmitzm/swing/log4j schmitzm-core/src/main/java/de/schmitzm/swing/table schmitzm-gt/src/main/java/de/schmitzm/geotools/feature
scm-commit at wald.intevation.org
scm-commit at wald.intevation.org
Fri Feb 10 16:49:11 CET 2012
Author: mojays
Date: 2012-02-10 16:49:10 +0100 (Fri, 10 Feb 2012)
New Revision: 1861
Modified:
trunk/schmitzm-core/src/main/java/de/schmitzm/swing/log4j/LoggerFrame.java
trunk/schmitzm-core/src/main/java/de/schmitzm/swing/table/NumberFormatCellEditor.java
trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/feature/FeatureTypeBuilderTableModel.java
Log:
SwingUtil.createDefaultCellEditor(.) instead of "new DefaultCellEditor(.)" to automatically apply some "nice looking table rendering" parameters (e.g. EmptyBorder).
Modified: trunk/schmitzm-core/src/main/java/de/schmitzm/swing/log4j/LoggerFrame.java
===================================================================
--- trunk/schmitzm-core/src/main/java/de/schmitzm/swing/log4j/LoggerFrame.java 2012-02-10 15:34:19 UTC (rev 1860)
+++ trunk/schmitzm-core/src/main/java/de/schmitzm/swing/log4j/LoggerFrame.java 2012-02-10 15:49:10 UTC (rev 1861)
@@ -38,7 +38,6 @@
import java.io.File;
import java.util.Enumeration;
-import javax.swing.DefaultCellEditor;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
@@ -169,7 +168,7 @@
});
loggerTable.setDefaultRenderer(Boolean.class,
new ComponentRenderer.JCheckBox());
- loggerTable.setDefaultEditor(Boolean.class, new DefaultCellEditor(
+ loggerTable.setDefaultEditor(Boolean.class, SwingUtil.createDefaultCellEditor(
new JCheckBox() {
private static final long serialVersionUID = -2478321390196185070L;
@@ -186,7 +185,7 @@
loggerTable.setDefaultRenderer(Level.class,
new ComponentRenderer.JComboBox());
- loggerTable.setDefaultEditor(Level.class, new DefaultCellEditor(
+ loggerTable.setDefaultEditor(Level.class, SwingUtil.createDefaultCellEditor(
new JComboBox(new Object[] { Level.ALL, Level.DEBUG,
Level.ERROR, Level.FATAL, Level.INFO, Level.OFF,
Level.WARN })));
Modified: trunk/schmitzm-core/src/main/java/de/schmitzm/swing/table/NumberFormatCellEditor.java
===================================================================
--- trunk/schmitzm-core/src/main/java/de/schmitzm/swing/table/NumberFormatCellEditor.java 2012-02-10 15:34:19 UTC (rev 1860)
+++ trunk/schmitzm-core/src/main/java/de/schmitzm/swing/table/NumberFormatCellEditor.java 2012-02-10 15:49:10 UTC (rev 1861)
@@ -8,6 +8,8 @@
import javax.swing.JTextField;
import javax.swing.table.TableCellEditor;
+import de.schmitzm.swing.SwingUtil;
+
/**
* {@link TableCellEditor} (using {@link JTextField}) which converts
* the number value according to the given {@link NumberFormat} before
@@ -33,6 +35,7 @@
public NumberFormatCellEditor(JTextField textField, NumberFormat formatter) {
super(textField);
this.formatter = formatter;
+ SwingUtil.initComponentForCellEditor(textField);
}
Modified: trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/feature/FeatureTypeBuilderTableModel.java
===================================================================
--- trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/feature/FeatureTypeBuilderTableModel.java 2012-02-10 15:34:19 UTC (rev 1860)
+++ trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/feature/FeatureTypeBuilderTableModel.java 2012-02-10 15:49:10 UTC (rev 1861)
@@ -34,7 +34,6 @@
import java.util.Vector;
import javax.swing.CellEditor;
-import javax.swing.DefaultCellEditor;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JTable;
@@ -52,6 +51,7 @@
import de.schmitzm.geotools.gui.GeotoolsGUIUtil;
import de.schmitzm.swing.ExceptionDialog;
+import de.schmitzm.swing.SwingUtil;
import de.schmitzm.swing.input.BooleanInputOption;
import de.schmitzm.swing.input.ManualInputOption;
import de.schmitzm.swing.input.SelectionInputOption;
@@ -154,13 +154,13 @@
table.getColumnModel().getColumn(4)
.setCellRenderer(new ComponentRenderer.JTextField());
table.getColumnModel().getColumn(0)
- .setCellEditor(new DefaultCellEditor(new JTextField()));
+ .setCellEditor(SwingUtil.createDefaultCellEditor(new JTextField()));
table.getColumnModel()
.getColumn(1)
.setCellEditor(
- new DefaultCellEditor(new JComboBox(ATTR_TYPES_DESC)));
+ SwingUtil.createDefaultCellEditor(new JComboBox(ATTR_TYPES_DESC)));
table.getColumnModel().getColumn(2)
- .setCellEditor(new DefaultCellEditor(new JCheckBox() {
+ .setCellEditor(SwingUtil.createDefaultCellEditor(new JCheckBox() {
@Override
public int getHorizontalAlignment() {
return this.CENTER;
@@ -172,7 +172,7 @@
}
}));
table.getColumnModel().getColumn(3)
- .setCellEditor(new DefaultCellEditor(new JCheckBox() {
+ .setCellEditor(SwingUtil.createDefaultCellEditor(new JCheckBox() {
@Override
public int getHorizontalAlignment() {
return this.CENTER;
@@ -184,7 +184,7 @@
}
}));
table.getColumnModel().getColumn(4)
- .setCellEditor(new DefaultCellEditor(new JTextField()));
+ .setCellEditor(SwingUtil.createDefaultCellEditor(new JTextField()));
}
/**
More information about the Schmitzm-commits
mailing list