public class PComponentAttributeImpl extends Object implements Serializable
PComponentAttributeImpl
is the default implementation class for
the PComponentAttribute
interface. Its design allows any other
implementation of this interface to delegate some or all of its methods to an
instance of this class.Constructor and Description |
---|
PComponentAttributeImpl(Component comp)
Creates an instance of this class, given a parent component.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears existing data from the component.
|
Object |
getDefault()
Gets the default value.
|
int |
getDefaultCount()
Gets the default count.
|
boolean |
isCurrencyDisplay()
Determines whether the component currently displays currency data.
|
boolean |
isDirty()
Tests to determine whether this is a changed field.
|
boolean |
isError()
Tests to determine if this has bad data.
|
boolean |
isInputTracking()
Tests the input tracking flag.
|
boolean |
isRequired()
Tests to determine whether this is a required field.
|
void |
resetToDefault()
Resets the component value to the original value, which was
established by calling
setDefault() . |
Color |
setClean()
Sets the state to CLEAN, unless the field is required, at which time
the state will be both CLEAN and REQUIRED.
|
void |
setCurrencyDisplay(boolean b)
Determines if this component currently displays currency data.
|
void |
setDefault(Object obj)
Sets the default value.
|
void |
setDefaultCount(int cnt)
Sets the default count.
|
Color |
setDirty()
Sets the DIRTY flag in this field to indicate a change and calculates
the new field color.
|
Color |
setError(boolean b)
Sets the ERROR flag in this field and calculates the new field color.
|
void |
setInputTracking(boolean b)
Sets the input tracking flag.
|
Color |
setRequired(boolean b)
Sets the REQUIRED flag in this field and calculates the new field color.
|
public PComponentAttributeImpl(Component comp) throws RemoteException
comp
- the component that will be given a set of attributesRemoteException
- thrown for all problemspublic void resetToDefault()
setDefault()
. If no default
value exists, the component data is cleared. This method
simply sets the state to CLEAN. The subclass retrieves the default
value, if any, and resets the value.public void clear()
public Color setClean()
public boolean isRequired()
public Color setRequired(boolean b)
b
- true if required; false otherwisepublic Color setDirty()
public boolean isDirty()
public boolean isError()
public Color setError(boolean b)
b
- true if the field is in error; false otherwisepublic void setDefaultCount(int cnt)
cnt
- the new default countpublic int getDefaultCount()
public void setDefault(Object obj)
obj
- the default object. Used for comparison purposes; it
doesn't change the current contents.public Object getDefault()
public void setInputTracking(boolean b)
b
- True if input tracking should be on; false otherwise.public boolean isInputTracking()
public void setCurrencyDisplay(boolean b)
b
- if true, indicates that the widget currently displays currency datapublic boolean isCurrencyDisplay()
Copyright © 2003, 2023, Oracle and/or its affiliates.