directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1805792 [2/2] - /directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/
Date Tue, 22 Aug 2017 16:23:35 GMT
Modified: directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/ServerIdDialog.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/ServerIdDialog.java?rev=1805792&r1=1805791&r2=1805792&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/ServerIdDialog.java
(original)
+++ directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/ServerIdDialog.java
Tue Aug 22 16:23:35 2017
@@ -26,7 +26,6 @@ import org.apache.directory.studio.commo
 import org.apache.directory.studio.common.ui.widgets.BaseWidgetUtils;
 import org.eclipse.jface.dialogs.IDialogConstants;
 import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
 import org.eclipse.swt.events.ModifyListener;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
@@ -90,9 +89,7 @@ public class ServerIdDialog extends AddE
     /**
      * The listener for the ID Text
      */
-    private ModifyListener idTextListener = new ModifyListener()
-    {
-        public void modifyText( ModifyEvent e )
+    private ModifyListener idTextListener = event ->
         {
             Display display = serverIdText.getDisplay();
             Button okButton = getButton( IDialogConstants.OK_ID );
@@ -143,16 +140,13 @@ public class ServerIdDialog extends AddE
                 serverIdText.setForeground( display.getSystemColor( SWT.COLOR_RED ) );
                 okButton.setEnabled( false );
             }
-        }
-    };
+        };
     
     
     /**
      * The listener for the URL Text
      */
-    private ModifyListener urlTextListener = new ModifyListener()
-    {
-        public void modifyText( ModifyEvent e )
+    private ModifyListener urlTextListener = event ->
         {
             Display display = serverIdText.getDisplay();
             Button okButton = getButton( IDialogConstants.OK_ID );
@@ -179,14 +173,13 @@ public class ServerIdDialog extends AddE
                 serverIdText.setForeground( display.getSystemColor( SWT.COLOR_RED ) );
                 okButton.setEnabled( false );
             }
-
-        }
-    };
+        };
             
 
     /**
      * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
      */
+    @Override
     protected void configureShell( Shell shell )
     {
         super.configureShell( shell );
@@ -211,6 +204,7 @@ public class ServerIdDialog extends AddE
      * +---------------------------------------+
      * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
      */
+    @Override
     protected Control createDialogArea( Composite parent )
     {
         Composite composite = ( Composite ) super.createDialogArea( parent );
@@ -293,7 +287,7 @@ public class ServerIdDialog extends AddE
      */
     protected void initDialog()
     {
-        ServerIdWrapper editedElement = (ServerIdWrapper)getEditedElement();
+        ServerIdWrapper editedElement = getEditedElement();
         
         if ( editedElement != null )
         {
@@ -324,7 +318,7 @@ public class ServerIdDialog extends AddE
 
     public void addNewElement( ServerIdWrapper editedElement )
     {
-        ServerIdWrapper newElement = (ServerIdWrapper)editedElement.clone();
+        ServerIdWrapper newElement = editedElement.clone();
         setEditedElement( newElement );
         
     }

Modified: directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/SizeLimitDialog.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/SizeLimitDialog.java?rev=1805792&r1=1805791&r2=1805792&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/SizeLimitDialog.java
(original)
+++ directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/SizeLimitDialog.java
Tue Aug 22 16:23:35 2017
@@ -24,7 +24,6 @@ import org.apache.directory.api.util.Str
 import org.apache.directory.studio.common.ui.widgets.BaseWidgetUtils;
 import org.eclipse.jface.dialogs.IDialogConstants;
 import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
 import org.eclipse.swt.events.ModifyListener;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
@@ -143,6 +142,7 @@ public class SizeLimitDialog extends Abs
      * the values must be numeric, or "unlimited" or "none" or "soft" (for the hard limit).
They
      * also have to be >=0
      */
+    @Override
     protected boolean isValid()
     {
         return super.isValid() && isValidUnchecked() && isValidPr() &&
isValidPrTotal();
@@ -245,9 +245,7 @@ public class SizeLimitDialog extends Abs
     /**
      * The listener for the Unchecked Limit Text
      */
-    private ModifyListener uncheckedLimitTextListener = new ModifyListener()
-    {
-        public void modifyText( ModifyEvent e )
+    private ModifyListener uncheckedLimitTextListener = event ->
         {
             Display display = uncheckedLimitText.getDisplay();
             Button okButton = getButton( IDialogConstants.OK_ID );
@@ -261,7 +259,7 @@ public class SizeLimitDialog extends Abs
                 return;
             }
 
-            SizeLimitWrapper sizeLimitWrapper = (SizeLimitWrapper)getEditedElement();
+            SizeLimitWrapper sizeLimitWrapper = getEditedElement();
             
             // The possible values are : 'unlimited' | 'none' | 'disabled' | INT
             String uncheckedLimitStr = uncheckedLimitText.getText();
@@ -321,16 +319,13 @@ public class SizeLimitDialog extends Abs
             uncheckedDisabledCheckbox.setSelection( disabled );
             limitText.setText( getEditedElement().toString() );
             okButton.setEnabled( isValid() );
-        }
-    };
+        };
 
     
     /**
      * The listener for the pr Limit Text
      */
-    private ModifyListener prLimitTextListener = new ModifyListener()
-    {
-        public void modifyText( ModifyEvent e )
+    private ModifyListener prLimitTextListener = event ->
         {
             Display display = prLimitText.getDisplay();
             Button okButton = getButton( IDialogConstants.OK_ID );
@@ -343,7 +338,7 @@ public class SizeLimitDialog extends Abs
                 return;
             }
 
-            SizeLimitWrapper sizeLimitWrapper = (SizeLimitWrapper)getEditedElement();
+            SizeLimitWrapper sizeLimitWrapper = getEditedElement();
 
             // The possible values are : 'unlimited' | 'none' | 'noEstimate' | INT 
             String prLimitStr = prLimitText.getText();
@@ -392,8 +387,7 @@ public class SizeLimitDialog extends Abs
             prUnlimitedCheckbox.setSelection( unlimited );
             limitText.setText( getEditedElement().toString() );
             okButton.setEnabled( isValid() );
-        }
-    };
+        };
 
     
     
@@ -401,9 +395,7 @@ public class SizeLimitDialog extends Abs
     /**
      * The listener for the prTotal Limit Text
      */
-    private ModifyListener prTotalLimitTextListener = new ModifyListener()
-    {
-        public void modifyText( ModifyEvent e )
+    private ModifyListener prTotalLimitTextListener = event ->
         {
             Display display = prTotalLimitText.getDisplay();
             Button okButton = getButton( IDialogConstants.OK_ID );
@@ -418,7 +410,7 @@ public class SizeLimitDialog extends Abs
                 return;
             }
 
-            SizeLimitWrapper sizeLimitWrapper = (SizeLimitWrapper)getEditedElement();
+            SizeLimitWrapper sizeLimitWrapper = getEditedElement();
 
             // The possible values are : 'unlimited' | 'none' | 'disabled' | 'hard' | INT

             String prTotalLimitStr = prTotalLimitText.getText();
@@ -488,8 +480,7 @@ public class SizeLimitDialog extends Abs
             prTotalHardCheckbox.setSelection( hard );
             limitText.setText( getEditedElement().toString() );
             okButton.setEnabled( isValid() );
-        }
-    };
+        };
     
     
     /**
@@ -497,12 +488,13 @@ public class SizeLimitDialog extends Abs
      */
     private SelectionListener uncheckedUnlimitedCheckboxSelectionListener = new SelectionAdapter()
     {
+        @Override
         public void widgetSelected( SelectionEvent e )
         {
             Display display = uncheckedLimitText.getDisplay();
             Button okButton = getButton( IDialogConstants.OK_ID );
 
-            SizeLimitWrapper sizeLimitWrapper = (SizeLimitWrapper)getEditedElement();
+            SizeLimitWrapper sizeLimitWrapper = getEditedElement();
 
             if ( uncheckedUnlimitedCheckbox.getSelection() )
             {
@@ -528,12 +520,13 @@ public class SizeLimitDialog extends Abs
      */
     private SelectionListener uncheckedDisabledCheckboxSelectionListener = new SelectionAdapter()
     {
+        @Override
         public void widgetSelected( SelectionEvent e )
         {
             Display display = uncheckedLimitText.getDisplay();
             Button okButton = getButton( IDialogConstants.OK_ID );
 
-            SizeLimitWrapper sizeLimitWrapper = (SizeLimitWrapper)getEditedElement();
+            SizeLimitWrapper sizeLimitWrapper = getEditedElement();
 
             if ( uncheckedDisabledCheckbox.getSelection() )
             {
@@ -559,12 +552,13 @@ public class SizeLimitDialog extends Abs
      */
     private SelectionListener prUnlimitedCheckboxSelectionListener = new SelectionAdapter()
     {
+        @Override
         public void widgetSelected( SelectionEvent e )
         {
             Display display = prLimitText.getDisplay();
             Button okButton = getButton( IDialogConstants.OK_ID );
 
-            SizeLimitWrapper sizeLimitWrapper = (SizeLimitWrapper)getEditedElement();
+            SizeLimitWrapper sizeLimitWrapper = getEditedElement();
 
             if ( prUnlimitedCheckbox.getSelection() )
             {
@@ -589,11 +583,12 @@ public class SizeLimitDialog extends Abs
      */
     private SelectionListener prNoEstimateCheckboxSelectionListener = new SelectionAdapter()
     {
+        @Override
         public void widgetSelected( SelectionEvent e )
         {
             Button okButton = getButton( IDialogConstants.OK_ID );
 
-            SizeLimitWrapper sizeLimitWrapper = (SizeLimitWrapper)getEditedElement();
+            SizeLimitWrapper sizeLimitWrapper = getEditedElement();
 
             sizeLimitWrapper.setNoEstimate( prNoEstimateCheckbox.getSelection() );
             limitText.setText( getEditedElement().toString() );
@@ -607,12 +602,13 @@ public class SizeLimitDialog extends Abs
      */
     private SelectionListener prTotalUnlimitedCheckboxSelectionListener = new SelectionAdapter()
     {
+        @Override
         public void widgetSelected( SelectionEvent e )
         {
             Display display = prTotalLimitText.getDisplay();
             Button okButton = getButton( IDialogConstants.OK_ID );
 
-            SizeLimitWrapper sizeLimitWrapper = (SizeLimitWrapper)getEditedElement();
+            SizeLimitWrapper sizeLimitWrapper = getEditedElement();
 
             if ( prTotalUnlimitedCheckbox.getSelection() )
             {
@@ -639,12 +635,13 @@ public class SizeLimitDialog extends Abs
      */
     private SelectionListener prTotalDisabledCheckboxSelectionListener = new SelectionAdapter()
     {
+        @Override
         public void widgetSelected( SelectionEvent e )
         {
             Display display = prTotalLimitText.getDisplay();
             Button okButton = getButton( IDialogConstants.OK_ID );
 
-            SizeLimitWrapper sizeLimitWrapper = (SizeLimitWrapper)getEditedElement();
+            SizeLimitWrapper sizeLimitWrapper = getEditedElement();
 
             if ( prTotalDisabledCheckbox.getSelection() )
             {
@@ -671,12 +668,13 @@ public class SizeLimitDialog extends Abs
      */
     private SelectionListener prTotalHardCheckboxSelectionListener = new SelectionAdapter()
     {
+        @Override
         public void widgetSelected( SelectionEvent e )
         {
             Display display = prTotalLimitText.getDisplay();
             Button okButton = getButton( IDialogConstants.OK_ID );
 
-            SizeLimitWrapper sizeLimitWrapper = (SizeLimitWrapper)getEditedElement();
+            SizeLimitWrapper sizeLimitWrapper = getEditedElement();
 
             if ( prTotalHardCheckbox.getSelection() )
             {
@@ -720,6 +718,7 @@ public class SizeLimitDialog extends Abs
     /**
      * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
      */
+    @Override
     protected void configureShell( Shell shell )
     {
         super.configureShell( shell );
@@ -755,6 +754,7 @@ public class SizeLimitDialog extends Abs
      * </pre>
      * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
      */
+    @Override
     protected Control createDialogArea( Composite parent )
     {
         Composite composite = ( Composite ) super.createDialogArea( parent );
@@ -939,12 +939,13 @@ public class SizeLimitDialog extends Abs
     /**
      * Initializes the UI from the Limit
      */
+    @Override
     protected void initDialog()
     {
         super.initDialog();
         
         // Deal with specific SizeLimit fields
-        LimitWrapper limitWrapper = (LimitWrapper)getEditedElement();
+        LimitWrapper limitWrapper = getEditedElement();
         
         if ( getEditedElement() != null )
         {

Modified: directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/SizeTimeLimitDialog.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/SizeTimeLimitDialog.java?rev=1805792&r1=1805791&r2=1805792&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/SizeTimeLimitDialog.java
(original)
+++ directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/SizeTimeLimitDialog.java
Tue Aug 22 16:23:35 2017
@@ -25,7 +25,6 @@ import org.apache.directory.studio.commo
 import org.apache.directory.studio.common.ui.widgets.BaseWidgetUtils;
 import org.eclipse.jface.dialogs.IDialogConstants;
 import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
 import org.eclipse.swt.events.ModifyListener;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
@@ -136,6 +135,7 @@ public class SizeTimeLimitDialog extends
      **/ 
     private SelectionListener sizeTimeButtonsSelectionListener = new SelectionAdapter()
     {
+        @Override
         public void widgetSelected( SelectionEvent event )
         {
             if ( event.getSource() instanceof Button )
@@ -177,6 +177,7 @@ public class SizeTimeLimitDialog extends
      */
     private SelectionListener sizeLimitEditSelectionListener = new SelectionAdapter()
     {
+        @Override
         public void widgetSelected( SelectionEvent e )
         {
             SizeLimitDialog dialog = new SizeLimitDialog( sizeLimitText.getShell(), sizeLimitText.getText()
);
@@ -199,6 +200,7 @@ public class SizeTimeLimitDialog extends
      */
     private SelectionListener timeLimitEditSelectionListener = new SelectionAdapter()
     {
+        @Override
         public void widgetSelected( SelectionEvent e )
         {
             TimeLimitDialog dialog = new TimeLimitDialog( timeLimitText.getShell(), timeLimitText.getText()
);
@@ -216,9 +218,7 @@ public class SizeTimeLimitDialog extends
     };
 
     
-    protected ModifyListener sizeLimitTextListener = new ModifyListener()
-    {
-        public void modifyText( ModifyEvent e )
+    protected ModifyListener sizeLimitTextListener = event ->
         {
             Button okButton = getButton( IDialogConstants.OK_ID );
 
@@ -244,13 +244,10 @@ public class SizeTimeLimitDialog extends
                 sizeLimitText.setForeground( CommonUIConstants.RED_COLOR );
                 okButton.setEnabled( false );
             }
-        }
-    };
+        };
 
     
-    protected ModifyListener timeLimitTextListener = new ModifyListener()
-    {
-        public void modifyText( ModifyEvent e )
+    protected ModifyListener timeLimitTextListener = event ->
         {
             Button okButton = getButton( IDialogConstants.OK_ID );
 
@@ -276,8 +273,7 @@ public class SizeTimeLimitDialog extends
                 timeLimitText.setForeground( CommonUIConstants.RED_COLOR );
                 okButton.setEnabled( false );
             }
-        }
-    };
+        };
     
     /**
      * Create a new instance of the SizeTimeLimitsDialog
@@ -307,6 +303,7 @@ public class SizeTimeLimitDialog extends
     /**
      * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
      */
+    @Override
     protected void configureShell( Shell shell )
     {
         super.configureShell( shell );
@@ -325,6 +322,7 @@ public class SizeTimeLimitDialog extends
      * </pre>
      * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
      */
+    @Override
     protected Control createDialogArea( Composite parent )
     {
         Composite composite = ( Composite ) super.createDialogArea( parent );
@@ -400,7 +398,7 @@ public class SizeTimeLimitDialog extends
      */
     protected void initDialog()
     {
-        LimitWrapper editedElement = (LimitWrapper)getEditedElement();
+        LimitWrapper editedElement = getEditedElement();
         
         if ( editedElement != null )
         {

Modified: directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/SsfDialog.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/SsfDialog.java?rev=1805792&r1=1805791&r2=1805792&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/SsfDialog.java
(original)
+++ directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/SsfDialog.java
Tue Aug 22 16:23:35 2017
@@ -27,7 +27,6 @@ import org.apache.directory.studio.openl
 import org.apache.directory.studio.openldap.config.editor.wrappers.SsfWrapper;
 import org.eclipse.jface.dialogs.IDialogConstants;
 import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
 import org.eclipse.swt.events.ModifyListener;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
@@ -133,6 +132,7 @@ public class SsfDialog extends AddEditDi
      */
     private SelectionListener featureSelectionListener = new SelectionAdapter()
     {
+        @Override
         public void widgetSelected( SelectionEvent e )
         {
             Object object = e.getSource();
@@ -192,6 +192,7 @@ public class SsfDialog extends AddEditDi
      */
     private SelectionListener checkboxSelectionListener = new SelectionAdapter()
     {
+        @Override
         public void widgetSelected( SelectionEvent e )
         {
             Object object = e.getSource();
@@ -204,7 +205,7 @@ public class SsfDialog extends AddEditDi
                 
                 SsfWrapper ssfWrapper = getEditedElement();
 
-                if ( selectedButton.getSelection() == true )
+                if ( selectedButton.getSelection() )
                 {
                     for ( int i = 0; i < strengthCheckbox.length; i++ )
                     {
@@ -269,9 +270,7 @@ public class SsfDialog extends AddEditDi
     /**
      * The listener for the other Text
      */
-    private ModifyListener otherTextListener = new ModifyListener()
-    {
-        public void modifyText( ModifyEvent e )
+    private ModifyListener otherTextListener = event ->
         {
             Display display = otherText.getDisplay();
             Button okButton = getButton( IDialogConstants.OK_ID );
@@ -306,8 +305,7 @@ public class SsfDialog extends AddEditDi
                 ssfText.setText( getEditedElement().toString() );
                 okButton.setEnabled( false );
             }
-        }
-    };
+        };
 
 
     /**
@@ -325,6 +323,7 @@ public class SsfDialog extends AddEditDi
     /**
      * {@inheritDoc}
      */
+    @Override
     protected void configureShell( Shell shell )
     {
         super.configureShell( shell );
@@ -335,6 +334,7 @@ public class SsfDialog extends AddEditDi
     /**
      * {@inheritDoc}
      */
+    @Override
     protected void okPressed()
     {
         // Do nothing if the selected feature is NONE
@@ -369,6 +369,7 @@ public class SsfDialog extends AddEditDi
      * +-----------------------------------------------+
      * </pre>
      */
+    @Override
     protected Control createDialogArea( Composite parent )
     {
         Composite composite = ( Composite ) super.createDialogArea( parent );
@@ -392,13 +393,14 @@ public class SsfDialog extends AddEditDi
      * 
      * {@inheritDoc}
      */
+    @Override
     protected Button createButton(Composite parent, int id, String label, boolean defaultButton)

     {
         Button button = super.createButton( parent, id, label, defaultButton );
 
         if ( id == IDialogConstants.OK_ID ) 
         {
-            SsfWrapper ssfWrapper = (SsfWrapper)getEditedElement();
+            SsfWrapper ssfWrapper = getEditedElement();
 
             if ( ssfWrapper != null )
             {
@@ -420,7 +422,7 @@ public class SsfDialog extends AddEditDi
      */
     protected void initDialog()
     {
-        SsfWrapper ssfWrapper = (SsfWrapper)getEditedElement();
+        SsfWrapper ssfWrapper = getEditedElement();
         
         if ( ssfWrapper != null )
         {

Modified: directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/StringValueDialog.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/StringValueDialog.java?rev=1805792&r1=1805791&r2=1805792&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/StringValueDialog.java
(original)
+++ directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/StringValueDialog.java
Tue Aug 22 16:23:35 2017
@@ -25,7 +25,6 @@ import org.apache.directory.studio.commo
 import org.apache.directory.studio.common.ui.wrappers.StringValueWrapper;
 import org.eclipse.jface.dialogs.IDialogConstants;
 import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
 import org.eclipse.swt.events.ModifyListener;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
@@ -79,9 +78,7 @@ public class StringValueDialog extends A
     /**
      * The listener for the String Text
      */
-    private ModifyListener stringValueTextListener = new ModifyListener()
-    {
-        public void modifyText( ModifyEvent e )
+    private ModifyListener stringValueTextListener = event ->
         {
             Button okButton = getButton( IDialogConstants.OK_ID );
             
@@ -93,13 +90,13 @@ public class StringValueDialog extends A
 
             getEditedElement().setValue( stringValue.getText() );
             okButton.setEnabled( true );
-        }
-    };
+        };
     
     
     /**
      * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
      */
+    @Override
     protected void configureShell( Shell shell )
     {
         super.configureShell( shell );
@@ -119,6 +116,7 @@ public class StringValueDialog extends A
      * +---------------------------------------+
      * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
      */
+    @Override
     protected Control createDialogArea( Composite parent )
     {
         Composite composite = ( Composite ) super.createDialogArea( parent );
@@ -150,7 +148,7 @@ public class StringValueDialog extends A
      */
     protected void initDialog()
     {
-        StringValueWrapper editedElement = (StringValueWrapper)getEditedElement();
+        StringValueWrapper editedElement = getEditedElement();
         
         if ( editedElement != null )
         {
@@ -184,7 +182,7 @@ public class StringValueDialog extends A
      */
     public void addNewElement( StringValueWrapper editedElement )
     {
-        StringValueWrapper newElement = (StringValueWrapper)editedElement.clone();
+        StringValueWrapper newElement = editedElement.clone();
         setEditedElement( newElement );
     }
 

Modified: directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/TcpBufferDialog.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/TcpBufferDialog.java?rev=1805792&r1=1805791&r2=1805792&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/TcpBufferDialog.java
(original)
+++ directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/TcpBufferDialog.java
Tue Aug 22 16:23:35 2017
@@ -28,7 +28,6 @@ import org.apache.directory.studio.commo
 import org.apache.directory.studio.common.ui.widgets.BaseWidgetUtils;
 import org.eclipse.jface.dialogs.IDialogConstants;
 import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
 import org.eclipse.swt.events.ModifyListener;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
@@ -104,9 +103,7 @@ public class TcpBufferDialog extends Add
     /**
      * The listener for the size Text
      */
-    private ModifyListener sizeTextListener = new ModifyListener()
-    {
-        public void modifyText( ModifyEvent e )
+    private ModifyListener sizeTextListener = event ->
         {
             Display display = tcpBufferText.getDisplay();
             Button okButton = getButton( IDialogConstants.OK_ID );
@@ -154,16 +151,13 @@ public class TcpBufferDialog extends Add
                 tcpBufferText.setForeground( display.getSystemColor( SWT.COLOR_RED ) );
                 okButton.setEnabled( false );
             }
-        }
-    };
+        };
     
     
     /**
      * The listener for the URL Text
      */
-    private ModifyListener urlTextListener = new ModifyListener()
-    {
-        public void modifyText( ModifyEvent e )
+    private ModifyListener urlTextListener = event ->
         {
             Display display = tcpBufferText.getDisplay();
             Button okButton = getButton( IDialogConstants.OK_ID );
@@ -200,8 +194,7 @@ public class TcpBufferDialog extends Add
                 tcpBufferText.setForeground( display.getSystemColor( SWT.COLOR_RED ) );
                 okButton.setEnabled( false );
             }
-        }
-    };
+        };
 
 
     /**
@@ -209,6 +202,7 @@ public class TcpBufferDialog extends Add
      */
     private SelectionListener checkboxSelectionListener = new SelectionAdapter()
     {
+        @Override
         public void widgetSelected( SelectionEvent e )
         {
             Display display = tcpBufferText.getDisplay();
@@ -261,6 +255,7 @@ public class TcpBufferDialog extends Add
     /**
      * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
      */
+    @Override
     protected void configureShell( Shell shell )
     {
         super.configureShell( shell );
@@ -286,6 +281,7 @@ public class TcpBufferDialog extends Add
      * </pre>
      * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
      */
+    @Override
     protected Control createDialogArea( Composite parent )
     {
         Composite composite = ( Composite ) super.createDialogArea( parent );
@@ -375,7 +371,7 @@ public class TcpBufferDialog extends Add
      */
     protected void initDialog()
     {
-        TcpBufferWrapper editedElement = (TcpBufferWrapper)getEditedElement();
+        TcpBufferWrapper editedElement = getEditedElement();
         
         if ( editedElement != null )
         {
@@ -411,7 +407,7 @@ public class TcpBufferDialog extends Add
      */
     protected void addNewElement( TcpBufferWrapper editedElement )
     {
-        TcpBufferWrapper newElement = (TcpBufferWrapper)editedElement.clone();
+        TcpBufferWrapper newElement = editedElement.clone();
         setEditedElement( newElement );
     }
 

Modified: directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/TimeLimitDialog.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/TimeLimitDialog.java?rev=1805792&r1=1805791&r2=1805792&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/TimeLimitDialog.java
(original)
+++ directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/TimeLimitDialog.java
Tue Aug 22 16:23:35 2017
@@ -104,6 +104,7 @@ public class TimeLimitDialog extends Abs
     /**
      * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
      */
+    @Override
     protected void configureShell( Shell shell )
     {
         super.configureShell( shell );
@@ -133,6 +134,7 @@ public class TimeLimitDialog extends Abs
      * </pre>
      * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
      */
+    @Override
     protected Control createDialogArea( Composite parent )
     {
         Composite composite = ( Composite ) super.createDialogArea( parent );

Modified: directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/ValueSortingValueDialog.java
URL: http://svn.apache.org/viewvc/directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/ValueSortingValueDialog.java?rev=1805792&r1=1805791&r2=1805792&view=diff
==============================================================================
--- directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/ValueSortingValueDialog.java
(original)
+++ directory/studio/branches/studio-value/plugins/openldap.config.editor/src/main/java/org/apache/directory/studio/openldap/config/editor/dialogs/ValueSortingValueDialog.java
Tue Aug 22 16:23:35 2017
@@ -24,13 +24,11 @@ import java.text.ParseException;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
-import java.util.Comparator;
 import java.util.List;
 
 import org.apache.directory.api.ldap.model.name.Dn;
 import org.apache.directory.api.ldap.model.schema.AttributeType;
 import org.apache.directory.studio.common.ui.widgets.BaseWidgetUtils;
-import org.apache.directory.studio.common.ui.widgets.WidgetModifyEvent;
 import org.apache.directory.studio.common.ui.widgets.WidgetModifyListener;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 import org.eclipse.jface.dialogs.Dialog;
@@ -39,10 +37,8 @@ import org.eclipse.jface.viewers.ArrayCo
 import org.eclipse.jface.viewers.ComboViewer;
 import org.eclipse.jface.viewers.ISelectionChangedListener;
 import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
 import org.eclipse.jface.viewers.StructuredSelection;
 import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
 import org.eclipse.swt.events.ModifyListener;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.widgets.Button;
@@ -86,24 +82,11 @@ public class ValueSortingValueDialog ext
 
     // Listeners
 
-    private ModifyListener attributeComboViewerListener = new ModifyListener()
-    {
-        public void modifyText( ModifyEvent e )
-        {
-            checkAndUpdateOkButtonEnableState();
-        }
-    };
-    private WidgetModifyListener baseDnEntryWidgetListener = new WidgetModifyListener()
-    {
+    private ModifyListener attributeComboViewerListener = event -> checkAndUpdateOkButtonEnableState();
 
-        public void widgetModified( WidgetModifyEvent event )
-        {
-            checkAndUpdateOkButtonEnableState();
-        }
-    };
-    private ISelectionChangedListener sortMethodComboViewerListener = new ISelectionChangedListener()
-    {
-        public void selectionChanged( SelectionChangedEvent event )
+    private WidgetModifyListener baseDnEntryWidgetListener = event -> checkAndUpdateOkButtonEnableState();
+
+    private ISelectionChangedListener sortMethodComboViewerListener = event ->
         {
             Object selectedSortMethod = getSelectedSortMethod();
 
@@ -116,8 +99,7 @@ public class ValueSortingValueDialog ext
                 secondarySortMethodComboViewer.getCombo().setEnabled( false );
                 secondarySortMethodComboViewer.setSelection( new StructuredSelection( NONE_OPTION
) );
             }
-        }
-    };
+        };
 
 
     /**
@@ -175,7 +157,7 @@ public class ValueSortingValueDialog ext
      */
     private void initAttributeTypesList()
     {
-        connectionAttributeTypes = new ArrayList<String>();
+        connectionAttributeTypes = new ArrayList<>();
 
         if ( browserConnection != null )
         {
@@ -191,13 +173,7 @@ public class ValueSortingValueDialog ext
             }
 
             // Sorting the list
-            Collections.sort( connectionAttributeTypes, new Comparator<String>()
-            {
-                public int compare( String o1, String o2 )
-                {
-                    return o1.compareToIgnoreCase( o2 );
-                }
-            } );
+            Collections.sort( connectionAttributeTypes, ( o1, o2 ) -> o1.compareToIgnoreCase(
o2 ) );
         }
     }
 
@@ -205,6 +181,7 @@ public class ValueSortingValueDialog ext
     /**
      * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
      */
+    @Override
     protected void configureShell( Shell shell )
     {
         super.configureShell( shell );
@@ -215,6 +192,7 @@ public class ValueSortingValueDialog ext
     /**
      * @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
      */
+    @Override
     protected void createButtonsForButtonBar( Composite parent )
     {
         okButton = createButton( parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL,
true );
@@ -227,6 +205,7 @@ public class ValueSortingValueDialog ext
     /**
      * {@inheritDoc}
      */
+    @Override
     protected void okPressed()
     {
         // Attribute
@@ -266,6 +245,7 @@ public class ValueSortingValueDialog ext
     /**
      * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
      */
+    @Override
     protected Control createDialogArea( Composite parent )
     {
         // Creating the dialog composites
@@ -494,6 +474,7 @@ public class ValueSortingValueDialog ext
      */
     private class OlcValSortMethodEnumLabelProvider extends LabelProvider
     {
+        @Override
         public String getText( Object element )
         {
             if ( element instanceof OlcValSortMethodEnum )



Mime
View raw message