FileDocCategorySizeDatePackage
YesNoDialogMessageEditor.javaAPI DocExample2962Mon May 19 18:23:14 BST 1997oreilly.beans.yesno

YesNoDialogMessageEditor

public class YesNoDialogMessageEditor extends Object implements PropertyEditor
This class is a custom editor for the message property of the YesNoDialog bean. It is necessary because the default editor for properties of type String does not allow multi-line strings to be entered.

Fields Summary
protected String
value
protected PropertyChangeSupport
listeners
Constructors Summary
Methods Summary
public voidaddPropertyChangeListener(java.beans.PropertyChangeListener l)

      
    listeners.addPropertyChangeListener(l);
  
public java.lang.StringgetAsText()

 return value; 
public java.awt.ComponentgetCustomEditor()

    final TextArea t = new TextArea(value);
    t.setSize(300, 150); // TextArea doesn't have a preferred size, so set one
    t.addTextListener(new TextListener() {
      public void textValueChanged(TextEvent e) {
        value = t.getText();
        listeners.firePropertyChange(null, null, null);
      }
    });
    return t;
  
public java.lang.StringgetJavaInitializationString()

 return "\"" + value + "\""; 
public java.lang.String[]getTags()

 return null; 
public java.lang.ObjectgetValue()

 return value; 
public booleanisPaintable()

 return true; 
public voidpaintValue(java.awt.Graphics g, java.awt.Rectangle r)

    g.setClip(r);
    g.drawString("Click to edit...", r.x+5, r.y+15);
  
public voidremovePropertyChangeListener(java.beans.PropertyChangeListener l)

    listeners.removePropertyChangeListener(l);
  
public voidsetAsText(java.lang.String s)

 value = s; 
public voidsetValue(java.lang.Object o)

  value = (String) o; 
public booleansupportsCustomEditor()

 return true;