Java Code Examples for org.netbeans.modules.maven.api.NbMavenProject#removePropertyChangeListener()

The following examples show how to use org.netbeans.modules.maven.api.NbMavenProject#removePropertyChangeListener() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CosChecker.java    From netbeans with Apache License 2.0 6 votes vote down vote up
@Override
        protected void projectClosed() {
            NbMavenProject prj = project.getLookup().lookup(NbMavenProject.class);
            if (prj != null) {
                prj.removePropertyChangeListener(listener);
                final MavenProject mvn = prj.getMavenProject();
                //TODO do we want to reconsider this?
                RP.post(new Runnable() {
                    @Override
                    public void run() {
//                        try {
//                            //also delete the IDE generated class files now?
//                            cleanGeneratedClassfiles(project);
//                        } catch (IOException ex) {
//                            LOG.log(Level.FINE, "Error cleaning up", ex);
//                        } finally {
                            deleteCoSTimeStamp(mvn, true);
                            deleteCoSTimeStamp(mvn, false);
//                        }
                    }
                });
            }
        }
 
Example 2
Source File: OtherRootNodeFactory.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public void removeNotify() {
    NbMavenProject watch = project.getLookup().lookup(NbMavenProject.class);
    watch.removePropertyChangeListener(this);
    watch.removeWatchedPath(MAIN); //NOI18N
    watch.removeWatchedPath(TEST); //NOI18N            
    FileObject fo = project.getProjectDirectory().getFileObject(MAIN);
    if (fo != null) {
        fo.removeFileChangeListener(fcl);
    }
    fo = project.getProjectDirectory().getFileObject(TEST);
    if (fo != null) {
        fo.removeFileChangeListener(fcl);
    }
}
 
Example 3
Source File: OthersRootChildren.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
protected void removeNotify() {
    setKeys(Collections.<SourceGroup>emptySet());
    NbMavenProject.removePropertyChangeListener(project, changeListener);
    super.removeNotify();
    
}
 
Example 4
Source File: MissingNbInstallationProblemProvider.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public void removePropertyChangeListener(PropertyChangeListener listener) {
    pchs.removePropertyChangeListener(listener);
    if (pchs.getPropertyChangeListeners().length == 0) {
        //add listeners to open projects and project changes
        NbMavenProject.removePropertyChangeListener(project, propertyListener);
        OpenProjects.getDefault().removePropertyChangeListener(weak);
    }
}
 
Example 5
Source File: GroovySourcesNodeFactory.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public void removeNotify() {
    NbMavenProject watch = project.getLookup().lookup(NbMavenProject.class);
    watch.removePropertyChangeListener(this);
    watch.removeWatchedPath(MAIN_GROOVY);
    watch.removeWatchedPath(TEST_GROOVY);
    removeListener(MAIN_GROOVY);
    removeListener(TEST_GROOVY);
}
 
Example 6
Source File: WebCopyOnSave.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public void cleanup() {
    if (active) {
        cleanUpListeners();
        NbMavenProject.removePropertyChangeListener(getProject(), this);
        active = false;
    }
}
 
Example 7
Source File: J2eeMavenSourcesImpl.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public void removeChangeListener(ChangeListener changeListener) {
    cs.removeChangeListener(changeListener);
    
    // If this was the last registered listener, stop listening at project changes
    if (!cs.hasListeners()) {
        NbMavenProject.removePropertyChangeListener(project, pcl);
    }
}
 
Example 8
Source File: ProjectHookImpl.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
protected void projectClosed() {
    //is null check necessary?
    if (refreshListener != null) {
        NbMavenProject watcher = project.getLookup().lookup(NbMavenProject.class);
        watcher.removePropertyChangeListener(refreshListener);
        refreshListener = null;
    }
    if (preferencesListener != null) {
        getPreferences().removePreferenceChangeListener(preferencesListener);
        preferencesListener = null;
    }

    if (lastJ2eeProvider != null) {
        Deployment.getDefault().disableCompileOnSaveSupport(lastJ2eeProvider);
        lastJ2eeProvider = null;
    }
    CopyOnSave copyOnSave = project.getLookup().lookup(CopyOnSave.class);
    if (copyOnSave != null) {
        copyOnSave.cleanup();
    }
    
    CssPreprocessorsListener cssSupport = project.getLookup().lookup(CssPreprocessorsListener.class);
    if (cssSupport != null) {
        CssPreprocessors.getDefault().removeCssPreprocessorsListener(cssSupport);
    }

    ClientSideDevelopmentSupport clientSideSupport = project.getLookup().lookup(ClientSideDevelopmentSupport.class);
    if (clientSideSupport != null) {
        clientSideSupport.close();
    }
}
 
Example 9
Source File: ProjectFilesNode.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override protected void removeNotify() {
    NbMavenProject.removePropertyChangeListener(project, this);
    project.getProjectDirectory().removeFileChangeListener(fileChangeListener);
}
 
Example 10
Source File: DependenciesNodeFactory.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override
public void removeNotify() {
    NbMavenProject.removePropertyChangeListener(project, this);
}
 
Example 11
Source File: ModulesNodeFactory.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override
public void removeNotify() {
    NbMavenProject.removePropertyChangeListener(project, this);
}
 
Example 12
Source File: SiteDocsNodeFactory.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override
public void removeNotify() {
    NbMavenProject.removePropertyChangeListener(project, this);
}
 
Example 13
Source File: GenSourcesNodeFactory.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override
public void removeNotify() {
    NbMavenProject.removePropertyChangeListener(project, this);
}
 
Example 14
Source File: MavenSourcesImpl.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public @Override void removeChangeListener(ChangeListener changeListener) {
    cs.removeChangeListener(changeListener);
    if (!cs.hasListeners()) {
        NbMavenProject.removePropertyChangeListener(project(), pcl);
    }
}
 
Example 15
Source File: WebPagesNodeFactory.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override
public void removeNotify() {
    NbMavenProject.removePropertyChangeListener(project, this);
}