home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BUG 15
/
BUGCD1998_06.ISO
/
aplic
/
jbuilder
/
jsamples.z
/
LocaleChooserBeanInfo.java
< prev
next >
Wrap
Text File
|
1997-07-30
|
4KB
|
100 lines
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 {
private static final ResourceBundle resourceBundle = 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;
}
}