Apache NetBeans Wiki Index

Note: These pages are being reviewed.

How to listen for projects to be opened/closed?

Specific for a project-type

Implement a ProjectOpenedHook and register it to a project-type `

@ProjectServiceProvider(
    service =ProjectOpenedHook.class,
    projectType = {"org-netbeans-modules-web-project"}
)
public class MyProjectOpenedHook extends ProjectOpenedHook {

    private final Project project;

    public MyProjectOpenedHook(Project project) {
        this.project = project;
    }

    @Override
    protected void projectOpened() {
          System.out.println("opened"+project);
    }

    @Override
    protected void projectClosed() {
          System.out.println("closed"+project);
    }
}

Apache Migration Information

The content in this page was kindly donated by Oracle Corp. to the Apache Software Foundation.

This page was exported from http://wiki.netbeans.org/DevFaqListenForOpeningClosingProject , that was last modified by NetBeans user Markiewb on 2015-03-12T18:54:53Z.

NOTE: This document was automatically converted to the AsciiDoc format on 2018-02-07, and needs to be reviewed.