# All files / scripts/CDP/UI/listview GroupListItemView.ts

60% Statements 12/20
33.33% Branches 2/6
33.33% Functions 3/9
52.94% Lines 9/17

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    641x

    1x

    1x

    1x

    1x

    1x

    1x

    1x

    1x

     ﻿namespace CDP.UI {

        const TAG = "[CDP.UI.GroupListItemView] ";

        /**
         * @interface GroupListItemViewOptions
         * @brief GroupListItemView のオプション
         */
        export interface GroupListItemViewOptions<TModel extends Backbone.Model = Backbone.Model> extends ListItemViewOptions<TModel> {
            groupProfile?: GroupProfile;    //!< GroupProfile インスタンス
        }

        /**
         * @class GroupListItemView
         * @brief ExpandableListView が扱う ListItem コンテナクラス
         */
        export class GroupListItemView<TModel extends Backbone.Model = Backbone.Model> extends ListItemView<TModel> {

            private _groupProfile: GroupProfile = null;    //!< 管轄の GroupProfile

            /**
             * constructor
             *
             * @param options {GroupLineViewOptions} [in] オプション
             */
            constructor(options: GroupListItemViewOptions<TModel>) {
                super(options);
                this._groupProfile = options.groupProfile;
            }

            ///////////////////////////////////////////////////////////////////////
            // protected methods

            /**
             * 展開状態を判定
             *
             * @return {Boolean} true: 展開, false:収束
             */
            protected isExpanded(): boolean {
                return this._groupProfile.isExpanded();
            }

            //! 展開中か判定
            protected isExpanding(): boolean {
                return (<BaseExpandableListView>this.owner).isExpanding();
            }

            //! 収束中か判定
            protected isCollapsing(): boolean {
                return (<BaseExpandableListView>this.owner).isCollapsing();
            }

            //! 開閉中か判定
            protected isSwitching(): boolean {
                return (<BaseExpandableListView>this.owner).isSwitching();
            }

            //! 子 Group を持っているか判定
            protected hasChildren(layoutKey?: string): boolean {
                return this._groupProfile.hasChildren(layoutKey);
            }
        }
    }