directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r981515 - in /directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers: properties/ServerPropertyPage.java wizards/NewServerWizardPage.java
Date Mon, 02 Aug 2010 14:13:29 GMT
Author: pamarcelot
Date: Mon Aug  2 14:13:29 2010
New Revision: 981515

URL: http://svn.apache.org/viewvc?rev=981515&view=rev
Log:
Used BaseWidgetUtils class to create widgets.

Modified:
    directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/properties/ServerPropertyPage.java
    directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/wizards/NewServerWizardPage.java

Modified: directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/properties/ServerPropertyPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/properties/ServerPropertyPage.java?rev=981515&r1=981514&r2=981515&view=diff
==============================================================================
--- directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/properties/ServerPropertyPage.java
(original)
+++ directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/properties/ServerPropertyPage.java
Mon Aug  2 14:13:29 2010
@@ -20,12 +20,12 @@
 package org.apache.directory.studio.ldapservers.properties;
 
 
+import org.apache.directory.studio.common.ui.widgets.BaseWidgetUtils;
 import org.apache.directory.studio.ldapservers.LdapServersManager;
 import org.apache.directory.studio.ldapservers.model.LdapServer;
 import org.apache.directory.studio.ldapservers.model.LdapServerAdapterExtension;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Label;
@@ -57,41 +57,25 @@ public class ServerPropertyPage extends 
     protected Control createContents( Composite parent )
     {
         // Composite
-        Composite composite = new Composite( parent, SWT.NONE );
-        composite.setLayout( new GridLayout( 2, false ) );
-        composite.setLayoutData( new GridData( SWT.FILL, SWT.FILL, true, true ) );
+        Composite composite = BaseWidgetUtils.createColumnContainer( parent, 2, 1 );
 
         // Name
-        Label nameLabel = new Label( composite, SWT.NONE );
-        nameLabel.setText( Messages.getString( "ServerPropertyPage.Name" ) ); //$NON-NLS-1$
-        Text nameText = new Text( composite, SWT.NONE );
-        nameText.setEditable( false );
-        nameText.setBackground( parent.getBackground() );
-        nameText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
+        BaseWidgetUtils.createLabel( composite, Messages.getString( "ServerPropertyPage.Name"
), 1 ); //$NON-NLS-1$
+        Text nameText = BaseWidgetUtils.createLabeledText( composite, "", 1 );
 
         // Type
-        Label typeLabel = new Label( composite, SWT.NONE );
-        typeLabel.setText( "Type:" );
-        Text typeText = new Text( composite, SWT.NONE );
-        typeText.setEditable( false );
-        typeText.setBackground( parent.getBackground() );
-        typeText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
+        BaseWidgetUtils.createLabel( composite, "Type:", 1 );
+        Text typeText = BaseWidgetUtils.createLabeledText( composite, "", 1 );
 
         // Vendor
-        Label vendorLabel = new Label( composite, SWT.NONE );
-        vendorLabel.setText( "Vendor:" );
-        Text vendorText = new Text( composite, SWT.NONE );
-        vendorText.setEditable( false );
-        vendorText.setBackground( parent.getBackground() );
-        vendorText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
+        BaseWidgetUtils.createLabel( composite, "Vendor:", 1 );
+        Text vendorText = BaseWidgetUtils.createLabeledText( composite, "", 1 );
 
         // Location
-        Label locationLabel = new Label( composite, SWT.NONE );
-        locationLabel.setText( Messages.getString( "ServerPropertyPage.Location" ) ); //$NON-NLS-1$
+        Label locationLabel = BaseWidgetUtils.createLabel( composite,
+            Messages.getString( "ServerPropertyPage.Location" ), 1 ); //$NON-NLS-1$
         locationLabel.setLayoutData( new GridData( SWT.NONE, SWT.TOP, false, false ) );
-        Text locationText = new Text( composite, SWT.WRAP );
-        locationText.setEditable( false );
-        locationText.setBackground( parent.getBackground() );
+        Text locationText = BaseWidgetUtils.createWrappedLabeledText( composite, "", 1 );
         GridData gd = new GridData( SWT.FILL, SWT.NONE, true, false );
         gd.widthHint = 300;
         locationText.setLayoutData( gd );

Modified: directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/wizards/NewServerWizardPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/wizards/NewServerWizardPage.java?rev=981515&r1=981514&r2=981515&view=diff
==============================================================================
--- directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/wizards/NewServerWizardPage.java
(original)
+++ directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/wizards/NewServerWizardPage.java
Mon Aug  2 14:13:29 2010
@@ -22,6 +22,7 @@ package org.apache.directory.studio.ldap
 
 import java.util.regex.Pattern;
 
+import org.apache.directory.studio.common.ui.widgets.BaseWidgetUtils;
 import org.apache.directory.studio.ldapservers.LdapServersManager;
 import org.apache.directory.studio.ldapservers.LdapServersPlugin;
 import org.apache.directory.studio.ldapservers.LdapServersPluginConstants;
@@ -92,9 +93,8 @@ public class NewServerWizardPage extends
         composite.setLayout( new GridLayout( 2, false ) );
 
         // Filter Label
-        filterLabel = new Label( composite, SWT.NONE );
+        filterLabel = BaseWidgetUtils.createLabel( composite, "Select the server type:",
2 );
         filterLabel.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false, 2, 1 )
);
-        filterLabel.setText( "Select the server type:" );
 
         // Filter Text
         filterText = new Text( composite, SWT.BORDER | SWT.SEARCH | SWT.CANCEL );
@@ -159,12 +159,10 @@ public class NewServerWizardPage extends
         filler.setLayoutData( new GridData( SWT.NONE, SWT.NONE, true, false, 2, 1 ) );
 
         // Server Name Label
-        Label serverNameLabel = new Label( composite, SWT.NONE );
-        serverNameLabel.setText( "Server Name:" );
+        BaseWidgetUtils.createLabel( composite, "Server Name:", 1 );
 
         // Server Name Text
-        serverNameText = new Text( composite, SWT.BORDER );
-        serverNameText.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
+        serverNameText = BaseWidgetUtils.createText( composite, "", 1 );
 
         // Adding listeners
         addListeners();



Mime
View raw message