<#assign licenseFirst = "/*">
<#assign licensePrefix = " * ">
<#assign licenseLast = " */">
<#include "../Licenses/license-${project.license}.txt">

package ${PACKAGENAME};

import org.graalvm.visualvm.application.Application;
import org.graalvm.visualvm.core.datasource.DataSource;
import org.graalvm.visualvm.core.snapshot.Snapshot;
import org.graalvm.visualvm.core.ui.DataSourceView;
import org.graalvm.visualvm.core.ui.components.DataViewComponent;
import org.graalvm.visualvm.coredump.CoreDump;
import org.graalvm.visualvm.heapdump.HeapDump;
import org.graalvm.visualvm.host.Host;
import org.graalvm.visualvm.threaddump.ThreadDump;
import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JEditorPane;
import javax.swing.JPanel;
import org.openide.util.ImageUtilities;

public class ${TEMPLATENAME}View extends DataSourceView {

    private DataViewComponent dvc;
    // TODO update the icon path
    private static final String IMAGE_PATH = "org/graalvm/visualvm/coredump/resources/coredump.png"; // NOI18N

    public ${TEMPLATENAME}View(${DISPLAYNAME} My${DISPLAYNAME}) {
        super(My${DISPLAYNAME}, "${TEMPLATENAME}", new ImageIcon(ImageUtilities.loadImage(IMAGE_PATH, true)).getImage(), 60, false);
    }

    @Override
    protected DataViewComponent createComponent() {

        //Data area for master view:
        JEditorPane generalDataArea = new JEditorPane();
        generalDataArea.setBorder(BorderFactory.createEmptyBorder(14, 8, 14, 8));

        //Panel, which we'll reuse in all four of our detail views for this sample:
        JPanel panel = new JPanel();

        //Master view:
        DataViewComponent.MasterView masterView = new DataViewComponent.MasterView
                ("${TEMPLATENAME} Overview", null, generalDataArea);

        //Configuration of master view:
        DataViewComponent.MasterViewConfiguration masterConfiguration = 
                new DataViewComponent.MasterViewConfiguration(false);

        //Add the master view and configuration view to the component:
        dvc = new DataViewComponent(masterView, masterConfiguration);

        // TODO adjust the details view properties
        //Add detail views to the component:
        dvc.addDetailsView(new DataViewComponent.DetailsView(
                "${TEMPLATENAME} Details", null, 10, panel, null), DataViewComponent.TOP_LEFT);

        return dvc;

    }
    
}
