|
Rational Developer for Power Systems Software V7.6 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ibm.etools.iseries.ui.AbstractFormatter com.ibm.etools.iseries.ui.EditcodeEditwordFormatter
public class EditcodeEditwordFormatter
EditcodeEditwordFormatter extends AbstractFormatter. This formatter is particularly designed for AS/400 users to set the format of a string for JFormattedTextField, JFormattedLabel and JFormattedComboBox. It depends on the DataAttributes values and the editcode or editword property values to determine the format of a string. The following is a table of the available edit codes:
EditCode | EditCodeParameterType | Sample Positive Value | Sample Negative Value | Sample Zero Value (qdecfmtJValue is false) | Sample Zero Value (qdecfmtJValue is true) |
1 | None | 4,567.89 | 4,567.89 | .00 | 0.00 |
1 | Currency | $4,567.89 | $4,567.89 | $.00 | $0.00 |
1 | Asterisk | ****4,567.89 | ****4,567.89 | ********.00 | *******0.00 |
2 | None | 4,567.89 | 4,567.89 | blank | blank |
2 | Currency | $4,567.89 | $4,567.89 | blank | blank |
2 | Asterisk | ****4,567.89 | ****4,567.89 | *********** | *********** |
3 | None | 4567.89 | 4567.89 | .00 | 0.00 |
3 | Currency | $4567.89 | $4567.89 | $.00 | $0.00 |
3 | Asterisk | ****4567.89 | ****4567.89 | ********.00 | *******0.00 |
4 | None | 4567.89 | 4567.89 | blank | blank |
4 | Currency | $4567.89 | $4567.89 | blank | blank |
4 | Asterisk | ****4567.89 | ****4567.89 | *********** | *********** |
A | None | 4,567.89 | 4,567.89CR | .00 | 0.00 |
A | Currency | $4,567.89 | $4,567.89CR | $.00 | $0.00 |
A | Asterisk | ****4,567.89 | ****4,567.89CR | *********.00 | ********0.00 |
B | None | 4,567.89 | 4,567.89CR | blank | blank |
B | Currency | $4,567.89 | $4,567.89CR | blank | blank |
B | Asterisk | ****4,567.89 | ****4,567.89CR | ************ | ************ |
C | None | 4567.89 | 4567.89CR | .00 | 0.00 |
C | Currency | $4567.89 | $4567.89CR | $.00 | $0.00 |
C | Asterisk | ****4567.89 | ****4567.89CR | ********.00 | *******0.00 |
D | None | 4567.89 | 4567.89CR | blank | blank |
D | Currency | $4567.89 | $4567.89CR | blank | blank |
D | Asterisk | ****4567.89 | ****4567.89CR | *********** | *********** |
J | None | 4,567.89 | 4,567.89- | .00 | 0.00 |
J | Currency | $4,567.89 | $4,567.89- | $.00 | $0.00 |
J | Asterisk | ****4,567.89 | ****4,567.89- | *********.00 | ********0.00 |
K | None | 4,567.89 | 4,567.89- | blank | blank |
K | Currency | $4,567.89 | $4,567.89- | blank | blank |
K | Asterisk | ****4,567.89 | ****4,567.89- | ************ | ************ |
L | None | 4567.89 | 4567.89- | .00 | 0.00 |
L | Currency | $4567.89 | $4567.89- | $.00 | $0.00 |
L | Asterisk | ****4567.89 | ****4567.89- | ********.00 | *******0.00 |
M | None | 4567.89 | 4567.89- | blank | blank |
M | Currency | $4567.89 | $4567.89- | blank | blank |
M | Asterisk | ****4567.89 | ****4567.89- | *********** | *********** |
N | None | 4,567.89 | -4,567.89 | .00 | 0.00 |
N | Currency | $4,567.89 | -$4,567.89 | $.00 | $0.00 |
N | Asterisk | ****4,567.89 | ****-4,567.89 | *********.00 | ********0.00 |
O | None | 4,567.89 | -4,567.89 | blank | blank |
O | Currency | $4,567.89 | -$4,567.89 | blank | blank |
O | Asterisk | *****4,567.89 | ****-4,567.89 | ************* | ************* |
P | None | 4567.89 | -4567.89 | .00 | 0.00 |
P | Currency | $4567.89 | -$4567.89 | $.00 | $0.00 |
P | Asterisk | *****4567.89 | ****-4567.89 | *********.00 | ********0.00 |
Q | None | 4567.89 | -4567.89 | blank | blank |
Q | Currency | $4567.89 | -$4567.89 | blank | blank |
Q | Asterisk | *****4567.89 | ****-4567.89 | ************ | ************ |
W | None | 4567/89 | 4567/89 | 0/00 | 0/00 |
X | None | 000456789 | 000456789- | 000000000 | 000000000 |
Y | None | 01/23/2000 | 01/23/2000 | 0/00/0000 | 0/00/0000 |
Z | None | 456789 | 456789 | blank | blank |
The following is a table of some sample editwords:
Sample Editword | Data Type | Unformatted Value | Formatted Value |
"bbb,bbb.bb" (b is a blank) | Numeric | 654321 | 6,543.21 |
"bbb,b0b.bb" | Numeric | 27 | 0.27 |
"0bb:bb:bb" | Numeric | 71223 | 07:12:23 |
"0bbb-bb-bbbb" | Numeric | 23456789 | 023-45-6789 |
"0bbb-bb-bbbb" | Character | bcdefghij | 0bc-de-ghij |
"0(bbb)&bbb-bbbb" | Numeric | 125529404 | (012) 552-9404 |
You can select an editcode or specify an editword. If a non-zero ('0' or None) editcode as well as an editword are specified, then the editcode has precedence over the editword. If the editcode is set to '0' or None, and editword is not specified, then there will be no formatting.
DefaultFormatter
,
AbstractFormatter
,
Formatter
,
Serialized FormField Summary | |
---|---|
static String |
Copyright
|
static int |
EDITCODEPARM_ASTERISK
Editcode parameter type is '*' |
static int |
EDITCODEPARM_CURRENCY
Editcode parameter type is the currency symbol |
static int |
EDITCODEPARM_NONE
Editcode parameter type is none. |
protected PropertyChangeSupport |
propertyChange
|
protected VetoableChangeSupport |
vetoPropertyChange
|
Fields inherited from interface com.ibm.etools.iseries.ui.Formatter |
---|
copyright |
Constructor Summary | |
---|---|
EditcodeEditwordFormatter()
Constructs a new EditcodeEditwordFormatter. |
|
EditcodeEditwordFormatter(Attributes dataAttributes)
Constructs a new EditcodeEditwordFormatter with the specified DataAttributes. |
|
EditcodeEditwordFormatter(Attributes dataAttributes,
char editCode,
int editCodeParmType,
String editWord)
Constructs a new EditcodeEditwordFormatter with the specified DataAttributes, editcode, editcode parameter type and editword. |
|
EditcodeEditwordFormatter(Attributes dataAttributes,
char editCode,
int editCodeParmType,
String editWord,
char currencySymbol,
char thousandSeparator,
char dateSeparator)
Constructs a new EditcodeEditwordFormatter with the specified DataAttributes, editcode, editcode parameter type, editword, currencySymbol, thousandSeparator and dataSpearator. |
|
EditcodeEditwordFormatter(Attributes dataAttributes,
char editCode,
int editCodeParmType,
String editWord,
char currencySymbol,
char thousandSeparator,
char dateSeparator,
boolean qdecfmtJValue)
Constructs a new EditcodeEditwordFormatter with the specified DataAttributes, editcode, editcode parameter type, editword, currencySymbol, thousandSeparator, dataSpearator and qdecfmtJValue. |
|
EditcodeEditwordFormatter(Attributes dataAttributes,
char editCode,
int editCodeParmType,
String editWord,
String currencySymbolStr,
char thousandSeparator,
char dateSeparator)
Constructs a new EditcodeEditwordFormatter with the specified DataAttributes, editcode, editcode parameter type, editword, currencySymbol, thousandSeparator and dataSpearator. |
|
EditcodeEditwordFormatter(Attributes dataAttributes,
char editCode,
int editCodeParmType,
String editWord,
String currencySymbolStr,
char thousandSeparator,
char dateSeparator,
boolean qdecfmtJValue)
|
Method Summary | |
---|---|
void |
addPropertyChangeListener(PropertyChangeListener l)
|
void |
addVetoableChangeListener(VetoableChangeListener l)
Add a vetoableChangeListener. |
static String |
Copyright()
This method returns the copyright notice for this class. |
void |
firePropertyChange(String propertyName,
Object oldValue,
Object newValue)
The firePropertyChange method was generated to support the propertyChange field. |
String |
formatString(String strInput)
Return the formatted string given an unformatted string. |
char |
getCurrencySymbol()
Gets the currencySymbol property (char) value. |
String |
getCurrencySymbolStr()
Gets the currencySymbolStr property (String) value. |
Attributes |
getDataAttributes()
Gets the dataAttributes property (com.ibm.etools.iseries.ui.Attributes) value. |
char |
getDateSeparator()
Gets the dateSeparator property (char) value. |
char |
getEditCode()
Gets the editCode property (char) value. |
int |
getEditCodeParmType()
Gets the editCodeParmType property (int) value. |
String |
getEditWord()
Gets the editWord property (java.lang.String) value. |
protected PropertyChangeSupport |
getPropertyChange()
Accessor for the propertyChange field. |
boolean |
getQdecfmtJValue()
Gets the qdecfmtJValue property (boolean) value. |
char |
getThousandSeparator()
Gets the thousandSeparator property (char) value. |
void |
propertyChange(PropertyChangeEvent e)
Examine the PropertyChangeEvent and decides what to do on a particular event. |
void |
removePropertyChangeListener(PropertyChangeListener l)
Removes a propertyChangeListener. |
void |
removeVetoableChangeListener(VetoableChangeListener l)
Removes a vetoableChangeListener. |
void |
setCurrencySymbol(char symbol)
Sets the currencySymbol property (char) value. |
void |
setCurrencySymbolStr(String symbol)
Sets the currencySymbolStr property (String) value. |
void |
setDataAttributes(Attributes a)
Sets the dataAttributes property (com.ibm.etools.iseries.ui.Attributes) value. |
void |
setDateSeparator(char dateSep)
Sets the dateSeparator property (char) value. |
void |
setEditCode(char code)
Sets the editCode property (char) value. |
void |
setEditCodeParmType(int editCodeParameterType)
Sets the editCodeParmType property (int) value. |
void |
setEditWord(String eWord)
Sets the editWord property (java.lang.String) value. |
void |
setQdecfmtJValue(boolean value)
Sets the qdecfmtJValue property (char) value. |
void |
setThousandSeparator(char thouSeparator)
Sets the thousandSeparator property (char) value. |
void |
vetoableChange(PropertyChangeEvent e)
This method gets called when a constrained property is changed. |
Methods inherited from class com.ibm.etools.iseries.ui.AbstractFormatter |
---|
fireVetoableChange, getVetoPropertyChange |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String Copyright
public static final int EDITCODEPARM_NONE
public static final int EDITCODEPARM_ASTERISK
public static final int EDITCODEPARM_CURRENCY
protected transient PropertyChangeSupport propertyChange
protected transient VetoableChangeSupport vetoPropertyChange
Constructor Detail |
---|
public EditcodeEditwordFormatter()
public EditcodeEditwordFormatter(Attributes dataAttributes)
dataAttributes
- com.ibm.etools.iseries.ui.Attributespublic EditcodeEditwordFormatter(Attributes dataAttributes, char editCode, int editCodeParmType, String editWord)
dataAttributes
- com.ibm.etools.iseries.ui.AttributeseditCode
- chareditCodeParmType
- inteditWord
- java.lang.Stringpublic EditcodeEditwordFormatter(Attributes dataAttributes, char editCode, int editCodeParmType, String editWord, char currencySymbol, char thousandSeparator, char dateSeparator)
dataAttributes
- com.ibm.etools.iseries.ui.AttributeseditCode
- chareditCodeParmType
- inteditWord
- java.lang.StringcurrencySymbol
- charthousandSeparator
- chardateSeparator
- charpublic EditcodeEditwordFormatter(Attributes dataAttributes, char editCode, int editCodeParmType, String editWord, String currencySymbolStr, char thousandSeparator, char dateSeparator)
dataAttributes
- com.ibm.etools.iseries.ui.AttributeseditCode
- chareditCodeParmType
- inteditWord
- java.lang.StringcurrencySymbolStr
- StringthousandSeparator
- chardateSeparator
- charpublic EditcodeEditwordFormatter(Attributes dataAttributes, char editCode, int editCodeParmType, String editWord, char currencySymbol, char thousandSeparator, char dateSeparator, boolean qdecfmtJValue)
dataAttributes
- com.ibm.etools.iseries.ui.AttributeseditCode
- chareditCodeParmType
- inteditWord
- java.lang.StringcurrencySymbol
- charthousandSeparator
- chardateSeparator
- charqdecfmtJValue
- booleanpublic EditcodeEditwordFormatter(Attributes dataAttributes, char editCode, int editCodeParmType, String editWord, String currencySymbolStr, char thousandSeparator, char dateSeparator, boolean qdecfmtJValue)
Method Detail |
---|
public void addPropertyChangeListener(PropertyChangeListener l)
public void addVetoableChangeListener(VetoableChangeListener l)
addVetoableChangeListener
in class AbstractFormatter
l
- java.beans.VetoableChangeListenerpublic static String Copyright()
public void firePropertyChange(String propertyName, Object oldValue, Object newValue)
public String formatString(String strInput)
formatString
in interface Formatter
formatString
in class AbstractFormatter
strInput
- String
public char getCurrencySymbol()
setCurrencySymbol(char)
public String getCurrencySymbolStr()
setCurrencySymbolStr(java.lang.String)
public Attributes getDataAttributes()
getDataAttributes
in interface Formatter
getDataAttributes
in class AbstractFormatter
setDataAttributes(com.ibm.etools.iseries.ui.Attributes)
public char getDateSeparator()
setDateSeparator(char)
public char getEditCode()
setEditCode(char)
public int getEditCodeParmType()
setEditCodeParmType(int)
public String getEditWord()
setEditWord(java.lang.String)
protected PropertyChangeSupport getPropertyChange()
public char getThousandSeparator()
setThousandSeparator(char)
public void propertyChange(PropertyChangeEvent e)
propertyChange
in interface PropertyChangeListener
e
- java.beans.PropertyChangeEventpublic void removePropertyChangeListener(PropertyChangeListener l)
l
- PropertyChangeListenerpublic void removeVetoableChangeListener(VetoableChangeListener l)
removeVetoableChangeListener
in class AbstractFormatter
l
- java.beans.VetoableChangeListenerpublic void setCurrencySymbol(char symbol)
currencySymbol
- The new value for the property.getCurrencySymbol()
public void setCurrencySymbolStr(String symbol)
currencySymbolStr
- The new value for the property.getCurrencySymbolStr()
public void setDataAttributes(Attributes a) throws PropertyVetoException
setDataAttributes
in interface Formatter
setDataAttributes
in class AbstractFormatter
dataAttributes
- The new value for the property.
PropertyVetoException
getDataAttributes()
public void setDateSeparator(char dateSep)
dateSeparator
- The new value for the property.getDateSeparator()
public void setEditCode(char code) throws PropertyVetoException
editCode
- The new value for the property.
PropertyVetoException
getEditCode()
public void setEditCodeParmType(int editCodeParameterType) throws PropertyVetoException
editCodeParmType
- The new value for the property.
PropertyVetoException
getEditCodeParmType()
public void setEditWord(String eWord)
editWord
- The new value for the property.getEditWord()
public void setThousandSeparator(char thouSeparator)
thousandSeparator
- The new value for the property.getThousandSeparator()
public void vetoableChange(PropertyChangeEvent e) throws PropertyVetoException
vetoableChange
in interface VetoableChangeListener
e
- java.beans.PropertyChangeEvent a PropertyChangeEvent object describing the event source and the property that has changed.
PropertyVetoException
- if the recipient wishes the property change to be rolled back.public boolean getQdecfmtJValue()
setQdecfmtJValue(boolean)
public void setQdecfmtJValue(boolean value)
value
- True for J value of QDECFMT system value is set,
false for J value of QDECFMT system value is not set,getQdecfmtJValue()
|
Rational Developer for Power Systems Software V7.6 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |