Class ContentItemOrderComparator

java.lang.Object
org.craftercms.studio.impl.v1.util.ContentComparatorBase<ContentItemTO>
org.craftercms.studio.impl.v1.util.ContentItemOrderComparator
All Implemented Interfaces:
Comparator<ContentItemTO>

public class ContentItemOrderComparator extends ContentComparatorBase<ContentItemTO>
This class compares two DmContentItem based on their order values specified by order name
Author:
hyanghee, Dejan Brkic
  • Field Details

    • _listFloatingPagesLast

      protected boolean _listFloatingPagesLast
      if this is set to true, floating items will come last in the child list
    • _listLevelDescriptorsFirst

      protected boolean _listLevelDescriptorsFirst
      if this is set to true, level descriptors will come first in the child list
  • Constructor Details

    • ContentItemOrderComparator

      public ContentItemOrderComparator(String orderName, boolean ascending, boolean listFloatingPagesLast, boolean listLevelDescriptorsFirst)
      constructor that sets the order name and the sort type
      Parameters:
      orderName -
      ascending -
      listFloatingPagesLast - if this is set to true, floating items will come last in the child list
      listLevelDescriptorsFirst - if this is set to true, level descriptors will come first in the child list
  • Method Details

    • setListFloatingPagesLast

      public void setListFloatingPagesLast(boolean listFloatingPagesLast)
      Parameters:
      listFloatingPagesLast - the listFloatingPagesLast to set
    • isListFloatingPagesLast

      public boolean isListFloatingPagesLast()
      Returns:
      the listFloatingPagesLast
    • setListLevelDescriptorsFirst

      public void setListLevelDescriptorsFirst(boolean listLevelDescriptorsFirst)
      Parameters:
      listLevelDescriptorsFirst - the listLevelDescriptorsFirst to set
    • isListLevelDescriptorsFirst

      public boolean isListLevelDescriptorsFirst()
      Returns:
      the listLevelDescriptorsFirst
    • compare

      public int compare(ContentItemTO item1, ContentItemTO item2)