/*
 * ICESOFT COMMERCIAL SOURCE CODE LICENSE V 1.1
 *
 * The contents of this file are subject to the ICEsoft Commercial Source
 * Code License Agreement V1.1 (the "License"); you may not use this file
 * except in compliance with the License. You may obtain a copy of the
 * License at
 * http://www.icesoft.com/license/commercial-source-v1.1.html
 *
 * Software distributed under the License is distributed on an "AS IS"
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
 * License for the specific language governing rights and limitations under
 * the License.
 *
 * Copyright 2009-2015 ICEsoft Technologies Canada, Corp. All Rights Reserved.
 */
package com.icesoft.faces.application.showcase.view.bean;

import com.icesoft.faces.component.tree.IceUserObject;

import javax.swing.tree.DefaultMutableTreeNode;

/**
 * <p>The NavigationTree node extends IceUserObject by adding two
 * new properties to store extra data; modeId and selected.  The nodeId
 * is a unique identifier used to load content from meta data. The selected
 * attribute is used for display purposes to mark the selected node. </p>
 * <p/>
 * <p>This class does not specify any icons that would normally be used
 * by the Tree component.  Instead CSS Class names are used along with node
 * and branch states to generate hover/rollerover effects which is not
 * possible if the tree components icon facet is used. </p>
 *
 * @since 1.7
 */
public class NavigationTreeNode extends IceUserObject {

    // node id associated with this tree node.  Node Id's are bound to
    // content defined in application meta data.
    private String nodeId;

    // selected state, only one node is intended to be selected at one time.
    private boolean selected;

    public NavigationTreeNode(DefaultMutableTreeNode defaultMutableTreeNode) {
        super(defaultMutableTreeNode);
        this.setExpanded(false);
    }

    public boolean isSelected() {
        return selected;
    }

    public void setSelected(boolean selected) {
        this.selected = selected;
    }

    public String getNodeId() {
        return nodeId;
    }

    public void setNodeId(String nodeId) {
        this.nodeId = nodeId;
    }
}
