Package muntjac :: Package event :: Module transferable_impl
[hide private]
[frames] | no frames]

Source Code for Module muntjac.event.transferable_impl

 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.event.transferable import ITransferable 
17   
18   
19 -class TransferableImpl(ITransferable):
20
21 - def __init__(self, sourceComponent, rawVariables):
22 self._sourceComponent = sourceComponent 23 self._rawVariables = rawVariables
24 25
26 - def getSourceComponent(self):
27 return self._sourceComponent
28 29
30 - def getData(self, dataFlavor):
31 return self._rawVariables.get(dataFlavor)
32 33
34 - def setData(self, dataFlavor, value):
35 self._rawVariables[dataFlavor] = value
36 37
38 - def getDataFlavors(self):
39 return self._rawVariables.keys()
40