ref #9359 upgrade TaxEditor to log4j2
[taxeditor.git] / eu.etaxonomy.taxeditor.editor / src / main / java / eu / etaxonomy / taxeditor / editor / name / container / LineWrapSupport.java
index 670ca6c319da0ad6c11669c7af47253087233c77..f91e79fc864cdd1481dbb3a4e438762431f23800 100644 (file)
@@ -1,14 +1,14 @@
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
 package eu.etaxonomy.taxeditor.editor.name.container;
 
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
 import org.eclipse.jface.text.TextViewer;
 import org.eclipse.swt.custom.StyledText;
 import org.eclipse.swt.events.ModifyEvent;
@@ -28,9 +28,8 @@ import org.eclipse.ui.forms.widgets.ScrolledForm;
  * @created 19.05.2008
  */
 public class LineWrapSupport {
-       private static final Logger logger = Logger
-                       .getLogger(LineWrapSupport.class);
-       
+       private static final Logger logger = LogManager.getLogger(LineWrapSupport.class);
+
        ModifyListener listener = new LineWrapListener();
        int lineCount;
 
@@ -38,7 +37,7 @@ public class LineWrapSupport {
        private ScrolledForm scrolledForm;
 
 //     private TextViewer viewer;
-       
+
        /**
         * <p>Constructor for LineWrapSupport.</p>
         *
@@ -49,25 +48,25 @@ public class LineWrapSupport {
 //             return viewer;
 //     }
        public LineWrapSupport(TextViewer viewer, IManagedForm form) {
-               
+
                if (viewer == null) {
                        throw new IllegalArgumentException(
                                        "The provided TextViewer object is null."); //$NON-NLS-1$
                }
-               
+
 //             this.viewer = viewer;
-               
+
                textWidget = viewer.getTextWidget();
                textWidget.addModifyListener(listener);
-                               
+
                this.lineCount = textWidget.getLinePixel(textWidget.getLineCount());
                this.scrolledForm = form.getForm();
-               
+
                logger.trace(this.getClass().getSimpleName() + " created"); //$NON-NLS-1$
        }
-       
+
        /**
-        * Redraws the scrolledForm if a line wrap is detected. 
+        * Redraws the scrolledForm if a line wrap is detected.
         */
        private void checkLineCount() {
 
@@ -76,16 +75,17 @@ public class LineWrapSupport {
                        scrolledForm.getBody().layout();
                }
        }
-       
+
        /**
         * Calls <code>checkLineCount()</code> on a modify event.
-        * 
+        *
         * @author p.ciardelli
         * @created 21.05.2008
         */
        class LineWrapListener implements ModifyListener {
 
-               public void modifyText(ModifyEvent e) {
+               @Override
+        public void modifyText(ModifyEvent e) {
                        checkLineCount();
                }
        }