home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-05-08 | 5.6 KB | 120 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.samples.intl.beans.event.*;
-
- public class LocaleChooserBeanInfo extends SimpleBeanInfo {
-
- ResourceBundle resourceBundle = java.util.ResourceBundle.getBundle("borland.samples.intl.beans.resources.LocaleChooserRes");
-
- public PropertyDescriptor[] getPropertyDescriptors() {
- try {
- PropertyDescriptor localeChoices = new PropertyDescriptor("localeChoices",
- LocaleChooser.class);
- localeChoices.setPropertyEditorClass(LocaleChooserLocaleChoicesEditor.class);
- localeChoices.setShortDescription(resourceBundle.getString("localeChoices"));
-
- PropertyDescriptor selectedLocales = new PropertyDescriptor("selectedLocales",
- LocaleChooser.class);
- selectedLocales.setPropertyEditorClass(LocaleChooserSelectedLocalesEditor.class);
- selectedLocales.setShortDescription(resourceBundle.getString("selectedLocales"));
-
- PropertyDescriptor displayStyle = new PropertyDescriptor("displayStyle",
- LocaleChooser.class);
- displayStyle.setPropertyEditorClass(LocaleChooserDisplayStyleEditor.class);
- displayStyle.setShortDescription(resourceBundle.getString("displayStyle"));
-
- PropertyDescriptor acceptLeafNodesOnly = new PropertyDescriptor("acceptLeafNodesOnly",
- LocaleChooser.class);
- acceptLeafNodesOnly.setShortDescription(resourceBundle.getString("acceptLeafNodesOnly"));
-
- PropertyDescriptor allowMultiSelect = new PropertyDescriptor("allowMultiSelect",
- LocaleChooser.class);
- allowMultiSelect.setShortDescription(resourceBundle.getString("allowMultiSelect"));
-
- PropertyDescriptor title = new PropertyDescriptor("title",
- LocaleChooser.class);
- title.setShortDescription(resourceBundle.getString("title"));
-
- PropertyDescriptor collationLocale = new PropertyDescriptor("collationLocale",
- LocaleChooser.class);
- collationLocale.setPropertyEditorClass(LocaleChooserCollationLocaleEditor.class);
- collationLocale.setShortDescription(resourceBundle.getString("collationLocale"));
-
- PropertyDescriptor animationEnabled = new PropertyDescriptor("animationEnabled",
- LocaleChooser.class);
-
- PropertyDescriptor locale = new PropertyDescriptor("locale",
- LocaleChooser.class);
-
- PropertyDescriptor background = new PropertyDescriptor("background",
- LocaleChooser.class);
-
- PropertyDescriptor foreground = new PropertyDescriptor("foreground",
- LocaleChooser.class);
-
- PropertyDescriptor font = new PropertyDescriptor("font",
- LocaleChooser.class);
-
- PropertyDescriptor propertyDescriptor[] = { localeChoices, selectedLocales, displayStyle,
- acceptLeafNodesOnly, allowMultiSelect,
- title, collationLocale, animationEnabled, locale,
- background, foreground, font };
- return propertyDescriptor;
- } catch (IntrospectionException e) {
- e.printStackTrace();
- return null;
- }
- }
-
- public EventSetDescriptor[] getEventSetDescriptors() {
- try {
- EventSetDescriptor localeChanged = new EventSetDescriptor(LocaleChooser.class,
- "localeChangeEvent",
- LocaleChangeListener.class,
- "localeChanged");
-
- localeChanged.setShortDescription(resourceBundle.getString("localeChanged"));
-
- EventSetDescriptor[] eventDescriptor = { localeChanged };
- return eventDescriptor;
- } catch (IntrospectionException e) {
- e.printStackTrace();
- return null;
- }
- }
-
- public BeanDescriptor getBeanDescriptor() {
- return new BeanDescriptor(LocaleChooser.class);
- }
-
- public Image getIcon(int iconKind) {
- if (iconKind == BeanInfo.ICON_COLOR_32x32) {
- return loadImage("resources/LocaleChooserIconColor32.gif");
- }
- return null;
- }
-
- }
-