/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations
 * under the License.
 *
 */

/*
 * Created on May 21, 2004
 */
package org.apache.jmeter.testbeans.gui;

import java.awt.Component;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import java.beans.PropertyEditorSupport;

import javax.swing.JScrollPane;
import javax.swing.JTextArea;

public class TextAreaEditor extends PropertyEditorSupport implements FocusListener {
    JTextArea textUI;

    JScrollPane scroller;

    /*
     * (non-Javadoc)
     *
     * @see java.awt.event.FocusListener#focusGained(java.awt.event.FocusEvent)
     */
    public void focusGained(FocusEvent e) {

    }

    /*
     * (non-Javadoc)
     *
     * @see java.awt.event.FocusListener#focusLost(java.awt.event.FocusEvent)
     */
    public void focusLost(FocusEvent e) {
        firePropertyChange();

    }

    private void init() {// called from ctor, so must not be overridable
        textUI = new JTextArea();
        textUI.addFocusListener(this);
        textUI.setWrapStyleWord(true);
        textUI.setLineWrap(true);
        scroller = new JScrollPane(textUI, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
                JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    }

    /**
     *
     */
    public TextAreaEditor() {
        super();
        init();

    }

    /**
     * @param source
     */
    public TextAreaEditor(Object source) {
        super(source);
        init();
        setValue(source);
    }

    /*
     * (non-Javadoc)
     *
     * @see java.beans.PropertyEditor#getAsText()
     */
    @Override
    public String getAsText() {
        return textUI.getText();
    }

    /*
     * (non-Javadoc)
     *
     * @see java.beans.PropertyEditor#getCustomEditor()
     */
    @Override
    public Component getCustomEditor() {
        return scroller;
    }

    /*
     * (non-Javadoc)
     *
     * @see java.beans.PropertyEditor#setAsText(java.lang.String)
     */
    @Override
    public void setAsText(String text) throws IllegalArgumentException {
        textUI.setText(text);
    }

    /*
     * (non-Javadoc)
     *
     * @see java.beans.PropertyEditor#setValue(java.lang.Object)
     */
    @Override
    public void setValue(Object value) {
        if (value != null) {
            textUI.setText(value.toString());
        } else {
            textUI.setText("");
        }
    }

    /*
     * (non-Javadoc)
     *
     * @see java.beans.PropertyEditor#getValue()
     */
    @Override
    public Object getValue() {
        return textUI.getText();
    }

    /*
     * (non-Javadoc)
     *
     * @see java.beans.PropertyEditor#supportsCustomEditor()
     */
    @Override
    public boolean supportsCustomEditor() {
        return true;
    }
}

@@ -1163,16 +1163,29 @@
 r %7B%0A    
+%0A    private 
 JTextAre
@@ -1195,24 +1195,32 @@
 extUI;%0A%0A    
+private 
 JScrollPane 
@@ -1240,121 +1240,23 @@
   /*
-%0A     * (non-Javadoc)%0A     *%0A     * @see java.awt.event.FocusListener#focusGained(java.awt.event.FocusEvent)%0A    
+* %7B@inheritDoc%7D
  */%0A
@@ -1299,17 +1299,16 @@
 nt e) %7B%0A
-%0A
     %7D%0A%0A 
@@ -1316,119 +1316,23 @@
   /*
-%0A     * (non-Javadoc)%0A     *%0A     * @see java.awt.event.FocusListener#focusLost(java.awt.event.FocusEvent)%0A    
+* %7B@inheritDoc%7D
  */%0A
@@ -1399,25 +1399,24 @@
 tyChange();%0A
-%0A
     %7D%0A%0A    p
@@ -1864,17 +1864,16 @@
 init();%0A
-%0A
     %7D%0A%0A 
@@ -2033,91 +2033,23 @@
   /*
-%0A     * (non-Javadoc)%0A     *%0A     * @see java.beans.PropertyEditor#getAsText()%0A    
+* %7B@inheritDoc%7D
  */%0A
@@ -2144,97 +2144,23 @@
   /*
-%0A     * (non-Javadoc)%0A     *%0A     * @see java.beans.PropertyEditor#getCustomEditor()%0A    
+* %7B@inheritDoc%7D
  */%0A
@@ -2256,107 +2256,23 @@
   /*
-%0A     * (non-Javadoc)%0A     *%0A     * @see java.beans.PropertyEditor#setAsText(java.lang.String)%0A    
+* %7B@inheritDoc%7D
  */%0A
@@ -2405,106 +2405,23 @@
   /*
-%0A     * (non-Javadoc)%0A     *%0A     * @see java.beans.PropertyEditor#setValue(java.lang.Object)%0A    
+* %7B@inheritDoc%7D
  */%0A
@@ -2626,90 +2626,23 @@
   /*
-%0A     * (non-Javadoc)%0A     *%0A     * @see java.beans.PropertyEditor#getValue()%0A    
+* %7B@inheritDoc%7D
  */%0A
@@ -2736,102 +2736,23 @@
   /*
-%0A     * (non-Javadoc)%0A     *%0A     * @see java.beans.PropertyEditor#supportsCustomEditor()%0A    
+* %7B@inheritDoc%7D
  */%0A

Tidy up