home *** CD-ROM | disk | FTP | other *** search
Java Source | 1997-07-30 | 2.2 KB | 68 lines |
- package borland.samples.intl.beans;
-
- import java.awt.*;
- import java.beans.*;
- import java.util.*;
-
- public class WrappingTextViewerBeanInfo extends SimpleBeanInfo {
-
- private ResourceBundle resourceBundle = ResourceBundle.getBundle("borland.samples.intl.beans.resources.WrappingTextViewerRes");
-
- public PropertyDescriptor[] getPropertyDescriptors() {
- try {
- PropertyDescriptor text = new PropertyDescriptor("text",
- WrappingTextViewer.class);
- text.setShortDescription(resourceBundle.getString("text"));
-
- PropertyDescriptor columnName = new PropertyDescriptor("columnName",
- WrappingTextViewer.class);
- columnName.setShortDescription(resourceBundle.getString("columnName"));
-
- PropertyDescriptor dataSet = new PropertyDescriptor("dataSet",
- WrappingTextViewer.class);
- dataSet.setShortDescription(resourceBundle.getString("dataSet"));
-
- PropertyDescriptor locale = new PropertyDescriptor("locale",
- InternationalClock.class);
-
- PropertyDescriptor background = new PropertyDescriptor("background",
- InternationalClock.class);
-
- PropertyDescriptor foreground = new PropertyDescriptor("foreground",
- InternationalClock.class);
-
- PropertyDescriptor font = new PropertyDescriptor("font",
- InternationalClock.class);
-
- PropertyDescriptor propertyDescriptor[] = { text, columnName, dataSet, locale,
- background, foreground, font };
- return propertyDescriptor;
- } catch (Exception ex) {
- System.err.println("unexpected exeption: " + ex);
- return null;
- }
- }
-
- public EventSetDescriptor[] getEventSetDescriptors() {
- try {
- EventSetDescriptor[] eventDescriptor = new EventSetDescriptor[0];
- return eventDescriptor;
- } catch (IntrospectionException e) {
- e.printStackTrace();
- return null;
- }
- }
-
- public BeanDescriptor getBeanDescriptor() {
- return new BeanDescriptor(WrappingTextViewer.class);
- }
-
- public Image getIcon(int iconKind) {
- if (iconKind == BeanInfo.ICON_COLOR_32x32) {
- return loadImage("resources/WrappingTextViewerIconColor32.gif");
- }
- return null;
- }
-
- }
-