home *** CD-ROM | disk | FTP | other *** search
/ BUG 15 / BUGCD1998_06.ISO / aplic / jbuilder / jsamples.z / WrappingTextViewerBeanInfo.java < prev    next >
Encoding:
Java Source  |  1997-07-30  |  2.2 KB  |  68 lines

  1. package borland.samples.intl.beans;
  2.  
  3. import java.awt.*;
  4. import java.beans.*;
  5. import java.util.*;
  6.  
  7. public class WrappingTextViewerBeanInfo extends SimpleBeanInfo {
  8.  
  9.   private ResourceBundle resourceBundle = ResourceBundle.getBundle("borland.samples.intl.beans.resources.WrappingTextViewerRes");
  10.  
  11.   public PropertyDescriptor[] getPropertyDescriptors() {
  12.     try {
  13.       PropertyDescriptor text = new PropertyDescriptor("text", 
  14.                                WrappingTextViewer.class);
  15.       text.setShortDescription(resourceBundle.getString("text"));
  16.  
  17.       PropertyDescriptor columnName = new PropertyDescriptor("columnName", 
  18.                                  WrappingTextViewer.class);
  19.       columnName.setShortDescription(resourceBundle.getString("columnName"));
  20.  
  21.       PropertyDescriptor dataSet = new PropertyDescriptor("dataSet", 
  22.                               WrappingTextViewer.class);
  23.       dataSet.setShortDescription(resourceBundle.getString("dataSet"));
  24.  
  25.       PropertyDescriptor locale = new PropertyDescriptor("locale", 
  26.                                InternationalClock.class);
  27.  
  28.       PropertyDescriptor background = new PropertyDescriptor("background", 
  29.                                InternationalClock.class);
  30.  
  31.       PropertyDescriptor foreground = new PropertyDescriptor("foreground", 
  32.                                InternationalClock.class);
  33.  
  34.       PropertyDescriptor font = new PropertyDescriptor("font", 
  35.                                InternationalClock.class);
  36.  
  37.       PropertyDescriptor propertyDescriptor[] = { text, columnName, dataSet, locale,
  38.                           background, foreground, font };
  39.       return propertyDescriptor;
  40.     } catch (Exception ex) {
  41.       System.err.println("unexpected exeption: " + ex);
  42.       return null;
  43.     }
  44.   }
  45.  
  46.   public EventSetDescriptor[] getEventSetDescriptors() {
  47.     try {
  48.       EventSetDescriptor[] eventDescriptor = new EventSetDescriptor[0];
  49.       return eventDescriptor;
  50.     } catch (IntrospectionException e) {
  51.       e.printStackTrace();
  52.       return null;
  53.     }
  54.   }
  55.  
  56.   public BeanDescriptor getBeanDescriptor() {
  57.     return new BeanDescriptor(WrappingTextViewer.class);
  58.   }
  59.  
  60.   public Image getIcon(int iconKind) {
  61.     if (iconKind == BeanInfo.ICON_COLOR_32x32) {
  62.       return loadImage("resources/WrappingTextViewerIconColor32.gif");
  63.     }
  64.     return null;
  65.   }
  66.     
  67. }
  68.