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

Source Code for Module muntjac.event.dd.acceptcriteria.accept_all

 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  """Criterion that accepts all drops anywhere on the component.""" 
17   
18  from muntjac.event.dd.acceptcriteria.client_side_criterion import \ 
19      ClientSideCriterion 
20 21 22 -class AcceptAll(ClientSideCriterion):
23 """Criterion that accepts all drops anywhere on the component. 24 25 Note! Class is singleton, use L{get} method to get the instance. 26 """ 27 28 _singleton = None 29
30 - def __init__(self):
31 pass
32 33 @classmethod
34 - def get(cls):
35 return cls._singleton
36 37
38 - def accept(self, dragEvent):
39 return True
40 41
42 - def getIdentifier(self):
43 return 'com.vaadin.event.dd.acceptcriteria.AcceptAll'
44 45 AcceptAll._singleton = AcceptAll() 46