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


Java EditorRegistry.removePropertyChangeListener方法代码示例

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


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

示例1: propertyChange

import org.netbeans.api.editor.EditorRegistry; //导入方法依赖的package包/类
@Override
public void propertyChange(PropertyChangeEvent evt) {
    final JTextComponent component = EditorRegistry.focusedComponent();
    FileObject fo = component != null ? NbEditorUtilities.getFileObject(component.getDocument()) : null;
    if (target == null || target != fo) {
        return;
    }
    EditorRegistry.removePropertyChangeListener(this);
    RequestProcessor.getDefault().post(new Runnable() {

        @Override
        public void run() {
            try {
                JavaSource js = JavaSource.forDocument(component.getDocument());
                js.runModificationTask(new Task<WorkingCopy>() {

                    @Override
                    public void run(WorkingCopy parameter) throws Exception {
                        parameter.toPhase(JavaSource.Phase.RESOLVED);
                        CompilationUnitTree cut = parameter.getCompilationUnit();
                        if (!cut.getTypeDecls().isEmpty()) {
                            TreePath path = TreePath.getPath(cut, cut.getTypeDecls().get(0));
                            if (isAbstract) {
                                GeneratorUtils.generateAllAbstractMethodImplementations(parameter, path);
                            }
                            if (hasNonDefaultConstructor) {
                                ConstructorGenerator.Factory factory = new ConstructorGenerator.Factory();
                                Iterator<? extends CodeGenerator> generators = factory.create(Lookups.fixed(component, parameter, path)).iterator();
                                if (generators.hasNext()) {
                                    generators.next().invoke();
                                }
                            }
                        }
                    }
                }).commit();
            } catch (IOException ioe) {
            }
        }
    });
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:41,代码来源:CreateSubclass.java

示例2: propertyChange

import org.netbeans.api.editor.EditorRegistry; //导入方法依赖的package包/类
@Override
public void propertyChange(PropertyChangeEvent evt) {
    ToggleBookmarkAction action = actionRef.get();
    if (action != null) {
        action.updateEnabled();
    } else {
        EditorRegistry.removePropertyChangeListener(this); // EditorRegistry fires frequently so remove this way
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:ToggleBookmarkAction.java

示例3: destroy

import org.netbeans.api.editor.EditorRegistry; //导入方法依赖的package包/类
void destroy () {
    EditorRegistry.removePropertyChangeListener (this);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:EditorBookmarksModule.java

示例4: finish

import org.netbeans.api.editor.EditorRegistry; //导入方法依赖的package包/类
private void finish() {
    EditorRegistry.removePropertyChangeListener(editorsTracker);
    for(JTextComponent jtc : EditorRegistry.componentList()) {
        AbbrevDetection.remove(jtc);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:7,代码来源:CodeTemplatesModule.java


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