directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r692258 - in /directory/studio/trunk: aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/valueeditors/ ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/ ldapbrowser-common/src/main/j...
Date Thu, 04 Sep 2008 21:38:47 GMT
Author: seelmann
Date: Thu Sep  4 14:38:46 2008
New Revision: 692258

URL: http://svn.apache.org/viewvc?rev=692258&view=rev
Log:
Code cleaning, removed deprecated DecortedField class, use ControlDecoration and ContentAssistCommandAdapter
now

Modified:
    directory/studio/trunk/aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/valueeditors/AttributeTypeAndValueDialog.java
    directory/studio/trunk/aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/valueeditors/AttributeTypeDialog.java
    directory/studio/trunk/aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/valueeditors/MaxValueCountValueEditor.java
    directory/studio/trunk/aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/valueeditors/RestrictedByValueEditor.java
    directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/DnBuilderWidget.java
    directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/ModWidget.java
    directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/FilterWidget.java
    directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/wizards/AttributeTypeWizardPage.java
    directory/studio/trunk/valueeditors/src/main/java/org/apache/directory/studio/valueeditors/administrativerole/AdministrativeRoleDialog.java
    directory/studio/trunk/valueeditors/src/main/java/org/apache/directory/studio/valueeditors/objectclass/ObjectClassDialog.java

Modified: directory/studio/trunk/aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/valueeditors/AttributeTypeAndValueDialog.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/valueeditors/AttributeTypeAndValueDialog.java?rev=692258&r1=692257&r2=692258&view=diff
==============================================================================
--- directory/studio/trunk/aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/valueeditors/AttributeTypeAndValueDialog.java
(original)
+++ directory/studio/trunk/aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/valueeditors/AttributeTypeAndValueDialog.java
Thu Sep  4 14:38:46 2008
@@ -25,17 +25,13 @@
 
 import org.apache.directory.studio.aciitemeditor.Activator;
 import org.apache.directory.studio.connection.ui.widgets.BaseWidgetUtils;
+import org.apache.directory.studio.connection.ui.widgets.ExtendedContentAssistCommandAdapter;
 import org.apache.directory.studio.ldapbrowser.common.widgets.ListContentProposalProvider;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.Schema;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.SchemaUtils;
 import org.eclipse.jface.dialogs.Dialog;
 import org.eclipse.jface.dialogs.IDialogConstants;
 import org.eclipse.jface.fieldassist.ComboContentAdapter;
-import org.eclipse.jface.fieldassist.ContentProposalAdapter;
-import org.eclipse.jface.fieldassist.DecoratedField;
-import org.eclipse.jface.fieldassist.FieldDecoration;
-import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
-import org.eclipse.jface.fieldassist.IControlCreator;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
@@ -64,15 +60,9 @@
     /** The initial value. */
     private String initialValue;
 
-    /** The attribute type combo field. */
-    private DecoratedField attributeTypeComboField;
-
     /** The attribute type combo. */
     private Combo attributeTypeCombo;
 
-    /** The attribute type content proposal adapter */
-    private ContentProposalAdapter attributeTypeCPA;
-
     /** The value text. */
     private Text valueText;
 
@@ -109,8 +99,8 @@
     protected void configureShell( Shell shell )
     {
         super.configureShell( shell );
-        shell.setText( Messages.getString("AttributeTypeAndValueDialog.title") ); //$NON-NLS-1$
-        shell.setImage( Activator.getDefault().getImage( Messages.getString("AttributeTypeAndValueDialog.icon")
) ); //$NON-NLS-1$
+        shell.setText( Messages.getString( "AttributeTypeAndValueDialog.title" ) ); //$NON-NLS-1$
+        shell.setImage( Activator.getDefault().getImage( Messages.getString( "AttributeTypeAndValueDialog.icon"
) ) ); //$NON-NLS-1$
     }
 
 
@@ -151,28 +141,11 @@
         String[] allAtNames = names.toArray( new String[names.size()] );
         Arrays.sort( allAtNames );
 
-        final FieldDecoration fieldDecoration = FieldDecorationRegistry.getDefault().getFieldDecoration(
-            FieldDecorationRegistry.DEC_CONTENT_PROPOSAL );
-        attributeTypeComboField = new DecoratedField( composite, SWT.NONE, new IControlCreator()
-        {
-            public Control createControl( Composite parent, int style )
-            {
-                Combo combo = BaseWidgetUtils.createCombo( parent, new String[0], -1, 1 );
-                combo.setVisibleItemCount( 20 );
-                return combo;
-            }
-        } );
-        attributeTypeComboField.addFieldDecoration( fieldDecoration, SWT.TOP | SWT.LEFT,
true );
-        attributeTypeComboField.getLayoutControl().setLayoutData( new GridData( SWT.FILL,
SWT.CENTER, true, false ) );
-        attributeTypeCombo = ( Combo ) attributeTypeComboField.getControl();
-        attributeTypeCombo.setItems( allAtNames );
+        // attribute combo with field decoration and content proposal
+        attributeTypeCombo = BaseWidgetUtils.createCombo( composite, allAtNames, -1, 1 );
         attributeTypeCombo.setText( initialAttributeType );
-
-        // content proposal adapter
-        attributeTypeCPA = new ContentProposalAdapter( attributeTypeCombo, new ComboContentAdapter(),
-            new ListContentProposalProvider( attributeTypeCombo.getItems() ), null, null
);
-        attributeTypeCPA.setFilterStyle( ContentProposalAdapter.FILTER_NONE );
-        attributeTypeCPA.setProposalAcceptanceStyle( ContentProposalAdapter.PROPOSAL_REPLACE
);
+        new ExtendedContentAssistCommandAdapter( attributeTypeCombo, new ComboContentAdapter(),
+            new ListContentProposalProvider( attributeTypeCombo.getItems() ), null, null,
true );
 
         BaseWidgetUtils.createLabel( composite, " = ", 1 ); //$NON-NLS-1$
 

Modified: directory/studio/trunk/aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/valueeditors/AttributeTypeDialog.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/valueeditors/AttributeTypeDialog.java?rev=692258&r1=692257&r2=692258&view=diff
==============================================================================
--- directory/studio/trunk/aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/valueeditors/AttributeTypeDialog.java
(original)
+++ directory/studio/trunk/aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/valueeditors/AttributeTypeDialog.java
Thu Sep  4 14:38:46 2008
@@ -26,17 +26,13 @@
 
 import org.apache.directory.studio.aciitemeditor.Activator;
 import org.apache.directory.studio.connection.ui.widgets.BaseWidgetUtils;
+import org.apache.directory.studio.connection.ui.widgets.ExtendedContentAssistCommandAdapter;
 import org.apache.directory.studio.ldapbrowser.common.widgets.ListContentProposalProvider;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.Schema;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.SchemaUtils;
 import org.eclipse.jface.dialogs.Dialog;
 import org.eclipse.jface.dialogs.IDialogConstants;
 import org.eclipse.jface.fieldassist.ComboContentAdapter;
-import org.eclipse.jface.fieldassist.ContentProposalAdapter;
-import org.eclipse.jface.fieldassist.DecoratedField;
-import org.eclipse.jface.fieldassist.FieldDecoration;
-import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
-import org.eclipse.jface.fieldassist.IControlCreator;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.widgets.Combo;
@@ -60,15 +56,9 @@
     /** The initial value. */
     private String initialValue;
 
-    /** The attribute type combo field. */
-    private DecoratedField attributeTypeComboField;
-
     /** The attribute type combo. */
     private Combo attributeTypeCombo;
 
-    /** The attribute type content proposal adapter */
-    private ContentProposalAdapter attributeTypeCPA;
-
     /** The return value. */
     private String returnValue;
 
@@ -96,8 +86,8 @@
     protected void configureShell( Shell shell )
     {
         super.configureShell( shell );
-        shell.setText( Messages.getString("AttributeTypeDialog.title") ); //$NON-NLS-1$
-        shell.setImage( Activator.getDefault().getImage( Messages.getString("AttributeTypeDialog.icon")
) ); //$NON-NLS-1$
+        shell.setText( Messages.getString( "AttributeTypeDialog.title" ) ); //$NON-NLS-1$
+        shell.setImage( Activator.getDefault().getImage( Messages.getString( "AttributeTypeDialog.icon"
) ) ); //$NON-NLS-1$
     }
 
 
@@ -136,28 +126,11 @@
         String[] allAtNames = names.toArray( new String[names.size()] );
         Arrays.sort( allAtNames );
 
-        final FieldDecoration fieldDecoration = FieldDecorationRegistry.getDefault().getFieldDecoration(
-            FieldDecorationRegistry.DEC_CONTENT_PROPOSAL );
-        attributeTypeComboField = new DecoratedField( composite, SWT.NONE, new IControlCreator()
-        {
-            public Control createControl( Composite parent, int style )
-            {
-                Combo combo = BaseWidgetUtils.createCombo( parent, new String[0], -1, 1 );
-                combo.setVisibleItemCount( 20 );
-                return combo;
-            }
-        } );
-        attributeTypeComboField.addFieldDecoration( fieldDecoration, SWT.TOP | SWT.LEFT,
true );
-        attributeTypeComboField.getLayoutControl().setLayoutData( new GridData( SWT.FILL,
SWT.CENTER, true, false ) );
-        attributeTypeCombo = ( Combo ) attributeTypeComboField.getControl();
-        attributeTypeCombo.setItems( allAtNames );
+        // attribute combo with field decoration and content proposal
+        attributeTypeCombo = BaseWidgetUtils.createCombo( composite, allAtNames, -1, 1 );
         attributeTypeCombo.setText( initialValue );
-
-        // content proposal adapter
-        attributeTypeCPA = new ContentProposalAdapter( attributeTypeCombo, new ComboContentAdapter(),
-            new ListContentProposalProvider( attributeTypeCombo.getItems() ), null, null
);
-        attributeTypeCPA.setFilterStyle( ContentProposalAdapter.FILTER_NONE );
-        attributeTypeCPA.setProposalAcceptanceStyle( ContentProposalAdapter.PROPOSAL_REPLACE
);
+        new ExtendedContentAssistCommandAdapter( attributeTypeCombo, new ComboContentAdapter(),
+            new ListContentProposalProvider( attributeTypeCombo.getItems() ), null, null,
true );
 
         applyDialogFont( composite );
         return composite;
@@ -173,4 +146,5 @@
     {
         return returnValue;
     }
+
 }

Modified: directory/studio/trunk/aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/valueeditors/MaxValueCountValueEditor.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/valueeditors/MaxValueCountValueEditor.java?rev=692258&r1=692257&r2=692258&view=diff
==============================================================================
--- directory/studio/trunk/aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/valueeditors/MaxValueCountValueEditor.java
(original)
+++ directory/studio/trunk/aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/valueeditors/MaxValueCountValueEditor.java
Thu Sep  4 14:38:46 2008
@@ -27,8 +27,9 @@
 import java.util.regex.Pattern;
 
 import org.apache.directory.studio.aciitemeditor.Activator;
-import org.apache.directory.studio.ldapbrowser.common.dialogs.TextDialog;
 import org.apache.directory.studio.connection.ui.widgets.BaseWidgetUtils;
+import org.apache.directory.studio.connection.ui.widgets.ExtendedContentAssistCommandAdapter;
+import org.apache.directory.studio.ldapbrowser.common.dialogs.TextDialog;
 import org.apache.directory.studio.ldapbrowser.common.widgets.ListContentProposalProvider;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 import org.apache.directory.studio.ldapbrowser.core.model.IValue;
@@ -38,11 +39,6 @@
 import org.eclipse.jface.dialogs.Dialog;
 import org.eclipse.jface.dialogs.IDialogConstants;
 import org.eclipse.jface.fieldassist.ComboContentAdapter;
-import org.eclipse.jface.fieldassist.ContentProposalAdapter;
-import org.eclipse.jface.fieldassist.DecoratedField;
-import org.eclipse.jface.fieldassist.FieldDecoration;
-import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
-import org.eclipse.jface.fieldassist.IControlCreator;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
@@ -97,8 +93,8 @@
      */
     public Object getRawValue( IValue value )
     {
-        return value != null ? getRawValue( value.getAttribute().getEntry().getBrowserConnection(),
value.getStringValue() )
-            : null;
+        return value != null ? getRawValue( value.getAttribute().getEntry().getBrowserConnection(),
value
+            .getStringValue() ) : null;
     }
 
 
@@ -189,15 +185,9 @@
         /** The initial max count. */
         private int initialMaxCount;
 
-        /** The attribute type combo field. */
-        private DecoratedField attributeTypeComboField;
-
         /** The attribute type combo. */
         private Combo attributeTypeCombo;
 
-        /** The attribute type content proposal adapter */
-        private ContentProposalAdapter attributeTypeCPA;
-
         /** The max count spinner. */
         private Spinner maxCountSpinner;
 
@@ -278,29 +268,11 @@
             String[] allAtNames = names.toArray( new String[names.size()] );
             Arrays.sort( allAtNames );
 
-            final FieldDecoration fieldDecoration = FieldDecorationRegistry.getDefault().getFieldDecoration(
-                FieldDecorationRegistry.DEC_CONTENT_PROPOSAL );
-            attributeTypeComboField = new DecoratedField( composite, SWT.NONE, new IControlCreator()
-            {
-                public Control createControl( Composite parent, int style )
-                {
-                    Combo combo = BaseWidgetUtils.createCombo( parent, new String[0], -1,
1 );
-                    combo.setVisibleItemCount( 20 );
-                    return combo;
-                }
-            } );
-            attributeTypeComboField.addFieldDecoration( fieldDecoration, SWT.TOP | SWT.LEFT,
true );
-            attributeTypeComboField.getLayoutControl()
-                .setLayoutData( new GridData( SWT.FILL, SWT.CENTER, true, false ) );
-            attributeTypeCombo = ( Combo ) attributeTypeComboField.getControl();
-            attributeTypeCombo.setItems( allAtNames );
+            // attribute combo with field decoration and content proposal
+            attributeTypeCombo = BaseWidgetUtils.createCombo( composite, allAtNames, -1,
1 );
             attributeTypeCombo.setText( initialType );
-
-            // content proposal adapter
-            attributeTypeCPA = new ContentProposalAdapter( attributeTypeCombo, new ComboContentAdapter(),
-                new ListContentProposalProvider( attributeTypeCombo.getItems() ), null, null
);
-            attributeTypeCPA.setFilterStyle( ContentProposalAdapter.FILTER_NONE );
-            attributeTypeCPA.setProposalAcceptanceStyle( ContentProposalAdapter.PROPOSAL_REPLACE
);
+            new ExtendedContentAssistCommandAdapter( attributeTypeCombo, new ComboContentAdapter(),
+                new ListContentProposalProvider( attributeTypeCombo.getItems() ), null, null,
true );
 
             BaseWidgetUtils.createLabel( composite, SEP_MAXCOUNT, 1 );
 

Modified: directory/studio/trunk/aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/valueeditors/RestrictedByValueEditor.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/valueeditors/RestrictedByValueEditor.java?rev=692258&r1=692257&r2=692258&view=diff
==============================================================================
--- directory/studio/trunk/aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/valueeditors/RestrictedByValueEditor.java
(original)
+++ directory/studio/trunk/aciitemeditor/src/main/java/org/apache/directory/studio/aciitemeditor/valueeditors/RestrictedByValueEditor.java
Thu Sep  4 14:38:46 2008
@@ -26,8 +26,9 @@
 import java.util.regex.Pattern;
 
 import org.apache.directory.studio.aciitemeditor.Activator;
-import org.apache.directory.studio.ldapbrowser.common.dialogs.TextDialog;
 import org.apache.directory.studio.connection.ui.widgets.BaseWidgetUtils;
+import org.apache.directory.studio.connection.ui.widgets.ExtendedContentAssistCommandAdapter;
+import org.apache.directory.studio.ldapbrowser.common.dialogs.TextDialog;
 import org.apache.directory.studio.ldapbrowser.common.widgets.ListContentProposalProvider;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 import org.apache.directory.studio.ldapbrowser.core.model.IValue;
@@ -37,11 +38,6 @@
 import org.eclipse.jface.dialogs.Dialog;
 import org.eclipse.jface.dialogs.IDialogConstants;
 import org.eclipse.jface.fieldassist.ComboContentAdapter;
-import org.eclipse.jface.fieldassist.ContentProposalAdapter;
-import org.eclipse.jface.fieldassist.DecoratedField;
-import org.eclipse.jface.fieldassist.FieldDecoration;
-import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
-import org.eclipse.jface.fieldassist.IControlCreator;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
@@ -96,8 +92,8 @@
      */
     public Object getRawValue( IValue value )
     {
-        return value != null ? getRawValue( value.getAttribute().getEntry().getBrowserConnection(),
value.getStringValue() )
-            : null;
+        return value != null ? getRawValue( value.getAttribute().getEntry().getBrowserConnection(),
value
+            .getStringValue() ) : null;
     }
 
 
@@ -190,24 +186,12 @@
         /** The initial values in. */
         private String initialValuesIn;
 
-        /** The type combo field. */
-        private DecoratedField typeComboField;
-
         /** The type combo. */
         private Combo typeCombo;
 
-        /** The type content proposal adapter */
-        private ContentProposalAdapter typeCPA;
-
-        /** The values in combo field. */
-        private DecoratedField valuesInComboField;
-
         /** The values in combo. */
         private Combo valuesInCombo;
 
-        /** The values in content proposal adapter */
-        private ContentProposalAdapter valuesInCPA;
-
         /** The return type. */
         private String returnType;
 
@@ -285,52 +269,19 @@
             String[] allAtNames = names.toArray( new String[names.size()] );
             Arrays.sort( allAtNames );
 
-            final FieldDecoration fieldDecoration = FieldDecorationRegistry.getDefault().getFieldDecoration(
-                FieldDecorationRegistry.DEC_CONTENT_PROPOSAL );
-
-            typeComboField = new DecoratedField( composite, SWT.NONE, new IControlCreator()
-            {
-                public Control createControl( Composite parent, int style )
-                {
-                    Combo combo = BaseWidgetUtils.createCombo( parent, new String[0], -1,
1 );
-                    combo.setVisibleItemCount( 20 );
-                    return combo;
-                }
-            } );
-            typeComboField.addFieldDecoration( fieldDecoration, SWT.TOP | SWT.LEFT, true
);
-            typeComboField.getLayoutControl().setLayoutData( new GridData( SWT.FILL, SWT.CENTER,
true, false ) );
-            typeCombo = ( Combo ) typeComboField.getControl();
-            typeCombo.setItems( allAtNames );
+            // type combo with field decoration and content proposal
+            typeCombo = BaseWidgetUtils.createCombo( composite, allAtNames, -1, 1 );
             typeCombo.setText( initialType );
-
-            // content proposal adapter
-            typeCPA = new ContentProposalAdapter( typeCombo, new ComboContentAdapter(),
-                new ListContentProposalProvider( typeCombo.getItems() ), null, null );
-            typeCPA.setFilterStyle( ContentProposalAdapter.FILTER_NONE );
-            typeCPA.setProposalAcceptanceStyle( ContentProposalAdapter.PROPOSAL_REPLACE );
+            new ExtendedContentAssistCommandAdapter( typeCombo, new ComboContentAdapter(),
+                new ListContentProposalProvider( typeCombo.getItems() ), null, null, true
);
 
             BaseWidgetUtils.createLabel( composite, SEP_VALUESIN, 1 );
 
-            valuesInComboField = new DecoratedField( composite, SWT.NONE, new IControlCreator()
-            {
-                public Control createControl( Composite parent, int style )
-                {
-                    Combo combo = BaseWidgetUtils.createCombo( parent, new String[0], -1,
1 );
-                    combo.setVisibleItemCount( 20 );
-                    return combo;
-                }
-            } );
-            valuesInComboField.addFieldDecoration( fieldDecoration, SWT.TOP | SWT.LEFT, true
);
-            valuesInComboField.getLayoutControl().setLayoutData( new GridData( SWT.FILL,
SWT.CENTER, true, false ) );
-            valuesInCombo = ( Combo ) valuesInComboField.getControl();
-            valuesInCombo.setItems( allAtNames );
+            // valuesIn combo with field decoration and content proposal
+            valuesInCombo = BaseWidgetUtils.createCombo( composite, allAtNames, -1, 1 );
             valuesInCombo.setText( initialValuesIn );
-
-            // content proposal adapter
-            valuesInCPA = new ContentProposalAdapter( valuesInCombo, new ComboContentAdapter(),
-                new ListContentProposalProvider( valuesInCombo.getItems() ), null, null );
-            valuesInCPA.setFilterStyle( ContentProposalAdapter.FILTER_NONE );
-            valuesInCPA.setProposalAcceptanceStyle( ContentProposalAdapter.PROPOSAL_REPLACE
);
+            new ExtendedContentAssistCommandAdapter( valuesInCombo, new ComboContentAdapter(),
+                new ListContentProposalProvider( valuesInCombo.getItems() ), null, null,
true );
 
             BaseWidgetUtils.createLabel( composite, R_CURLY, 1 );
 

Modified: directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/DnBuilderWidget.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/DnBuilderWidget.java?rev=692258&r1=692257&r2=692258&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/DnBuilderWidget.java
(original)
+++ directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/DnBuilderWidget.java
Thu Sep  4 14:38:46 2008
@@ -461,7 +461,6 @@
         GridData gd = new GridData();
         gd.widthHint = 180;
         rdnLine.rdnTypeCombo.setLayoutData( gd );
-        rdnLine.rdnTypeCombo.setVisibleItemCount( 20 );
         rdnLine.rdnNameCPA = new ExtendedContentAssistCommandAdapter( rdnLine.rdnTypeCombo,
new ComboContentAdapter(),
             new ListContentProposalProvider( attributeNames ), null, null, true );
 

Modified: directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/ModWidget.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/ModWidget.java?rev=692258&r1=692257&r2=692258&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/ModWidget.java
(original)
+++ directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/ModWidget.java
Thu Sep  4 14:38:46 2008
@@ -248,7 +248,6 @@
 
         // attribute combo with field decoration and content proposal
         modSpec.modAttributeCombo = BaseWidgetUtils.createCombo( modSpecComposite, new String[0],
-1, 1 );
-        modSpec.modAttributeCombo.setVisibleItemCount( 20 );
         new ExtendedContentAssistCommandAdapter( modSpec.modAttributeCombo, new ComboContentAdapter(),
             new ListContentProposalProvider( attributeDescriptions ), null, null, true );
 

Modified: directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/FilterWidget.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/FilterWidget.java?rev=692258&r1=692257&r2=692258&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/FilterWidget.java
(original)
+++ directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/search/FilterWidget.java
Thu Sep  4 14:38:46 2008
@@ -114,7 +114,6 @@
 
         // filter combo with field decoration and content proposal
         filterCombo = BaseWidgetUtils.createCombo( composite, new String[0], -1, 1 );
-        filterCombo.setVisibleItemCount( 20 );
         filterCombo.addModifyListener( new ModifyListener()
         {
             public void modifyText( ModifyEvent e )

Modified: directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/wizards/AttributeTypeWizardPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/wizards/AttributeTypeWizardPage.java?rev=692258&r1=692257&r2=692258&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/wizards/AttributeTypeWizardPage.java
(original)
+++ directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/wizards/AttributeTypeWizardPage.java
Thu Sep  4 14:38:46 2008
@@ -179,9 +179,7 @@
         BaseWidgetUtils.createLabel( composite, "Attribute type:", 1 );
 
         // attribute combo with field decoration and content proposal
-        attributeTypeCombo = BaseWidgetUtils.createCombo( composite, new String[0], -1, 1
);
-        attributeTypeCombo.setVisibleItemCount( 20 );
-        attributeTypeCombo.setItems( possibleAttributeTypes );
+        attributeTypeCombo = BaseWidgetUtils.createCombo( composite, possibleAttributeTypes,
-1, 1 );
         attributeTypeCombo.setText( parsedAttributeType );
         new ExtendedContentAssistCommandAdapter( attributeTypeCombo, new ComboContentAdapter(),
             new ListContentProposalProvider( possibleAttributeTypes ), null, null, true );

Modified: directory/studio/trunk/valueeditors/src/main/java/org/apache/directory/studio/valueeditors/administrativerole/AdministrativeRoleDialog.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/valueeditors/src/main/java/org/apache/directory/studio/valueeditors/administrativerole/AdministrativeRoleDialog.java?rev=692258&r1=692257&r2=692258&view=diff
==============================================================================
--- directory/studio/trunk/valueeditors/src/main/java/org/apache/directory/studio/valueeditors/administrativerole/AdministrativeRoleDialog.java
(original)
+++ directory/studio/trunk/valueeditors/src/main/java/org/apache/directory/studio/valueeditors/administrativerole/AdministrativeRoleDialog.java
Thu Sep  4 14:38:46 2008
@@ -22,17 +22,13 @@
 
 
 import org.apache.directory.studio.connection.ui.widgets.BaseWidgetUtils;
+import org.apache.directory.studio.connection.ui.widgets.ExtendedContentAssistCommandAdapter;
 import org.apache.directory.studio.ldapbrowser.common.widgets.ListContentProposalProvider;
 import org.apache.directory.studio.valueeditors.ValueEditorsActivator;
 import org.apache.directory.studio.valueeditors.ValueEditorsConstants;
 import org.eclipse.jface.dialogs.Dialog;
 import org.eclipse.jface.dialogs.IDialogConstants;
 import org.eclipse.jface.fieldassist.ComboContentAdapter;
-import org.eclipse.jface.fieldassist.ContentProposalAdapter;
-import org.eclipse.jface.fieldassist.DecoratedField;
-import org.eclipse.jface.fieldassist.FieldDecoration;
-import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
-import org.eclipse.jface.fieldassist.IControlCreator;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.widgets.Combo;
@@ -62,15 +58,9 @@
     /** The initial value. */
     private String initialValue;
 
-    /** The administrative role combo field. */
-    private DecoratedField administrativeRoleComboField;
-
     /** The administrative role combo. */
     private Combo administrativeRoleCombo;
 
-    /** The administrative role content proposal adapter */
-    private ContentProposalAdapter administrativeRoleCPA;
-
     /** The return value. */
     private String returnValue;
 
@@ -132,30 +122,13 @@
         gd.widthHint = convertHorizontalDLUsToPixels( IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH
);
         composite.setLayoutData( gd );
 
-        // combo widget
-        final FieldDecoration fieldDecoration = FieldDecorationRegistry.getDefault().getFieldDecoration(
-            FieldDecorationRegistry.DEC_CONTENT_PROPOSAL );
-        administrativeRoleComboField = new DecoratedField( composite, SWT.NONE, new IControlCreator()
-        {
-            public Control createControl( Composite parent, int style )
-            {
-                Combo combo = BaseWidgetUtils.createCombo( parent, new String[0], -1, 1 );
-                combo.setVisibleItemCount( 20 );
-                return combo;
-            }
-        } );
-        administrativeRoleComboField.addFieldDecoration( fieldDecoration, SWT.TOP | SWT.LEFT,
true );
-        administrativeRoleComboField.getLayoutControl()
-            .setLayoutData( new GridData( SWT.FILL, SWT.CENTER, true, false ) );
-        administrativeRoleCombo = ( Combo ) administrativeRoleComboField.getControl();
+        // attribute combo with field decoration and content proposal
+        administrativeRoleCombo = BaseWidgetUtils.createCombo( composite, new String[0],
-1, 1 );
+        administrativeRoleCombo.setVisibleItemCount( 20 );
         administrativeRoleCombo.setItems( administrativeRoleValues );
         administrativeRoleCombo.setText( initialValue );
-
-        // content proposal adapter
-        administrativeRoleCPA = new ContentProposalAdapter( administrativeRoleCombo, new
ComboContentAdapter(),
-            new ListContentProposalProvider( administrativeRoleCombo.getItems() ), null,
null );
-        administrativeRoleCPA.setFilterStyle( ContentProposalAdapter.FILTER_NONE );
-        administrativeRoleCPA.setProposalAcceptanceStyle( ContentProposalAdapter.PROPOSAL_REPLACE
);
+        new ExtendedContentAssistCommandAdapter( administrativeRoleCombo, new ComboContentAdapter(),
+            new ListContentProposalProvider( administrativeRoleCombo.getItems() ), null,
null, true );
 
         applyDialogFont( composite );
         return composite;
@@ -171,4 +144,5 @@
     {
         return returnValue;
     }
+
 }

Modified: directory/studio/trunk/valueeditors/src/main/java/org/apache/directory/studio/valueeditors/objectclass/ObjectClassDialog.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/valueeditors/src/main/java/org/apache/directory/studio/valueeditors/objectclass/ObjectClassDialog.java?rev=692258&r1=692257&r2=692258&view=diff
==============================================================================
--- directory/studio/trunk/valueeditors/src/main/java/org/apache/directory/studio/valueeditors/objectclass/ObjectClassDialog.java
(original)
+++ directory/studio/trunk/valueeditors/src/main/java/org/apache/directory/studio/valueeditors/objectclass/ObjectClassDialog.java
Thu Sep  4 14:38:46 2008
@@ -24,6 +24,7 @@
 import java.util.Arrays;
 
 import org.apache.directory.studio.connection.ui.widgets.BaseWidgetUtils;
+import org.apache.directory.studio.connection.ui.widgets.ExtendedContentAssistCommandAdapter;
 import org.apache.directory.studio.ldapbrowser.common.widgets.ListContentProposalProvider;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.Schema;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.SchemaUtils;
@@ -32,11 +33,6 @@
 import org.eclipse.jface.dialogs.Dialog;
 import org.eclipse.jface.dialogs.IDialogConstants;
 import org.eclipse.jface.fieldassist.ComboContentAdapter;
-import org.eclipse.jface.fieldassist.ContentProposalAdapter;
-import org.eclipse.jface.fieldassist.DecoratedField;
-import org.eclipse.jface.fieldassist.FieldDecoration;
-import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
-import org.eclipse.jface.fieldassist.IControlCreator;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.widgets.Combo;
@@ -63,15 +59,9 @@
     /** The initial value. */
     private String initialValue;
 
-    /** The object class combo field. */
-    private DecoratedField objectClassComboField;
-
     /** The object class combo. */
     private Combo objectClassCombo;
 
-    /** The object class content proposal adapter */
-    private ContentProposalAdapter objectClassCPA;
-
     /** The return value. */
     private String returnValue;
 
@@ -138,28 +128,13 @@
         String[] allOcNames = SchemaUtils.getNamesAsArray( schema.getObjectClassDescriptions()
);
         Arrays.sort( allOcNames );
 
-        final FieldDecoration fieldDecoration = FieldDecorationRegistry.getDefault().getFieldDecoration(
-            FieldDecorationRegistry.DEC_CONTENT_PROPOSAL );
-        objectClassComboField = new DecoratedField( composite, SWT.NONE, new IControlCreator()
-        {
-            public Control createControl( Composite parent, int style )
-            {
-                Combo combo = BaseWidgetUtils.createCombo( parent, new String[0], -1, 1 );
-                combo.setVisibleItemCount( 20 );
-                return combo;
-            }
-        } );
-        objectClassComboField.addFieldDecoration( fieldDecoration, SWT.TOP | SWT.LEFT, true
);
-        objectClassComboField.getLayoutControl().setLayoutData( new GridData( SWT.FILL, SWT.CENTER,
true, false ) );
-        objectClassCombo = ( Combo ) objectClassComboField.getControl();
+        // attribute combo with field decoration and content proposal
+        objectClassCombo = BaseWidgetUtils.createCombo( composite, new String[0], -1, 1 );
+        objectClassCombo.setVisibleItemCount( 20 );
         objectClassCombo.setItems( allOcNames );
         objectClassCombo.setText( initialValue );
-
-        // content proposal adapter
-        objectClassCPA = new ContentProposalAdapter( objectClassCombo, new ComboContentAdapter(),
-            new ListContentProposalProvider( objectClassCombo.getItems() ), null, null );
-        objectClassCPA.setFilterStyle( ContentProposalAdapter.FILTER_NONE );
-        objectClassCPA.setProposalAcceptanceStyle( ContentProposalAdapter.PROPOSAL_REPLACE
);
+        new ExtendedContentAssistCommandAdapter( objectClassCombo, new ComboContentAdapter(),
+            new ListContentProposalProvider( objectClassCombo.getItems() ), null, null, true
);
 
         applyDialogFont( composite );
         return composite;



Mime
View raw message