<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://www.jexp.ru/index.php?action=history&amp;feed=atom&amp;title=Java%2FGWT%2FEditable_Label</id>
		<title>Java/GWT/Editable Label - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://www.jexp.ru/index.php?action=history&amp;feed=atom&amp;title=Java%2FGWT%2FEditable_Label"/>
		<link rel="alternate" type="text/html" href="http://www.jexp.ru/index.php?title=Java/GWT/Editable_Label&amp;action=history"/>
		<updated>2026-04-22T22:40:36Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://www.jexp.ru/index.php?title=Java/GWT/Editable_Label&amp;diff=7109&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://www.jexp.ru/index.php?title=Java/GWT/Editable_Label&amp;diff=7109&amp;oldid=prev"/>
				<updated>2010-06-01T06:35:49Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 06:35, 1 июня 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://www.jexp.ru/index.php?title=Java/GWT/Editable_Label&amp;diff=7108&amp;oldid=prev</id>
		<title> в 18:01, 31 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://www.jexp.ru/index.php?title=Java/GWT/Editable_Label&amp;diff=7108&amp;oldid=prev"/>
				<updated>2010-05-31T18:01:44Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Editable Label class ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
package com.jexp.gwt.client;&lt;br /&gt;
import com.google.gwt.user.client.*;&lt;br /&gt;
import com.google.gwt.user.client.ui.*;&lt;br /&gt;
import com.google.gwt.core.client.*;&lt;br /&gt;
public class GWTClient implements EntryPoint{&lt;br /&gt;
  public void onModuleLoad() {&lt;br /&gt;
    EditableLabel label = new EditableLabel(&amp;quot;editable label&amp;quot;,true);&lt;br /&gt;
    label.setText(&amp;quot;click to edit me&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    RootPanel.get().add(label);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
/*&lt;br /&gt;
 * Copyright 2006 Robert Hanson &amp;lt;iamroberthanson AT gmail.ru&amp;gt;&lt;br /&gt;
 * &lt;br /&gt;
 * Licensed under the Apache License, Version 2.0 (the &amp;quot;License&amp;quot;);&lt;br /&gt;
 * you may not use this file except in compliance with the License.&lt;br /&gt;
 * You may obtain a copy of the License at&lt;br /&gt;
 * &lt;br /&gt;
 *    http://www.apache.org/licenses/LICENSE-2.0&lt;br /&gt;
 * &lt;br /&gt;
 * Unless required by applicable law or agreed to in writing, software&lt;br /&gt;
 * distributed under the License is distributed on an &amp;quot;AS IS&amp;quot; BASIS,&lt;br /&gt;
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&lt;br /&gt;
 * See the License for the specific language governing permissions and&lt;br /&gt;
 * limitations under the License.&lt;br /&gt;
 */&lt;br /&gt;
/*&lt;br /&gt;
 * This code is part of the GWT Widget Library&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Editable Label class, funcionality displays a Label UI &lt;br /&gt;
 * Element until clicked on, then if element is set to be &lt;br /&gt;
 * editable (default) then an editable area and Buttons are &lt;br /&gt;
 * displayed instead.&lt;br /&gt;
 *&lt;br /&gt;
 * If the Label is not set to be word wrapped (default) then &lt;br /&gt;
 * the editable area is a Text Box and clicking the OK button &lt;br /&gt;
 * or hitting return key in the TextBox will display the Label with &lt;br /&gt;
 * the updated text. &lt;br /&gt;
 *&lt;br /&gt;
 * If the Label is set to be word wrapped, using the setWordWrap(boolean)&lt;br /&gt;
 * method, then the editable area is a Text Area and clicking the OK &lt;br /&gt;
 * button will display the Label with the updated text.&lt;br /&gt;
 *&lt;br /&gt;
 * In both cases, clicking Cancel button or hitting Escape key in the &lt;br /&gt;
 * TextBox/TextArea then the Label is displayed with original text.&lt;br /&gt;
 * &lt;br /&gt;
 * @author Adam Tacy&lt;br /&gt;
 * @version 0.0.2&lt;br /&gt;
 * &lt;br /&gt;
 * Changes since version 0.0.1&lt;br /&gt;
 * + made cancelLabelChange public [ref request id: 1518134]&lt;br /&gt;
 * + made originalText have default value of empty string [to support ref request id: 1518134] &lt;br /&gt;
 * *End*&lt;br /&gt;
 */&lt;br /&gt;
class EditableLabel extends Composite implements HasWordWrap, &lt;br /&gt;
                                                        HasText,&lt;br /&gt;
                                                        HasHorizontalAlignment,&lt;br /&gt;
                                                        SourcesClickEvents,&lt;br /&gt;
                                                        SourcesChangeEvents,&lt;br /&gt;
                                                        SourcesMouseEvents&lt;br /&gt;
{&lt;br /&gt;
    /**&lt;br /&gt;
     * TextBox element to enable text to be changed if Label is not word wrapped&lt;br /&gt;
     */&lt;br /&gt;
    private TextBox changeText;&lt;br /&gt;
    /**&lt;br /&gt;
     * TextArea element to enable text to be changed if Label is wordwrapped&lt;br /&gt;
     */&lt;br /&gt;
    private TextArea changeTextArea;&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * Label element, which is initially is diplayed.&lt;br /&gt;
     */&lt;br /&gt;
    private Label text;&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * String element that contains the original text of a&lt;br /&gt;
     * Label prior to it being edited.&lt;br /&gt;
     */&lt;br /&gt;
    private String originalText;&lt;br /&gt;
    /**&lt;br /&gt;
     * Simple button to confirm changes&lt;br /&gt;
     */&lt;br /&gt;
    private Widget confirmChange;&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * Simple button to cancel changes&lt;br /&gt;
     */&lt;br /&gt;
    private Widget cancelChange;&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * Flag to indicate that Label is in editing mode.&lt;br /&gt;
     */&lt;br /&gt;
    private boolean isEditing = false;&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * Flag to indicate that label can be edited.&lt;br /&gt;
     */&lt;br /&gt;
    private boolean isEditable = true;&lt;br /&gt;
  ChangeListenerCollection changeListeners;&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * Default String value for OK button&lt;br /&gt;
     */&lt;br /&gt;
    private String defaultOkButtonText = &amp;quot;OK&amp;quot;;&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * Default String value for Cancel button&lt;br /&gt;
     */&lt;br /&gt;
    private String defaultCancelButtonText = &amp;quot;Cancel&amp;quot;;&lt;br /&gt;
    /**&lt;br /&gt;
     * Allows the setting of the isEditable flag, marking &lt;br /&gt;
     * the label as editable or not.&lt;br /&gt;
     *&lt;br /&gt;
     * @param flag True or False value depending if the Label is to be editable or not&lt;br /&gt;
     */&lt;br /&gt;
    public void setEditable (boolean flag)&lt;br /&gt;
    {&lt;br /&gt;
        isEditable = flag;&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * Returns the value of the isEditable flag.&lt;br /&gt;
     *&lt;br /&gt;
     * @return&lt;br /&gt;
     */&lt;br /&gt;
    public boolean isFieldEditable ()&lt;br /&gt;
    {&lt;br /&gt;
        return isEditable;&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * Returns the value of the isEditing flag, allowing outside &lt;br /&gt;
     * users to see if the Label is being edited or not.&lt;br /&gt;
     *&lt;br /&gt;
     * @return&lt;br /&gt;
     */&lt;br /&gt;
    public boolean isInEditingMode ()&lt;br /&gt;
    {&lt;br /&gt;
        return isEditing;&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * Change the displayed label to be a TextBox and copy label &lt;br /&gt;
     * text into the TextBox.&lt;br /&gt;
     *&lt;br /&gt;
     */&lt;br /&gt;
    private void changeTextLabel ()&lt;br /&gt;
    {&lt;br /&gt;
        if (isEditable) {&lt;br /&gt;
            // Set up the TextBox&lt;br /&gt;
            originalText = text.getText();&lt;br /&gt;
            &lt;br /&gt;
            // Change the view from Label to TextBox and Buttons&lt;br /&gt;
            text.setVisible(false);&lt;br /&gt;
            confirmChange.setVisible(true);&lt;br /&gt;
            cancelChange.setVisible(true);&lt;br /&gt;
            if (text.getWordWrap()){&lt;br /&gt;
                // If Label word wrapped use the TextArea to edit&lt;br /&gt;
                changeTextArea.setText(originalText);&lt;br /&gt;
                changeTextArea.setVisible(true);&lt;br /&gt;
                changeTextArea.setFocus(true);&lt;br /&gt;
            } else {&lt;br /&gt;
                // Otherwise use the TextBox to edit.&lt;br /&gt;
                changeText.setText(originalText);&lt;br /&gt;
                changeText.setVisible(true);&lt;br /&gt;
                changeText.setFocus(true);&lt;br /&gt;
            }&lt;br /&gt;
            &lt;br /&gt;
            //Set instance as being in editing mode.&lt;br /&gt;
            isEditing = true;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * Restores visibility of Label and hides the TextBox and Buttons&lt;br /&gt;
     *&lt;br /&gt;
     */&lt;br /&gt;
    private void restoreVisibility ()&lt;br /&gt;
    {&lt;br /&gt;
        // Change appropriate visibilities&lt;br /&gt;
        text.setVisible(true);&lt;br /&gt;
        confirmChange.setVisible(false);&lt;br /&gt;
        cancelChange.setVisible(false);&lt;br /&gt;
        if(text.getWordWrap()){&lt;br /&gt;
            // If Label is word wrapped hide the TextArea&lt;br /&gt;
            changeTextArea.setVisible(false);&lt;br /&gt;
        } else {&lt;br /&gt;
            // Otherwise hide the TextBox&lt;br /&gt;
            changeText.setVisible(false);&lt;br /&gt;
        }&lt;br /&gt;
        // Set isEditing flag to false as we are no longer editing&lt;br /&gt;
        isEditing = false;&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * Sets the Label text to the new value, restores the &lt;br /&gt;
     * display and calls the update method.&lt;br /&gt;
     *&lt;br /&gt;
     */&lt;br /&gt;
    private void setTextLabel ()&lt;br /&gt;
    {&lt;br /&gt;
        if(text.getWordWrap()){&lt;br /&gt;
            // Set the Label to be the text in the Text Box&lt;br /&gt;
            text.setText(changeTextArea.getText());        &lt;br /&gt;
        } else {&lt;br /&gt;
            // Set the Label to be the text in the Text Box&lt;br /&gt;
            text.setText(changeText.getText());&lt;br /&gt;
        }&lt;br /&gt;
        // Set the object back to display label rather than TextBox and Buttons&lt;br /&gt;
        restoreVisibility();&lt;br /&gt;
        // Call the update method provided in the Constructor&lt;br /&gt;
        // (this could be anything from alerting the user through to&lt;br /&gt;
        // Making an AJAX call to store the data.&lt;br /&gt;
        //updater.onChange(this);&lt;br /&gt;
        if (changeListeners!=null)changeListeners.fireChange(this);&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * Sets the Label text to the original value, restores the display.&lt;br /&gt;
     *&lt;br /&gt;
     */&lt;br /&gt;
    public void cancelLabelChange ()&lt;br /&gt;
    {&lt;br /&gt;
        // Set the Label text back to what it was originally&lt;br /&gt;
        text.setText(originalText);         &lt;br /&gt;
        // Set the object back to display Label rather than TextBox and Buttons&lt;br /&gt;
        restoreVisibility();&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * Creates the Label, the TextBox and Buttons.  Also associates&lt;br /&gt;
     * the update method provided in the constructor with this instance.&lt;br /&gt;
     * &lt;br /&gt;
     * @param labelText The value of the initial Label.&lt;br /&gt;
     * @param visibleLength The visible length (width) of the TextBox/TextArea.&lt;br /&gt;
     * @param maxLength The maximum length of text in the TextBox.&lt;br /&gt;
     * @param maxHeight The maximum number of visible lines of the TextArea&lt;br /&gt;
     * @param okButtonText The text diplayed in the OK button.&lt;br /&gt;
     * @param cancelButtonText The text displayed in the Cancel button.&lt;br /&gt;
     */&lt;br /&gt;
    private void createEditableLabel (String labelText,&lt;br /&gt;
            String okButtonText, String cancelButtonText)&lt;br /&gt;
    {&lt;br /&gt;
        // Put everything in a VerticalPanel&lt;br /&gt;
        FlowPanel instance = new FlowPanel();&lt;br /&gt;
        // Create the Label element and add a ClickListener to call out Change method when clicked&lt;br /&gt;
        text = new Label(labelText);&lt;br /&gt;
        text.setStyleName(&amp;quot;editableLabel-label&amp;quot;);&lt;br /&gt;
        text.addClickListener(new ClickListener()&lt;br /&gt;
        {&lt;br /&gt;
            public void onClick (Widget sender)&lt;br /&gt;
            {&lt;br /&gt;
                changeTextLabel();&lt;br /&gt;
            }&lt;br /&gt;
        });&lt;br /&gt;
        // Create the TextBox element used for non word wrapped Labels &lt;br /&gt;
        // and add a KeyboardListener for Return and Esc key presses&lt;br /&gt;
        changeText = new TextBox();&lt;br /&gt;
        changeText.setStyleName(&amp;quot;editableLabel-textBox&amp;quot;);&lt;br /&gt;
        changeText.addKeyboardListener(new KeyboardListenerAdapter()&lt;br /&gt;
        {&lt;br /&gt;
            public void onKeyPress (Widget sender, char keyCode, int modifiers)&lt;br /&gt;
            {&lt;br /&gt;
                // If return then save, if Esc cancel the change, otherwise do nothing&lt;br /&gt;
                switch (keyCode) {&lt;br /&gt;
                    case 13:&lt;br /&gt;
                        setTextLabel();&lt;br /&gt;
                        break;&lt;br /&gt;
                    case 27:&lt;br /&gt;
                        cancelLabelChange();&lt;br /&gt;
                        break;&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        });&lt;br /&gt;
        // Create the TextAre element used for word-wrapped Labels &lt;br /&gt;
        // and add a KeyboardListener for Esc key presses (not return in this case)&lt;br /&gt;
        changeTextArea = new TextArea();&lt;br /&gt;
        changeTextArea.setStyleName(&amp;quot;editableLabel-textArea&amp;quot;);&lt;br /&gt;
        &lt;br /&gt;
        changeTextArea.addKeyboardListener(new KeyboardListenerAdapter()&lt;br /&gt;
        {&lt;br /&gt;
            public void onKeyPress (Widget sender, char keyCode, int modifiers)&lt;br /&gt;
            {&lt;br /&gt;
                // If Esc then cancel the change, otherwise do nothing&lt;br /&gt;
                switch (keyCode) {&lt;br /&gt;
                    case 27:&lt;br /&gt;
                        cancelLabelChange();&lt;br /&gt;
                        break;&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        });&lt;br /&gt;
        &lt;br /&gt;
        &lt;br /&gt;
        // Set up Confirmation Button&lt;br /&gt;
        confirmChange = createConfirmButton(okButtonText);&lt;br /&gt;
        if (!(confirmChange instanceof SourcesClickEvents)) {&lt;br /&gt;
            throw new RuntimeException(&amp;quot;Confirm change button must allow for click events&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        ((SourcesClickEvents) confirmChange).addClickListener(new ClickListener()&lt;br /&gt;
        {&lt;br /&gt;
            public void onClick (Widget sender)&lt;br /&gt;
            {&lt;br /&gt;
                setTextLabel();&lt;br /&gt;
            }&lt;br /&gt;
        });&lt;br /&gt;
        // Set up Cancel Button&lt;br /&gt;
        cancelChange = createCancelButton(cancelButtonText);&lt;br /&gt;
        if (!(cancelChange instanceof SourcesClickEvents)) {&lt;br /&gt;
            throw new RuntimeException(&amp;quot;Cancel change button must allow for click events&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        ((SourcesClickEvents)cancelChange).addClickListener(new ClickListener()&lt;br /&gt;
        {&lt;br /&gt;
            public void onClick (Widget sender)&lt;br /&gt;
            {&lt;br /&gt;
                cancelLabelChange();&lt;br /&gt;
            }&lt;br /&gt;
        });&lt;br /&gt;
        &lt;br /&gt;
        // Put the buttons in a panel&lt;br /&gt;
        FlowPanel buttonPanel = new FlowPanel();&lt;br /&gt;
        buttonPanel.setStyleName(&amp;quot;editableLabel-buttonPanel&amp;quot;);&lt;br /&gt;
        buttonPanel.add(confirmChange);&lt;br /&gt;
        buttonPanel.add(cancelChange);&lt;br /&gt;
        &lt;br /&gt;
        // Add panels/widgets to the widget panel&lt;br /&gt;
        instance.add(text);&lt;br /&gt;
        instance.add(changeText);&lt;br /&gt;
        instance.add(changeTextArea);&lt;br /&gt;
        instance.add(buttonPanel);&lt;br /&gt;
        // Set initial visibilities.  This needs to be after&lt;br /&gt;
        // adding the widgets to the panel because the FlowPanel&lt;br /&gt;
        // will mess them up when added.&lt;br /&gt;
        text.setVisible(true);&lt;br /&gt;
        changeText.setVisible(false);&lt;br /&gt;
        changeTextArea.setVisible(false);&lt;br /&gt;
        confirmChange.setVisible(false);&lt;br /&gt;
        cancelChange.setVisible(false);&lt;br /&gt;
        // Assume that this is a non word wrapped Label unless explicitly set otherwise&lt;br /&gt;
        text.setWordWrap(false);&lt;br /&gt;
        &lt;br /&gt;
        // Set the widget that this Composite represents&lt;br /&gt;
        initWidget(instance);&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * @param cancelButtonText&lt;br /&gt;
     */&lt;br /&gt;
    protected Widget createCancelButton (String cancelButtonText)&lt;br /&gt;
    {&lt;br /&gt;
        Button result = new Button();&lt;br /&gt;
        result.setStyleName(&amp;quot;editableLabel-buttons&amp;quot;);&lt;br /&gt;
        result.addStyleName(&amp;quot;editableLabel-cancel&amp;quot;);&lt;br /&gt;
        result.setText(cancelButtonText);&lt;br /&gt;
        return result;&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * @param okButtonText&lt;br /&gt;
     */&lt;br /&gt;
    protected Widget createConfirmButton (String okButtonText)&lt;br /&gt;
    {&lt;br /&gt;
        Button result = new Button();&lt;br /&gt;
        result.setStyleName(&amp;quot;editableLabel-buttons&amp;quot;);&lt;br /&gt;
        result.addStyleName(&amp;quot;editableLabel-confirm&amp;quot;);&lt;br /&gt;
        result.setText(okButtonText);&lt;br /&gt;
        return result;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Set the word wrapping on the label (if word wrapped then the editable&lt;br /&gt;
     * field becomes a TextArea, if not then the editable field is a TextBox.&lt;br /&gt;
     * @param b Boolean value, true means Label is word wrapped, false means it is not. &lt;br /&gt;
     */&lt;br /&gt;
    public void setWordWrap(boolean b) {&lt;br /&gt;
        text.setWordWrap(b);&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * Return whether the Label is word wrapped or not.&lt;br /&gt;
     */&lt;br /&gt;
    public boolean getWordWrap() {&lt;br /&gt;
        return text.getWordWrap();&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * Return the text value of the Label&lt;br /&gt;
     */&lt;br /&gt;
    public String getText() {&lt;br /&gt;
        return text.getText();&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * Set the text value of the Label &lt;br /&gt;
     */&lt;br /&gt;
    public void setText(String newText) {&lt;br /&gt;
        text.setText(newText);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * Sets the number of visible lines for a word-wrapped editable label.&lt;br /&gt;
     * @param number Number of visible lines.&lt;br /&gt;
     * @throws RuntimeException if the editable label is not word-wrapped.&lt;br /&gt;
     */public void setVisibleLines(int number){&lt;br /&gt;
        if (text.getWordWrap()){&lt;br /&gt;
            changeTextArea.setVisibleLines(number); &lt;br /&gt;
        } else {&lt;br /&gt;
            throw new RuntimeException(&amp;quot;Cannnot set number of visible lines for a non word-wrapped Editable Label&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * Get the number of Visible Lines of editable area of a word-wrapped editable Label.&lt;br /&gt;
     * @return Number of Visible Lines.&lt;br /&gt;
     * @throws RuntimeException If the Label is not word-wrapped.&lt;br /&gt;
     */&lt;br /&gt;
    public int getVisibleLines(){&lt;br /&gt;
        if (text.getWordWrap()){&lt;br /&gt;
            return changeTextArea.getVisibleLines();    &lt;br /&gt;
        } else {&lt;br /&gt;
            throw new RuntimeException(&amp;quot;Editable Label that is not word-wrapped has no number of Visible Lines&amp;quot;);&lt;br /&gt;
        }       &lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * Set maximum length of editable area.&lt;br /&gt;
     * @param length Length of editable area.&lt;br /&gt;
     */&lt;br /&gt;
    public void setMaxLength(int length){&lt;br /&gt;
        if (text.getWordWrap()){&lt;br /&gt;
            changeTextArea.setCharacterWidth(length);&lt;br /&gt;
        } else {&lt;br /&gt;
            changeText.setMaxLength(length);    &lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * Get maximum length of editable area.&lt;br /&gt;
     * @return maximum length of editable area.&lt;br /&gt;
     */&lt;br /&gt;
    public int getMaxLength(){&lt;br /&gt;
        if (text.getWordWrap()){&lt;br /&gt;
            return changeTextArea.getCharacterWidth();&lt;br /&gt;
        } else {&lt;br /&gt;
            return changeText.getMaxLength();   &lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * Set the visible length of the editable area.&lt;br /&gt;
     * @throws RuntimeExcpetion If editable label is word wrapped. &lt;br /&gt;
     */&lt;br /&gt;
    public void setVisibleLength(int length){&lt;br /&gt;
        if (text.getWordWrap()){&lt;br /&gt;
            throw new RuntimeException(&amp;quot;Cannnot set visible length for a word-wrapped Editable Label&amp;quot;);&lt;br /&gt;
        } else {&lt;br /&gt;
            changeText.setVisibleLength(length);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * Get the visible length of the editable area.&lt;br /&gt;
     * @return Visible length of editable area if not a word wrapped label.&lt;br /&gt;
     * @throws RuntimeExcpetion If editable label is word wrapped. &lt;br /&gt;
     */&lt;br /&gt;
    public int getVisibleLength(){&lt;br /&gt;
        if (text.getWordWrap()){&lt;br /&gt;
            throw new RuntimeException(&amp;quot;Cannnot get visible length for a word-wrapped Editable Label&amp;quot;);&lt;br /&gt;
        } else {&lt;br /&gt;
            return changeText.getVisibleLength();&lt;br /&gt;
        }       &lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * Constructor that changes default text for buttons and allows the setting of the wordwrap property directly.&lt;br /&gt;
     * &lt;br /&gt;
     * @param labelText  The initial text of the label.&lt;br /&gt;
     * @param onUpdate Handler object for performing actions once label is updated.&lt;br /&gt;
     * @param okText Text for use in overiding the default OK button text.&lt;br /&gt;
     * @param cancelText Text for use in overiding the default CANCEL button text.&lt;br /&gt;
     * @param wordWrap Boolean representing if the label should be word wrapped or not&lt;br /&gt;
     */&lt;br /&gt;
    public EditableLabel (String labelText, String okText,&lt;br /&gt;
            String cancelText, boolean wordWrap)&lt;br /&gt;
    {&lt;br /&gt;
        createEditableLabel(labelText, okText, cancelText);&lt;br /&gt;
        text.setWordWrap(wordWrap);&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * Constructor that uses default text values for buttons and sets the word wrap property.  &lt;br /&gt;
     * &lt;br /&gt;
     * @param labelText  The initial text of the label.&lt;br /&gt;
     * @param onUpdate Handler object for performing actions once label is updated.&lt;br /&gt;
     * @param wordWrap Boolean representing if the label should be word wrapped or not&lt;br /&gt;
     */&lt;br /&gt;
    public EditableLabel (String labelText, boolean wordWrap)&lt;br /&gt;
    {&lt;br /&gt;
          createEditableLabel(labelText, defaultOkButtonText, defaultCancelButtonText);&lt;br /&gt;
          text.setWordWrap(wordWrap);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * Constructor that changes default button text.&lt;br /&gt;
     * &lt;br /&gt;
     * @param labelText  The initial text of the label.&lt;br /&gt;
     * @param onUpdate Handler object for performing actions once label is updated.&lt;br /&gt;
     * @param okText Text for use in overiding the default OK button text.&lt;br /&gt;
     * @param cancelText Text for use in overiding the default CANCEL button text.&lt;br /&gt;
     */&lt;br /&gt;
    public EditableLabel (String labelText, String okText,&lt;br /&gt;
            String cancelText)&lt;br /&gt;
    {&lt;br /&gt;
        createEditableLabel(labelText, okText, cancelText);&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * Constructor that uses default text values for buttons.  &lt;br /&gt;
     * &lt;br /&gt;
     * @param labelText The initial text of the label.&lt;br /&gt;
     * @param onUpdate Handler object for performing actions once label is updated.&lt;br /&gt;
     */&lt;br /&gt;
    public EditableLabel (String labelText)&lt;br /&gt;
    {&lt;br /&gt;
          createEditableLabel(labelText, defaultOkButtonText, defaultCancelButtonText);&lt;br /&gt;
    }&lt;br /&gt;
  public HorizontalAlignmentConstant getHorizontalAlignment() {&lt;br /&gt;
    return text.getHorizontalAlignment();&lt;br /&gt;
  }&lt;br /&gt;
  public void setHorizontalAlignment(HorizontalAlignmentConstant align) {&lt;br /&gt;
    text.setHorizontalAlignment(align);&lt;br /&gt;
  }&lt;br /&gt;
  public void addClickListener(ClickListener listener) {&lt;br /&gt;
    this.text.addClickListener(listener);&lt;br /&gt;
  }&lt;br /&gt;
  public void removeClickListener(ClickListener listener) {&lt;br /&gt;
    this.text.removeClickListener(listener);&lt;br /&gt;
  }&lt;br /&gt;
  public void addMouseListener(MouseListener listener) {&lt;br /&gt;
    this.text.addMouseListener(listener);&lt;br /&gt;
    &lt;br /&gt;
  }&lt;br /&gt;
  public void removeMouseListener(MouseListener listener) {&lt;br /&gt;
    this.text.removeMouseListener(listener);  &lt;br /&gt;
  }&lt;br /&gt;
  &lt;br /&gt;
  public void addChangeListener(ChangeListener listener) {&lt;br /&gt;
    if (changeListeners == null){&lt;br /&gt;
      changeListeners = new ChangeListenerCollection();&lt;br /&gt;
    }&lt;br /&gt;
    changeListeners.add(listener);&lt;br /&gt;
  }&lt;br /&gt;
  public void removeChangeListener(ChangeListener listener) {&lt;br /&gt;
    if (changeListeners != null){&lt;br /&gt;
      changeListeners.remove(listener);;&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;/div&gt;</summary>
			</entry>

	</feed>