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


Java JavaPlatformManager.addPropertyChangeListener方法代码示例

本文整理汇总了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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:28,代码来源:Utilities.java

示例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()));
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:15,代码来源:PlatformNode.java

示例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));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:ModuleClassPaths.java

示例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);
            }
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:30,代码来源:RuntimePlatformProblemsProvider.java

示例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);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:NashornPlatform.java

示例6: ResultCache

import org.netbeans.api.java.platform.JavaPlatformManager; //导入方法依赖的package包/类
ResultCache() {
    final JavaPlatformManager jpm = JavaPlatformManager.getDefault();
    jpm.addPropertyChangeListener(WeakListeners.propertyChange(this, jpm));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:5,代码来源:JavaFXPlatformJavadoc.java

示例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());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:7,代码来源:CompilePanel.java


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