Author: nkinder
Update of /cvs/dirsec/console/src/com/netscape/management/client/ace
In directory
cvs01.phx2.fedoraproject.org:/tmp/cvs-serv14411/src/com/netscape/management/client/ace
Modified Files:
ACIEditor.java
Log Message:
Bug: 594939 - ACI editing dialog initial size is not big enough to display
The problem had to do with the preferred size of the JTextArea that holds the
ACI name having an unusually large height. The JTextArea had line wrapping
enabled, yet it's default size was not set. This was resulting in it thinking
that it needed a huge height due to a lot of text wrapping.
The fix is to set the initial rows and columns of the text area when we call
it's constructor and to contain the text area in a scrollable pane. This
results in a sane preferred size and allows a long ACI name to line wrap
properly.
Index: ACIEditor.java
===================================================================
RCS file: /cvs/dirsec/console/src/com/netscape/management/client/ace/ACIEditor.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ACIEditor.java 26 Oct 2005 23:16:20 -0000 1.2
+++ ACIEditor.java 21 Feb 2011 17:49:39 -0000 1.3
@@ -79,7 +79,7 @@
private Vector tabVector = new Vector(); // elements instanceof IACITabs
private JTabbedPane tabbedPane = null;
private JFrame parentFrame = null;
- private JTextArea aciNameField = new JTextArea();
+ private JTextArea aciNameField = new JTextArea(2,30);
private LDAPConnection aciLdc;
private LDAPConnection ugLdc;
private String aciDN = null;
@@ -561,14 +561,14 @@
gbc.gridwidth = 1; gbc.gridheight = 1;
gbc.weightx = 0.0; gbc.weighty = 0.0;
gbc.anchor = GridBagConstraints.EAST;
- gbc.fill = GridBagConstraints.HORIZONTAL;
+ gbc.fill = GridBagConstraints.BOTH;
gbc.insets = new Insets(0, 0, 0, 0);
aciNameField.setFont(FontFactory.getFont(FontFactory.FONT_MONOSPACED));
aciNameField.setLineWrap(true);
aciNameField.setWrapStyleWord(true);
aciNameField.setBorder(UIManager.getBorder("TextField.border"));
- p.add(aciNameField, gbc);
+ p.add(new JScrollPane(aciNameField), gbc);
gbc.gridx = 0; gbc.gridy = 1;
gbc.gridwidth = 2; gbc.gridheight = 1;