You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by rm...@apache.org on 2021/05/08 02:18:26 UTC
[logging-chainsaw] 01/01: Resize rows when editing so you can see
what you're typing
This is an automated email from the ASF dual-hosted git repository.
rmiddleton pushed a commit to branch resize-plugin-configuration
in repository https://gitbox.apache.org/repos/asf/logging-chainsaw.git
commit e7f19137bec60ef89db2358618a137bdf8e1738f
Author: Robert Middleton <ro...@rm5248.com>
AuthorDate: Fri May 7 22:16:14 2021 -0400
Resize rows when editing so you can see what you're typing
---
.../log4j/chainsaw/receivers/PluginPropertyEditorPanel.java | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/main/java/org/apache/log4j/chainsaw/receivers/PluginPropertyEditorPanel.java b/src/main/java/org/apache/log4j/chainsaw/receivers/PluginPropertyEditorPanel.java
index 12153ce..eac5750 100644
--- a/src/main/java/org/apache/log4j/chainsaw/receivers/PluginPropertyEditorPanel.java
+++ b/src/main/java/org/apache/log4j/chainsaw/receivers/PluginPropertyEditorPanel.java
@@ -38,6 +38,8 @@ import java.beans.Introspector;
import java.beans.PropertyDescriptor;
import java.util.*;
import java.util.List;
+import javax.swing.event.CellEditorListener;
+import javax.swing.table.TableCellRenderer;
/**
@@ -175,8 +177,10 @@ public class PluginPropertyEditorPanel extends JPanel {
logger.debug("Cell value class " + valueClass +
" not know, using default editor");
- return defaultEditor.getTableCellEditorComponent(table, value,
+ Component c = defaultEditor.getTableCellEditorComponent(table, value,
isSelected, row, column);
+ table.setRowHeight( row, c.getPreferredSize().height );
+ return c;
}
/* (non-Javadoc)
@@ -189,7 +193,7 @@ public class PluginPropertyEditorPanel extends JPanel {
}
- private static class PluginPropertyTableModel extends AbstractTableModel {
+ private class PluginPropertyTableModel extends AbstractTableModel {
private final PropertyDescriptor[] descriptors;
private final Plugin plugin;
@@ -314,6 +318,9 @@ public class PluginPropertyEditorPanel extends JPanel {
} else {
super.setValueAt(aValue, rowIndex, columnIndex);
}
+
+ // Since the value has been set, resize all of the rows(if required)
+ propertyTable.setRowHeight(ChainsawConstants.DEFAULT_ROW_HEIGHT);
}
/**