Package muntjac :: Package addon :: Package csstools :: Module render_info_fetcher
[hide private]
[frames] | no frames]

Source Code for Module muntjac.addon.csstools.render_info_fetcher

 1  # Copyright (C) 2012 Vaadin Ltd.  
 2  # Copyright (C) 2012 Richard Lincoln 
 3  #  
 4  # Licensed under the Apache License, Version 2.0 (the "License");  
 5  # you may not use this file except in compliance with the License.  
 6  # You may obtain a copy of the License at  
 7  #  
 8  #     http://www.apache.org/licenses/LICENSE-2.0  
 9  #  
10  # Unless required by applicable law or agreed to in writing, software  
11  # distributed under the License is distributed on an "AS IS" BASIS,  
12  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  
13  # See the License for the specific language governing permissions and  
14  # limitations under the License. 
15   
16  from muntjac.ui.window import Window 
17   
18  from muntjac.addon.csstools.client.v_render_info_fetcher \ 
19      import VRenderInfoFetcher 
20   
21  from muntjac.addon.csstools.render_info import RenderInfo 
22   
23   
24 -class RenderInfoFetcher(Window):
25 26 CLIENT_WIDGET = None #ClientWidget(VRenderInfoFetcher) 27 28 TYPE_MAPPING = 'org.vaadin.csstools.RenderInfoFetcher' 29
30 - def __init__(self, c, cb, *props):
31 self._c = c 32 self._cb = cb 33 self._props = props 34 35 super(RenderInfoFetcher, self).__init__()
36 37
38 - def paintContent(self, target):
39 super(RenderInfoFetcher, self).paintContent(target) 40 41 target.addAttribute(VRenderInfoFetcher.ATTR_TARGET_COMPONENT, 42 self._c) 43 44 if self._props is not None and len(self._props) > 0: 45 target.addAttribute(VRenderInfoFetcher.ATTR_PROPERTIES, 46 self._props)
47 48
49 - def changeVariables(self, source, variables):
50 super(RenderInfoFetcher, self).changeVariables(source, variables) 51 52 if VRenderInfoFetcher.ATTR_RENDER_INFO in variables: 53 ri = RenderInfo(variables[VRenderInfoFetcher.ATTR_RENDER_INFO]) 54 self._cb.infoReceived(ri) 55 self.getParent().removeWindow(self)
56