本文整理汇总了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) {
}
}
});
}
示例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
}
}
示例3: destroy
import org.netbeans.api.editor.EditorRegistry; //导入方法依赖的package包/类
void destroy () {
EditorRegistry.removePropertyChangeListener (this);
}
示例4: finish
import org.netbeans.api.editor.EditorRegistry; //导入方法依赖的package包/类
private void finish() {
EditorRegistry.removePropertyChangeListener(editorsTracker);
for(JTextComponent jtc : EditorRegistry.componentList()) {
AbbrevDetection.remove(jtc);
}
}