home *** CD-ROM | disk | FTP | other *** search
Java Source | 1997-07-30 | 3.5 KB | 95 lines |
- package borland.samples.intl.beans;
-
- import java.awt.*;
- import java.beans.*;
- import java.util.*;
-
- import borland.jbcl.editors.*;
-
- public class InternationalClockBeanInfo extends SimpleBeanInfo {
-
- ResourceBundle resourceBundle = ResourceBundle.getBundle("borland.samples.intl.beans.resources.InternationalClockRes");
-
- public PropertyDescriptor[] getPropertyDescriptors() {
- try {
- PropertyDescriptor displayDate = new PropertyDescriptor("displayDate",
- InternationalClock.class);
- displayDate.setShortDescription(resourceBundle.getString("displayDate"));
-
- PropertyDescriptor displayTime = new PropertyDescriptor("displayTime",
- InternationalClock.class);
- displayTime.setShortDescription(resourceBundle.getString("displayTime"));
-
- PropertyDescriptor dateStyle = new PropertyDescriptor("dateStyle",
- InternationalClock.class);
- dateStyle.setPropertyEditorClass(InternationalClockDisplayStyleEditor.class);
- dateStyle.setShortDescription(resourceBundle.getString("dateStyle"));
-
- PropertyDescriptor timeStyle = new PropertyDescriptor("timeStyle",
- InternationalClock.class);
- timeStyle.setPropertyEditorClass(InternationalClockDisplayStyleEditor.class);
- timeStyle.setShortDescription(resourceBundle.getString("timeStyle"));
-
- PropertyDescriptor locale = new PropertyDescriptor("locale",
- InternationalClock.class);
-
- PropertyDescriptor alignment = new PropertyDescriptor("alignment",
- InternationalClock.class);
- alignment.setPropertyEditorClass(InternationalClockAlignmentEditor.class);
-
- PropertyDescriptor background = new PropertyDescriptor("background",
- InternationalClock.class);
-
- PropertyDescriptor foreground = new PropertyDescriptor("foreground",
- InternationalClock.class);
-
- PropertyDescriptor font = new PropertyDescriptor("font",
- InternationalClock.class);
-
- PropertyDescriptor bevelInner = new PropertyDescriptor("bevelInner",
- InternationalClock.class);
- bevelInner.setPropertyEditorClass(BevelTypeEditor.class);
-
- PropertyDescriptor bevelOuter = new PropertyDescriptor("bevelOuter",
- InternationalClock.class);
- bevelOuter.setPropertyEditorClass(BevelTypeEditor.class);
-
- PropertyDescriptor margins = new PropertyDescriptor("margins",
- InternationalClock.class);
-
- PropertyDescriptor clockEnabled = new PropertyDescriptor("clockEnabled",
- InternationalClock.class);
-
- PropertyDescriptor propertyDescriptor[] = { displayDate, displayTime, dateStyle, timeStyle,
- alignment, locale, background, foreground, font,
- bevelInner, bevelOuter, margins, clockEnabled };
- 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(InternationalClock.class);
- }
-
- public Image getIcon(int iconKind) {
- if (iconKind == BeanInfo.ICON_COLOR_32x32) {
- return loadImage("resources/InternationalClockIconColor32.gif");
- }
- return null;
- }
-
- }
-