You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by pa...@apache.org on 2008/08/27 21:10:31 UTC

svn commit: r689569 - in /directory/studio/trunk: connection-ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/ ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/dialogs/properties/

Author: pamarcelot
Date: Wed Aug 27 12:10:31 2008
New Revision: 689569

URL: http://svn.apache.org/viewvc?rev=689569&view=rev
Log:
Fixed the width hint of the RootDSEPropertyPage.

Modified:
    directory/studio/trunk/connection-ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/BaseWidgetUtils.java
    directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/dialogs/properties/RootDSEPropertyPage.java

Modified: directory/studio/trunk/connection-ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/BaseWidgetUtils.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/connection-ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/BaseWidgetUtils.java?rev=689569&r1=689568&r2=689569&view=diff
==============================================================================
--- directory/studio/trunk/connection-ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/BaseWidgetUtils.java (original)
+++ directory/studio/trunk/connection-ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/BaseWidgetUtils.java Wed Aug 27 12:10:31 2008
@@ -249,6 +249,7 @@
      * @param parent the parent
      * @param text the initial text
      * @param span the horizontal span
+     * @param widthHint the width hint
      * @return the created text
      */
     public static Text createLabeledText( Composite parent, String text, int span, int widthHint )
@@ -292,6 +293,33 @@
         return t;
     }
 
+    /**
+     * Creates a SWT {@link Text} under the given parent.
+     * The created text control behaves like a label: it has no border, 
+     * a grayed background and is not modifyable. 
+     * But the text is selectable and could be copied.
+     * The label is created with the SWT.WRAP style to enable line wrapping.
+     *
+     * @param parent the parent
+     * @param text the initial text
+     * @param span the horizontal span
+     * @param widthHint the width hint
+     * @return the created text
+     */
+    public static Text createWrappedLabeledText( Composite parent, String text, int span, int widthHint  )
+    {
+        Text t = new Text( parent, SWT.WRAP );
+        GridData gd = new GridData( GridData.FILL_HORIZONTAL );
+        gd.horizontalSpan = span;
+        gd.widthHint = widthHint;
+        gd.grabExcessHorizontalSpace = true;
+        gd.horizontalAlignment = GridData.FILL;
+        t.setLayoutData( gd );
+        t.setEditable( false );
+        t.setBackground( parent.getBackground() );
+        t.setText( text );
+        return t;
+    }
 
     /**
      * Creates a SWT {@link Text} under the given parent.

Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/dialogs/properties/RootDSEPropertyPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/dialogs/properties/RootDSEPropertyPage.java?rev=689569&r1=689568&r2=689569&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/dialogs/properties/RootDSEPropertyPage.java (original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/dialogs/properties/RootDSEPropertyPage.java Wed Aug 27 12:10:31 2008
@@ -122,7 +122,7 @@
         GridLayout gl = new GridLayout( 2, false );
         infoComposite.setLayout( gl );
         BaseWidgetUtils.createLabel( infoComposite, "Directory Type:", 1 );
-        Text typeText = BaseWidgetUtils.createLabeledText( infoComposite, "-", 1, 10 );
+        Text typeText = BaseWidgetUtils.createWrappedLabeledText( infoComposite, "-", 1, 150);
         if ( connection != null && connection.getRootDSE() != null )
         {
             // Try to detect LDAP server from RootDSE
@@ -392,8 +392,8 @@
                 {
                     description = StringUtils.EMPTY;
                 }
-                BaseWidgetUtils.createLabeledText( composite, value, 1, 10 );
-                BaseWidgetUtils.createLabeledText( composite, description, 1, 10 );
+                BaseWidgetUtils.createLabeledText( composite, value, 1, 15 );
+                BaseWidgetUtils.createLabeledText( composite, description, 1, 15 );
             }
         }
         catch ( Exception e )
@@ -435,7 +435,7 @@
         }
 
         BaseWidgetUtils.createLabel( composite, labelName, 1 );
-        BaseWidgetUtils.createWrappedLabeledText( composite, sb.toString(), 1 );
+        BaseWidgetUtils.createWrappedLabeledText( composite, sb.toString(), 1, 150);
     }
 
 }