|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.vaadin.data.util.AbstractProperty
com.vaadin.data.util.TextFileProperty
public class TextFileProperty
Property implementation for wrapping a text file.
Supports reading and writing of a File from/to String.
ValueChangeListener
s are supported, but only fire when
setValue(Object) is explicitly called. ReadOnlyStatusChangeListener
s
are supported but only fire when setReadOnly(boolean) is explicitly called.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.vaadin.data.util.AbstractProperty |
---|
AbstractProperty.ReadOnlyStatusChangeEvent |
Nested classes/interfaces inherited from interface com.vaadin.data.Property |
---|
Property.ConversionException, Property.Editor, Property.ReadOnlyException, Property.ReadOnlyStatusChangeListener, Property.ReadOnlyStatusChangeNotifier, Property.ValueChangeListener, Property.ValueChangeNotifier, Property.Viewer |
Constructor Summary | |
---|---|
TextFileProperty(File file)
Wrap given file with property interface. |
|
TextFileProperty(File file,
Charset charset)
Wrap the given file with the property interface and specify character set. |
Method Summary | |
---|---|
Class<?> |
getType()
Returns the type of the Property. |
Object |
getValue()
Gets the value stored in the Property. |
boolean |
isReadOnly()
Tests if the Property is in read-only mode. Override for additional restrictions on what is considered a read-only property. |
void |
setValue(Object newValue)
Sets the value of the Property. |
Methods inherited from class com.vaadin.data.util.AbstractProperty |
---|
addListener, addListener, fireReadOnlyStatusChange, fireValueChange, getListeners, removeListener, removeListener, setReadOnly, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TextFileProperty(File file)
file
- File to be wrapped.public TextFileProperty(File file, Charset charset)
file
- File to be wrapped.charset
- Charset to be used for reading and writing the file.Method Detail |
---|
public Class<?> getType()
Property
getValue
and
setValue
must be compatible with this type: one must be able
to safely cast the value returned from getValue
to the given
type and pass any variable assignable to this type as an argument to
setValue
.
public Object getValue()
Property
public boolean isReadOnly()
AbstractProperty
setValue
will throw
ReadOnlyException
and will not modify the value of the
Property.
Override for additional restrictions on what is considered a read-only
property.
isReadOnly
in interface Property
isReadOnly
in class AbstractProperty
true
if the Property is in read-only mode,
false
if it's notpublic void setValue(Object newValue) throws Property.ReadOnlyException
Property
Implementing this functionality is optional. If the functionality is
missing, one should declare the Property to be in read-only mode and
throw Property.ReadOnlyException
in this function.
String
in addition to the native type of the
Property (as given by the getType
method). If the
String
conversion fails or is unsupported, the method should
throw Property.ConversionException
. The string conversion
should at least understand the format returned by the
toString
method of the Property.
newValue
- New value of the Property. This should be assignable to the
type returned by getType, but also String type should be
supported
Property.ReadOnlyException
- if the object is in read-only mode
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |