NodeBrowse.java 1.53 KB
/*
 * Decompiled with CFR 0_118.
 * 
 * Could not load the following classes:
 *  javax.jcr.RepositoryException
 *  javax.servlet.jsp.PageContext
 */
package com.day.crx.explorer.impl.ui;

import com.day.crx.explorer.impl.ui.MVControl;
import java.io.IOException;
import javax.jcr.RepositoryException;
import javax.servlet.jsp.PageContext;

public class NodeBrowse {
    private MVControl control;

    public NodeBrowse(String name) {
        this.control = new MVControl(name, "Reference", false);
        this.setShowNodes(true);
    }

    public NodeBrowse(String name, String value) {
        this(name);
        this.control.setValues(new String[]{value});
    }

    public void setValue(String value) {
        this.control.setValues(new String[]{value});
    }

    public boolean isShowNodes() {
        return "true".equals(this.control.getProperty("ShowNodes"));
    }

    public void setShowNodes(boolean showNodes) {
        this.control.setProperty("ShowNodes", showNodes ? "true" : "");
    }

    public boolean isShowProps() {
        return "true".equals(this.control.getProperty("ShowProps"));
    }

    public void setShowProps(boolean showProps) {
        this.control.setProperty("ShowNodes", showProps ? "true" : "");
    }

    public static void init(PageContext context) throws IOException {
        MVControl.init(context);
    }

    public void draw(PageContext context) throws IOException, RepositoryException {
        this.control.draw(context);
    }

    public MVControl getControl() {
        return this.control;
    }
}