当前位置: 首页>>代码示例>>Java>>正文


Java OpenProjects.addPropertyChangeListener方法代码示例

本文整理汇总了Java中org.netbeans.api.project.ui.OpenProjects.addPropertyChangeListener方法的典型用法代码示例。如果您正苦于以下问题:Java OpenProjects.addPropertyChangeListener方法的具体用法?Java OpenProjects.addPropertyChangeListener怎么用?Java OpenProjects.addPropertyChangeListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.netbeans.api.project.ui.OpenProjects的用法示例。


在下文中一共展示了OpenProjects.addPropertyChangeListener方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: AbstractProjectSearchScope

import org.netbeans.api.project.ui.OpenProjects; //导入方法依赖的package包/类
protected AbstractProjectSearchScope(String interestingProperty) {
    super();
    this.interestingProperty = interestingProperty;
    OpenProjects openProjects = OpenProjects.getDefault();
    openProjectsWeakListener = WeakListeners.propertyChange(this,
            openProjects);
    openProjects.addPropertyChangeListener(openProjectsWeakListener);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:AbstractProjectSearchScope.java

示例2: run

import org.netbeans.api.project.ui.OpenProjects; //导入方法依赖的package包/类
@Override
public void run () {
    // cvs might have been installed manually, check that
    if (CvsInstallerModuleConfig.getInstance().isCvsInstalled() || isCvsInstalled()) {
        doFinish();
        return;
    }
    if (downloadWindowDisplayed || CvsInstallerModuleConfig.getInstance().isIgnored()) {
        return;
    }
    // cvs not yet installed, attach a listener to open projects and wait for a cvs project to be opened
    OpenProjects projs = OpenProjects.getDefault();
    if (listener == null) {
        projs.addPropertyChangeListener(WeakListeners.propertyChange(listener = new PropertyChangeListener() {
            @Override
            public void propertyChange (PropertyChangeEvent evt) {
                if (OpenProjects.PROPERTY_OPEN_PROJECTS.equals(evt.getPropertyName())) {
                    task.schedule(0);
                }
            }
        }, projs));
    }
    Project[] projects;
    try {
        projects = projs.openProjects().get();
    } catch (Exception ex) {
        LOG.log(Level.INFO, null, ex);
        projects = projs.getOpenProjects();
    }
    for (Project p : projects) {
        FileObject fo = p.getProjectDirectory();
        File f = FileUtil.toFile(fo);
        // is the project directory under CVS control?
        if (f != null && getTopmostManagedAncestor(f, true) != null) {
            processCvsProject(p);
            break;
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:40,代码来源:CvsInstaller.java


注:本文中的org.netbeans.api.project.ui.OpenProjects.addPropertyChangeListener方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。