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


Java OpenProjects.getDefault方法代码示例

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


在下文中一共展示了OpenProjects.getDefault方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: isProjectOpened

import org.netbeans.api.project.ui.OpenProjects; //导入方法依赖的package包/类
public static boolean isProjectOpened(Project p) {
    // Workaround: OpenProjects.getDefault() can be null
    // when called from ProjectOpenedHook.projectOpened() upon IDE startup
    if (OpenProjects.getDefault() == null) {
        return true;
    }
    Project[] projects = OpenProjects.getDefault().getOpenProjects();
    for (int i = 0; i < projects.length; i++) {
        if (projects[i].equals(p)) {
            return true;
        }
    }
    return false;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:15,代码来源:JavaUtil.java

示例3: 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

示例4: RepositoryUpdater

import org.netbeans.api.project.ui.OpenProjects; //导入方法依赖的package包/类
private RepositoryUpdater () {
    LOGGER.log(Level.FINE, "netbeans.indexing.notInterruptible={0}", notInterruptible); //NOI18N
    LOGGER.log(Level.FINE, "netbeans.indexing.recursiveListeners={0}", rootsListeners.hasRecursiveListeners()); //NOI18N
    LOGGER.log(Level.FINE, "FILE_LOCKS_DELAY={0}", FILE_LOCKS_DELAY); //NOI18N
    this.activeDocProvider = Lookup.getDefault().lookup(ActiveDocumentProvider.class);
    if (this.activeDocProvider == null) {
        throw new IllegalStateException("No ActiveDocumentProvider instance in global lookup.");    //NOI18N
    }
    this.globalOpenProjects = OpenProjects.getDefault();
    this.worker = new Task(Lookup.getDefault());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:RepositoryUpdater.java


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