home *** CD-ROM | disk | FTP | other *** search
/ Symantec Visual Cafe for Java 2.5 / symantec-visual-cafe-2.5-database-dev-edition.iso / VCafe / prosrc.bin / DataBindingEditor.java < prev    next >
Encoding:
Java Source  |  1998-03-18  |  949 b   |  47 lines

  1. /*
  2.  * @(#DataBindingEditor.java
  3.  *
  4.  * Copyright (c) 1997 Symantec Corporation. All Rights Reserved.
  5.  *
  6.  */
  7.  
  8. package symantec.itools.db.beans.binding;
  9.  
  10. import java.util.*;
  11.  
  12. public class DataBindingEditor extends NameEditor
  13. {
  14.     public DataBindingEditor()
  15.     {
  16.         super();
  17.     }
  18.  
  19.     public void setValue(Object value)
  20.     {
  21.         if (value != null && value instanceof DataBinding) {
  22.             String text = ((DataBinding)value).getFullName();
  23.             setAsText(text);
  24.         }
  25.     }
  26.  
  27.     public String getJavaInitializationString()
  28.     {
  29.         return "new DataBinding(\"" + getAsText() + "\")";
  30.     }
  31.  
  32.     public Object getValue()
  33.     {
  34.         String value = (String)super.getValue();
  35.         return new DataBinding(value);
  36.     }
  37.  
  38.     public String getAsText()
  39.     {
  40.         return (String)super.getValue();
  41.     }
  42.  
  43.     public java.awt.Component getCustomEditor()
  44.     {
  45.         return this;
  46.     }
  47. }