## com.imcode.imcms.api
Class TextDocument.Menu

    java.lang.Object
      com.imcode.imcms.api.TextDocument.Menu

Enclosing class:
  TextDocument

    public static class TextDocument.Menu

extends java.lang.Object

Field Summary
`static int` `SORT_BY_HEADLINE` Menu sorted by headline.
`static int` `SORT_BY_MANUAL_ORDER_DESCENDING` Menu sorted by 'manual' order.
`static int` `SORT_BY_MODIFIED_DATETIME_DESCENDING` Menu sorted by datetime.
`static int` `SORT_BY_PUBLISHED_DATETIME_DESCENDING` Menu sorted by tree sort order.
`static int` `SORT_BY_TREE_ORDER_ASCENDING` Menu sorted by tree sort order.
`static int` `SORT_BY_TREE_ORDER_DESCENDING` Deprecated. Wrong name, use `SORT_BY_TREE_ORDER_ASCENDING`.

Method Summary
`void` `addDocument(Document documentToAdd)` Add a internalTextDocument to the menu.
`Document[]` `getDocuments()`
`TextDocument.MenuItem[]` `getMenuItems()`
`TextDocument.MenuItem[]` `getPublishedMenuItems()`
`int` `getSortOrder()`
`Document[]` `getVisibleDocuments()`
`TextDocument.MenuItem[]` `getVisibleMenuItems()`
`void` `removeDocument(Document documentToRemove)` Remove a internalTextDocument from the menu.
`void` `setSortOrder(int sortOrder)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### SORT_BY_HEADLINE

    public static final int SORT_BY_HEADLINE

  Menu sorted by headline.

  See Also:
    Constant Field Values

### SORT_BY_MANUAL_ORDER_DESCENDING

    public static final int SORT_BY_MANUAL_ORDER_DESCENDING

  Menu sorted by 'manual' order.

  See Also:
    Constant Field Values

### SORT_BY_MODIFIED_DATETIME_DESCENDING

    public static final int SORT_BY_MODIFIED_DATETIME_DESCENDING

  Menu sorted by datetime.

  See Also:
    Constant Field Values

### SORT_BY_TREE_ORDER_DESCENDING

    public static final int SORT_BY_TREE_ORDER_DESCENDING

  Deprecated. Wrong name, use `SORT_BY_TREE_ORDER_ASCENDING`.
  Menu sorted by tree sort order.

  See Also:
    Constant Field Values

### SORT_BY_TREE_ORDER_ASCENDING

    public static final int SORT_BY_TREE_ORDER_ASCENDING

  Menu sorted by tree sort order.

  See Also:
    Constant Field Values

### SORT_BY_PUBLISHED_DATETIME_DESCENDING

    public static final int SORT_BY_PUBLISHED_DATETIME_DESCENDING

  Menu sorted by tree sort order.

  See Also:
    Constant Field Values

Method Detail

### addDocument

    public void addDocument(Document documentToAdd)

  Add a internalTextDocument to the menu.

  Parameters:
    `documentToAdd` - the document to add

### removeDocument

    public void removeDocument(Document documentToRemove)

  Remove a internalTextDocument from the menu.

  Parameters:
    `documentToRemove` - the document to remove

### setSortOrder

    public void setSortOrder(int sortOrder)

  Parameters:
    `sortOrder` - One of `SORT_BY_HEADLINE`, `SORT_BY_MANUAL_ORDER_DESCENDING`, `SORT_BY_MODIFIED_DATETIME_DESCENDING`, or `SORT_BY_TREE_ORDER_DESCENDING`

### getSortOrder

    public int getSortOrder()

### getVisibleMenuItems

    public TextDocument.MenuItem[] getVisibleMenuItems()

  Returns:
    The visible menuitems in this menu.
  Since:
    2.0

### getVisibleDocuments

    public Document[] getVisibleDocuments()

  Returns:
    the documents returned by `getVisibleMenuItems()`.
  Since:
    2.0

### getMenuItems

    public TextDocument.MenuItem[] getMenuItems()

  Returns:
    The menuitems in this menu that the user can see or edit, excluding archived documents.

### getPublishedMenuItems

    public TextDocument.MenuItem[] getPublishedMenuItems()

  Returns:
    The menuitems in this menu that the user can see or edit, including archived documents.

### getDocuments

    public Document[] getDocuments()

  Returns:
    the documents returned by `getMenuItems()`.