DocumentBrowser

Description

sealed class Tinman.Engine.GUI.Components.DocumentBrowser

Derived from

Container
IJsonizable

A GUI component that displays a collection of documents.

The following default Layout settings are defined for DocumentBrowser objects:

Public / Constructors

DocumentBrowser


public constructor DocumentBrowser → ()

Creates a new instance of DocumentBrowser.

Public / Methods

Content

2 overloads


public method Content1 → (1)

documentIndex in : Path

[not-null]
Path to a text document (see TextDocument.FromFile) that holds the document index. The enclosing directory will be used as the document root path.

Specifies the content for the document browser.

IOException

If an I/O error has occurred while loading the text documents.

ValidatingException

If the given file is not a valid text document (see TextDocument.FromString) or if the text document does not follow the rules for the table of contents of a document browser.


public method Content2 → (2)

documentIndex in : TextDocument

[not-null]
The text document that holds the document index.

documentRoot in : Path

[not-null]
The document root path.

Specifies the content for the document browser.

IOException

If an I/O error has occurred while loading the text documents.

ValidatingException

If the text document does not follow the rules for the table of contents of a document browser.

HelpPath


public method HelpPath → (1)

helpId in : string

The help ID.

returns → Path

The document path or null if not found.

Returns the document path for the given help ID.

See also

IHelpProvider

Show


public method Show → (2)

documentPath opt : Path = null

[not-null]
The document path.

anchor opt : string = null

Optional document anchor.

returns → bool

true if a new document is being shown,
false if the same document is still being shown.

Shows the given document.

Public / Attributes

ContentRoot


public attribute ContentRoot → (get)

value : DataItem

[not-null]
The DataItem that represents the content root of the current document browser content.

Returns the content root item.

The returned DataItem should not be modified. Its properties may be interpreted as follows:

  • DataItem.Text
    The title of the document, as it appears in the navigation tree.

  • DataItem.UserData
    The canonical path to the document file (loadable with TextDocument.FromFile) that is associated with the node. Will be null iff the node does not have an associated document file.

  • DataItem.Children
    The node children represents the children in the navigation tree.

DefaultPath


public attribute DefaultPath → (get)

value : Path

The default document or null iff no content has been specified yet.

Returns the path to the default document.