Package muntjac :: Package data :: Package util :: Module indexed_container :: Class IndexedContainerProperty
[hide private]
[frames] | no frames]

Class IndexedContainerProperty

source code

                   object --+    
                            |    
           property.IProperty --+
                                |
                   object --+   |
                            |   |
property.IValueChangeNotifier --+
                                |
                               IndexedContainerProperty

A class implementing the IProperty interface to be contained in the IndexedContainerItem contained in the IndexedContainer.


Authors:
Vaadin Ltd., Richard Lincoln

Version: 1.1.2

Instance Methods [hide private]
 
__init__(self, itemId, propertyId, container)
Constructs a new IndexedContainerProperty object.
source code
 
getType(self)
Returns the type of the IProperty.
source code
 
getValue(self)
Gets the value stored in the IProperty.
source code
 
isReadOnly(self)
Tests if the IProperty is in read-only mode.
source code
 
setReadOnly(self, newStatus)
Sets the IProperty's read-only mode to the specified status.
source code
 
setValue(self, newValue)
Sets the value of the IProperty.
source code
 
__str__(self)
Returns the value of the IProperty in human readable textual format.
source code
 
__hash__(self)
Calculates a integer hash-code for the IProperty that's unique inside the IItem containing the IProperty.
source code
 
__eq__(self, obj)
Tests if the given object is the same as the this object.
source code
 
addListener(self, listener, iface=None)
Registers a new value change listener for this IProperty.
source code
 
addCallback(self, callback, eventType=None, *args) source code
 
removeListener(self, listener, iface=None)
Removes a previously registered value change listener.
source code
 
removeCallback(self, callback, eventType=None) source code
 
getHost(self) source code

Inherited from object: __delattr__, __format__, __getattribute__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, itemId, propertyId, container)
(Constructor)

source code 

Constructs a new IndexedContainerProperty object.

Parameters:
  • itemId - the ID of the IItem to connect the new IProperty to.
  • propertyId - the IProperty ID of the new IProperty.
  • container - the list that contains the IItem to contain the new IProperty.
Overrides: object.__init__

getType(self)

source code 

Returns the type of the IProperty. The methods 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.

Returns:
type of the IProperty
Overrides: property.IProperty.getType
(inherited documentation)

getValue(self)

source code 

Gets the value stored in the IProperty. The returned object is compatible with the class returned by getType().

Returns:
the value stored in the IProperty
Overrides: property.IProperty.getValue
(inherited documentation)

isReadOnly(self)

source code 

Tests if the IProperty is in read-only mode. In read-only mode calls to the method setValue will throw ReadOnlyException and will not modify the value of the IProperty.

Returns:
True if the IProperty is in read-only mode, False if it's not
Overrides: property.IProperty.isReadOnly
(inherited documentation)

setReadOnly(self, newStatus)

source code 

Sets the IProperty's read-only mode to the specified status.

This functionality is optional, but all properties must implement the isReadOnly mode query correctly.

Parameters:
  • newStatus - new read-only status of the IProperty
Overrides: property.IProperty.setReadOnly
(inherited documentation)

setValue(self, newValue)

source code 

Sets the value of the IProperty.

Implementing this functionality is optional. If the functionality is missing, one should declare the IProperty to be in read-only mode and throw ReadOnlyException in this function.

Note: It is not required, but highly recommended to support setting the value also as a String in addition to the native type of the IProperty (as given by the getType method). If the string conversion fails or is unsupported, the method should throw ConversionException. The string conversion should at least understand the format returned by the __str__ method of the IProperty.

Parameters:
  • newValue - New value of the IProperty. This should be assignable to the type returned by getType, but also String type should be supported
Raises:
Overrides: property.IProperty.setValue
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 

Returns the value of the IProperty in human readable textual format. The return value should be assignable to the setValue method if the IProperty is not in read-only mode.

Returns:
String representation of the value stored in the IProperty
Overrides: object.__str__

__hash__(self)
(Hashing function)

source code 

Calculates a integer hash-code for the IProperty that's unique inside the IItem containing the IProperty. Two different Properties inside the same IItem contained in the same list always have different hash-codes, though Properties in different Items may have identical hash-codes.

Returns:
A locally unique hash-code as integer
Overrides: object.__hash__

__eq__(self, obj)
(Equality operator)

source code 

Tests if the given object is the same as the this object. Two Properties got from an IItem with the same ID are equal.

Parameters:
  • obj - an object to compare with this object
Returns:
True if the given object is the same as this object, False if not

addListener(self, listener, iface=None)

source code 

Registers a new value change listener for this IProperty.

Parameters:
  • listener - the new Listener to be registered
Overrides: property.IValueChangeNotifier.addListener
(inherited documentation)

addCallback(self, callback, eventType=None, *args)

source code 
Overrides: property.IValueChangeNotifier.addCallback

removeListener(self, listener, iface=None)

source code 

Removes a previously registered value change listener.

Parameters:
  • listener - listener to be removed
Overrides: property.IValueChangeNotifier.removeListener
(inherited documentation)

removeCallback(self, callback, eventType=None)

source code 
Overrides: property.IValueChangeNotifier.removeCallback