本文整理汇总了Java中org.netbeans.api.java.platform.JavaPlatformManager.addPropertyChangeListener方法的典型用法代码示例。如果您正苦于以下问题:Java JavaPlatformManager.addPropertyChangeListener方法的具体用法?Java JavaPlatformManager.addPropertyChangeListener怎么用?Java JavaPlatformManager.addPropertyChangeListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.netbeans.api.java.platform.JavaPlatformManager
的用法示例。
在下文中一共展示了JavaPlatformManager.addPropertyChangeListener方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createUniversalCPInfo
import org.netbeans.api.java.platform.JavaPlatformManager; //导入方法依赖的package包/类
public synchronized ClasspathInfo createUniversalCPInfo() {
Reference<ClasspathInfo> r = cached;
if (r != null) {
ClasspathInfo c = r.get();
if (c != null) {
return c;
}
}
JavaPlatform select = JavaPlatform.getDefault();
final JavaPlatformManager man = JavaPlatformManager.getDefault();
if (select.getSpecification().getVersion() != null) {
for (JavaPlatform p : JavaPlatformManager.getDefault().getInstalledPlatforms()) {
if (!"j2se".equals(p.getSpecification().getName()) || p.getSpecification().getVersion() == null) continue;
if (p.getSpecification().getVersion().compareTo(select.getSpecification().getVersion()) > 0) {
select = p;
}
}
}
final ClasspathInfo result = ClasspathInfo.create(select.getBootstrapLibraries(), ClassPath.EMPTY, ClassPath.EMPTY);
if (cached != null) {
this.cached = new WeakReference<>(result);
}
if (weakL == null) {
man.addPropertyChangeListener(weakL = WeakListeners.propertyChange(this, man));
}
return result;
}
示例2: PlatformProvider
import org.netbeans.api.java.platform.JavaPlatformManager; //导入方法依赖的package包/类
public PlatformProvider (
@NonNull final Project project,
@NonNull final PropertyEvaluator evaluator,
@NonNull final Pair<Pair<String,String>, ClassPath> boot) {
this.project = project;
this.evaluator = evaluator;
this.boot = boot;
final JavaPlatformManager jps = JavaPlatformManager.getDefault();
jps.addPropertyChangeListener(WeakListeners.propertyChange(this, jps));
this.evaluator.addPropertyChangeListener(WeakListeners.propertyChange(this,evaluator));
if (this.boot.second() != null) {
this.boot.second().addPropertyChangeListener(WeakListeners.propertyChange(this, this.boot.second()));
}
}
示例3: PlatformModulePath
import org.netbeans.api.java.platform.JavaPlatformManager; //导入方法依赖的package包/类
PlatformModulePath(
@NonNull final PropertyEvaluator eval,
@NonNull final String platformType) {
Parameters.notNull("evel", eval); //NOI18N
Parameters.notNull("platformType", platformType); //NOI18N
this.eval = eval;
this.platformType = platformType;
this.eval.addPropertyChangeListener(WeakListeners.propertyChange(this, this.eval));
final JavaPlatformManager jpm = JavaPlatformManager.getDefault();
jpm.addPropertyChangeListener(WeakListeners.propertyChange(this, jpm));
}
示例4: initListeners
import org.netbeans.api.java.platform.JavaPlatformManager; //导入方法依赖的package包/类
private void initListeners() {
if (listens.compareAndSet(false, true)) {
final JavaPlatformManager jpm = JavaPlatformManager.getDefault();
jpm.addPropertyChangeListener(WeakListeners.propertyChange(
this,
jpm));
J2SEProject j2sePrj = project.getLookup().lookup(J2SEProject.class);
if (j2sePrj != null) {
j2sePrj.evaluator().addPropertyChangeListener(this);
} else {
LOG.log(
Level.WARNING,
"No property evaluator provider in project {0}({1})", //NOI18N
new Object[]{
ProjectUtils.getInformation(project).getDisplayName(),
FileUtil.getFileDisplayName(project.getProjectDirectory())
});
}
final FileObject projectFolder = project.getProjectDirectory();
if (projectFolder != null) {
final File projectDir = FileUtil.toFile(projectFolder);
if (projectDir != null) {
final File cfgDir = new File(projectDir, CFG_PATH); //NOI18N
FileUtil.addFileChangeListener(this, cfgDir);
}
}
}
}
示例5: NashornPlatform
import org.netbeans.api.java.platform.JavaPlatformManager; //导入方法依赖的package包/类
private NashornPlatform() {
JavaPlatformManager jpm = JavaPlatformManager.getDefault();
platformListener = new PlatformManagerListener();
jpm.addPropertyChangeListener(WeakListeners.propertyChange(platformListener, jpm));
Settings.getPreferences().addPreferenceChangeListener(
WeakListeners.create(PreferenceChangeListener.class, platformListener, Settings.getPreferences()));
nashornPlatform = getNashornPlatform(jpm);
}
示例6: ResultCache
import org.netbeans.api.java.platform.JavaPlatformManager; //导入方法依赖的package包/类
ResultCache() {
final JavaPlatformManager jpm = JavaPlatformManager.getDefault();
jpm.addPropertyChangeListener(WeakListeners.propertyChange(this, jpm));
}
示例7: PlatformsModel
import org.netbeans.api.java.platform.JavaPlatformManager; //导入方法依赖的package包/类
public PlatformsModel() {
JavaPlatformManager jpm = JavaPlatformManager.getDefault();
getPlatforms(jpm);
jpm.addPropertyChangeListener(WeakListeners.propertyChange(this, jpm));
sel = Union2.createFirst(jpm.getDefaultPlatform());
}