home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-05-08 | 4.9 KB | 109 lines |
- /*
- * Copyright (c) 1997-1998 Borland International, Inc. All Rights Reserved.
- *
- * This SOURCE CODE FILE, which has been provided by Borland as part
- * of a Borland product for use ONLY by licensed users of the product,
- * includes CONFIDENTIAL and PROPRIETARY information of Borland.
- *
- * USE OF THIS SOFTWARE IS GOVERNED BY THE TERMS AND CONDITIONS
- * OF THE LICENSE STATEMENT AND LIMITED WARRANTY FURNISHED WITH
- * THE PRODUCT.
- *
- * IN PARTICULAR, YOU WILL INDEMNIFY AND HOLD BORLAND, ITS RELATED
- * COMPANIES AND ITS SUPPLIERS, HARMLESS FROM AND AGAINST ANY CLAIMS
- * OR LIABILITIES ARISING OUT OF THE USE, REPRODUCTION, OR DISTRIBUTION
- * OF YOUR PROGRAMS, INCLUDING ANY CLAIMS OR LIABILITIES ARISING OUT OF
- * OR RESULTING FROM THE USE, MODIFICATION, OR DISTRIBUTION OF PROGRAMS
- * OR FILES CREATED FROM, BASED ON, AND/OR DERIVED FROM THIS SOURCE
- * CODE FILE.
- */
- 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 = java.util.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() {
- EventSetDescriptor[] eventDescriptor = new EventSetDescriptor[0];
- return eventDescriptor;
- }
-
- 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;
- }
-
- }
-