Package pyjamas :: Package ui :: Module UIObject :: Class UIObject
[hide private]
[frames] | no frames]

Class UIObject

source code

object --+    
         |    
   Applier --+
             |
            UIObject

Instance Methods [hide private]
 
__init__(self, **kwargs)
use this to apply properties as a dictionary, e.g.:
source code
 
getAbsoluteLeft(self) source code
 
getAbsoluteTop(self) source code
 
getElement(self)
Get the DOM element associated with the UIObject, if any
source code
 
getOffsetHeight(self) source code
 
getOffsetWidth(self) source code
 
getStyleName(self) source code
 
getStylePrimaryName(self)
Return with the first className if there are multiples
source code
 
getStyleAttribute(self, attribute)
can be called with two forms: getStyleAttribute(self, attr) - returns value getStyleAttribute(self, (attr1,attr2,...)) - returns dictionary of attr:value pairs
source code
 
getTitle(self) source code
 
setElement(self, element)
Set the DOM element associated with the UIObject.
source code
 
setHeight(self, height)
Set the height of the element associated with this UIObject.
source code
 
getHeight(self) source code
 
setPixelSize(self, width, height)
Set the width and height of the element associated with this UIObject in pixels.
source code
 
setSize(self, width, height)
Set the width and height of the element associated with this UIObject.
source code
 
addStyleName(self, style)
Append a style to the element associated with this UIObject.
source code
 
addStyleDependentName(self, styleSuffix)
Adds a secondary or dependent style name to this element.
source code
 
removeStyleName(self, style)
Remove a style from the element associated with this UIObject.
source code
 
removeStyleDependentName(self, styleSuffix)
Remove a dependent style name by specifying the style name's suffix.
source code
 
setStyleName(self, element, style=None, add=True)
When called with a single argument, this replaces all the CSS classes associated with this UIObject's element with the given parameter.
source code
 
setStyleAttribute(self, attribute, value=None)
can be called with two forms: single attr: setStyleAttribute(self, attr, value) multi attr: setStyleAttribute(self, {attr1:val1, attr2:val2, ...
source code
 
setTitle(self, title) source code
 
setWidth(self, width)
Set the width of the element associated with this UIObject.
source code
 
getWidth(self) source code
 
sinkEvents(self, eventBitsToAdd)
Request that the given events be delivered to the event handler for this element.
source code
 
setzIndex(self, index) source code
 
isVisible(self, element=None)
XXX DEPRECATED - use getVisible
source code
 
getVisible(self, element=None)
Determine whether this element is currently visible, by checking the CSS property 'display'
source code
 
setVisible(self, element, visible=None)
Set whether this element is visible or not.
source code
 
unsinkEvents(self, eventBitsToRemove)
Reverse the operation of sinkEvents.
source code

Inherited from Applier: applyValues, retrieveValues, setDefaults, setElementProperties, updateInstance

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

Class Methods [hide private]
 
_getProps(self) source code

Inherited from Applier (private): _getElementProps

Class Variables [hide private]
  _props = [("visible", "Visibility", "Visible", None), ("elemen...

Inherited from Applier (private): _elem_props

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

_getProps(self)
Class Method

source code 
Overrides: Applier._getProps

__init__(self, **kwargs)
(Constructor)

source code 

use this to apply properties as a dictionary, e.g.:

   x = klass(..., StyleName='class-name')

will do:

   x = klass(...)
   x.setStyleName('class-name')

and:

   x = klass(..., Size=("100%", "20px"), Visible=False)

will do:

   x = klass(...)
   x.setSize("100%", "20px")
   x.setVisible(False)
Overrides: object.__init__
(inherited documentation)

setHeight(self, height)

source code 

Set the height of the element associated with this UIObject. The value should be given as a CSS value, such as 100px, 30%, or 50pi

setPixelSize(self, width, height)

source code 

Set the width and height of the element associated with this UIObject in pixels. Width and height should be numbers.

setSize(self, width, height)

source code 

Set the width and height of the element associated with this UIObject. The values should be given as a CSS value, such as 100px, 30%, or 50pi

addStyleName(self, style)

source code 

Append a style to the element associated with this UIObject. This is a CSS class name. It will be added after any already-assigned CSS class for the element.

addStyleDependentName(self, styleSuffix)

source code 

Adds a secondary or dependent style name to this element. For example if the primary stylename is gwt-TextBox, self.addStyleDependentName("readonly") will return gwt-TextBox-readonly.

removeStyleName(self, style)

source code 

Remove a style from the element associated with this UIObject. This is a CSS class name.

setStyleName(self, element, style=None, add=True)

source code 

When called with a single argument, this replaces all the CSS classes associated with this UIObject's element with the given parameter. Otherwise, this is assumed to be a worker function for addStyleName and removeStyleName.

setStyleAttribute(self, attribute, value=None)

source code 

can be called with two forms: single attr: setStyleAttribute(self, attr, value) multi attr: setStyleAttribute(self, {attr1:val1, attr2:val2, ...})

setWidth(self, width)

source code 

Set the width of the element associated with this UIObject. The value should be given as a CSS value, such as 100px, 30%, or 50pi

sinkEvents(self, eventBitsToAdd)

source code 

Request that the given events be delivered to the event handler for this element. The event bits passed are added (using inclusive OR) to the events already "sunk" for the element associated with the UIObject. The event bits are a combination of values from class Event.

setVisible(self, element, visible=None)

source code 

Set whether this element is visible or not. If a single parameter is given, the self.element is used. This modifies the CSS property 'display', which means that an invisible element not only is not drawn, but doesn't occupy any space on the page.

unsinkEvents(self, eventBitsToRemove)

source code 

Reverse the operation of sinkEvents. See UIObject.sinkEvents.


Class Variable Details [hide private]

_props

Value:
[("visible", "Visibility", "Visible", None), ("element", "Element", "E\
lement", None), ("stylename", "Style name", "StyleName", None), ("widt\
h", "Width", "Width", None), ("height", "Height", "Height", None), ("s\
ize", "Size", "Size", None), ("title", "Title", "Title", None), ("zind\
ex", "Z Index", "zIndex", None),]