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

Source Code for Module muntjac.event.dd.target_details_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  """Implementation of ITargetDetails for terminal implementation and 
17  extension.""" 
18   
19  from muntjac.event.dd.target_details import ITargetDetails 
20   
21   
22 -class TargetDetailsImpl(ITargetDetails):
23 """A HashMap backed implementation of L{ITargetDetails} for terminal 24 implementation and for extension. 25 """ 26
27 - def __init__(self, rawDropData, dropTarget=None):
28 self._data = dict() 29 30 self._data.update(rawDropData) 31 self._dropTarget = dropTarget
32 33
34 - def getData(self, key):
35 return self._data.get(key)
36 37
38 - def setData(self, key, value):
39 if key in self._data: 40 return self._data[key] 41 else: 42 self._data[key] = value 43 return None
44 45
46 - def getTarget(self):
47 return self._dropTarget
48