Class SortableMenu

java.lang.Object
overit.geocall.ui.Menu
overit.geocall.ui.SortableMenu
All Implemented Interfaces:
SingleUseComponent

public class SortableMenu extends Menu
This class extends Menu and implements a menu in which the Items are sortable each other using the Sortable.js plugin.
It allows to define an item identifier (see setItemIdentifierAttribute(java.lang.String)) that will be used by the plugin to identify a specific item and send to the server the reorder related infos.
It also needed to set a server event to which the plugin send the reorder informations related.
  • Field Details

    • dragAndDropEvent

      protected String dragAndDropEvent
    • itemIdentifierAttribute

      protected String itemIdentifierAttribute
  • Constructor Details

    • SortableMenu

      public SortableMenu(Teacher t)
  • Method Details

    • setDragAndDropEvent

      public void setDragAndDropEvent(String event)
      Parameters:
      event - defined for drag and drop action
    • setItemIdentifierAttribute

      public void setItemIdentifierAttribute(String itemIdentifierAttribute)
      Parameters:
      itemIdentifierAttribute - attribute to identify the item
    • getDragAndDropEvent

      public String getDragAndDropEvent()
      Returns:
      the event for drag and drop
    • getItemIdentifierAttribute

      public String getItemIdentifierAttribute()
      Returns:
      the identifier for the item
    • drawItem

      protected org.apache.ecs.Element drawItem(Menu.Item mi, boolean fullmenu, Window w)
      Overrides:
      drawItem in class Menu
    • buildSetupScript

      public void buildSetupScript(StringBuilder sb)
      Description copied from class: Menu
      Every component can add a script to the StringBuilder, script executed when the component is created The method add the script that manage the creation and showing of the menu
      Specified by:
      buildSetupScript in interface SingleUseComponent
      Overrides:
      buildSetupScript in class Menu
      Parameters:
      sb - The StringBuilder on which we want to add the script