Package muntjac :: Package terminal :: Module variable_owner
[hide private]
[frames] | no frames]

Source Code for Module muntjac.terminal.variable_owner

 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  """Defines a listener interface for UI variable changes.""" 
17   
18  from muntjac.terminal.terminal import IErrorEvent as ITerminalErrorEvent 
19   
20   
21 -class IVariableOwner(object):
22 """Listener interface for UI variable changes. The user communicates 23 with the application using the so-called I{variables}. When the 24 user makes a change using the UI the terminal trasmits the changed 25 variables to the application, and the components owning those variables 26 may then process those changes. 27 28 @author: Vaadin Ltd. 29 @author: Richard Lincoln 30 @version: 1.1.2 31 """ 32
33 - def changeVariables(self, source, variables):
34 """Called when one or more variables handled by the implementing 35 class are changed. 36 37 @param source: 38 the Source of the variable change. This is the origin 39 of the event. For example in Web Adapter this is the 40 request. 41 @param variables: 42 the Mapping from variable names to new variable values. 43 """ 44 raise NotImplementedError
45 46
47 - def isEnabled(self):
48 """Tests if the variable owner is enabled or not. The terminal 49 should not send any variable changes to disabled variable owners. 50 51 @return: C{True} if the variable owner is enabled, C{False} if not 52 """ 53 raise NotImplementedError
54 55
56 - def isImmediate(self):
57 """Tests if the variable owner is in immediate mode or not. Being 58 in immediate mode means that all variable changes are required to 59 be sent back from the terminal immediately when they occur. 60 61 B{Note:} C{IVariableOwner} does not include 62 a set-method for the immediateness property. This is because not all 63 VariableOwners wish to offer the functionality. Such VariableOwners 64 are never in the immediate mode, thus they always return 65 C{False} in L{isImmediate}. 66 67 @return: C{True} if the component is in immediate mode, C{False} if not 68 """ 69 raise NotImplementedError
70 71
72 -class IErrorEvent(ITerminalErrorEvent):
73 """IVariableOwner error event.""" 74
75 - def getVariableOwner(self):
76 """Gets the source IVariableOwner. 77 78 @return: the variable owner. 79 """ 80 raise NotImplementedError
81