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

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

 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  """Parent class for criteria which are verified on the server side.""" 
17   
18  from muntjac.event.dd.acceptcriteria.accept_criterion import IAcceptCriterion 
19   
20   
21 -class ServerSideCriterion(IAcceptCriterion):
22 """Parent class for criteria which are verified on the server side 23 during a drag operation to accept/discard dragged content (presented 24 by L{Transferable}). 25 26 Subclasses should implement the L{IAcceptCriterion.accept} method. 27 28 As all server side state can be used to make a decision, this is more 29 flexible than L{ClientSideCriterion}. However, this does require 30 additional requests from the browser to the server during a drag operation. 31 32 @see: IAcceptCriterion 33 @see: ClientSideCriterion 34 """ 35
36 - def isClientSideVerifiable(self):
37 return False
38 39
40 - def paint(self, target):
41 target.startTag('-ac') 42 target.addAttribute('name', self.getIdentifier()) 43 self.paintContent(target) 44 target.endTag('-ac')
45 46
47 - def paintContent(self, target):
48 pass
49 50
51 - def paintResponse(self, target):
52 pass
53 54
55 - def getIdentifier(self):
56 #return clsname(ServerSideCriterion) # FIXME: Python client side 57 return 'com.vaadin.event.dd.acceptcriteria.ServerSideCriterion'
58