home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
inprise
/
JSAMPLES.Z
/
LocaleChooserDisplayStyleEditor.java
< prev
next >
Wrap
Text File
|
1998-05-08
|
2KB
|
79 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;
public class LocaleChooserDisplayStyleEditor
extends java.beans.PropertyEditorSupport {
int style;
public String[] getTags() {
String tags[] = {
"ISO",
"TARGET_LOCALE",
"CURRENT_LOCALE"
};
return tags;
}
public String getJavaInitializationString() {
switch (style) {
case LocaleChooser.ISO:
return "LocaleChooser.ISO";
case LocaleChooser.TARGET_LOCALE:
return "LocaleChooser.TARGET_LOCALE";
default:
return "LocaleChooser.CURRENT_LOCALE";
}
}
public void setAsText(String text) {
if (text.equals("ISO")) {
style = LocaleChooser.ISO;
} else if (text.equals("TARGET_LOCALE")) {
style = LocaleChooser.TARGET_LOCALE;
} else {
style = LocaleChooser.CURRENT_LOCALE;
}
}
public String getAsText() {
switch (style) {
case LocaleChooser.ISO:
return "ISO";
case LocaleChooser.TARGET_LOCALE:
return "TARGET_LOCALE";
default:
return "CURRENT_LOCALE";
}
}
public void setValue(Object o) {
style = ((Integer) o).intValue();
firePropertyChange();
}
public Object getValue() {
return new Integer(style);
}
}