Home | Trees | Indices | Help |
|
---|
|
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 """A criterion that ensures the drag source is the same as drop target.""" 17 18 from muntjac.event.transferable_impl import TransferableImpl 19 20 from muntjac.event.dd.acceptcriteria.client_side_criterion import \ 21 ClientSideCriterion25 """A criterion that ensures the drag source is the same as drop target. 26 Eg. L{Tree} or L{Table} could support only re-ordering of items, 27 but no L{Transferable}s coming outside. 28 29 Note! Class is singleton, use L{get} method to get the instance. 30 """ 31 32 _instance = None 33 36 3753 54 55 SourceIsTarget._instance = SourceIsTarget() 5639 if isinstance(dragEvent.getTransferable(), TransferableImpl): 40 sourceComponent = dragEvent.getTransferable().getSourceComponent() 41 target = dragEvent.getTargetDetails().getTarget() 42 return sourceComponent == target 43 return False44 45 46 @classmethod48 return cls._instance49 50
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Sat Apr 20 16:53:16 2013 | http://epydoc.sourceforge.net |