Class AbstractDraggableFactory

    • Constructor Detail

      • AbstractDraggableFactory

        public AbstractDraggableFactory()
    • Method Detail

      • getHelper

        protected abstract String getHelper​(String selector)
        Gets the helper that might be used by the Draggable.
        The returned value is supplied to the create(String, String, String) method.
        Parameters:
        selector - the selector
        Returns:
        the helper
      • create

        public final Draggable<?> create​(String id,
                                         String selector)
        Creates the new Draggable for the given selector
        Parameters:
        id - the markup id
        selector - the related component's selector
        Returns:
        the Draggable object
      • create

        protected abstract Draggable<?> create​(String id,
                                               String selector,
                                               String helper)
        Creates the new Draggable by using the selector and/or the helper.

        A typical implementation is:
        
         return new Draggable<String>(id) {
        
                protected void onConfigure(JQueryBehavior behavior)
                {
                        super.onConfigure(behavior);
        
                        behavior.setOption("helper", helper);
                }
         };
         
        Parameters:
        id - the markup id
        selector - the related component's selector
        helper - the jQuery helper
        Returns:
        the Draggable object