本文整理汇总了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);
}
示例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;
}
示例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;
}
}
}
示例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());
}