use of com.jetbrains.edu.learning.editor.StudyEditorFactoryListener in project intellij-community by JetBrains.
the class StudyProjectComponent method initComponent.
@Override
public void initComponent() {
EditorFactory.getInstance().addEditorFactoryListener(new StudyEditorFactoryListener(), myProject);
ActionManager.getInstance().addAnActionListener(new AnActionListener() {
@Override
public void beforeActionPerformed(AnAction action, DataContext dataContext, AnActionEvent event) {
AnAction[] newGroupActions = ((ActionGroup) ActionManager.getInstance().getAction("NewGroup")).getChildren(null);
for (AnAction newAction : newGroupActions) {
if (newAction == action) {
myListener = new FileCreatedByUserListener();
VirtualFileManager.getInstance().addVirtualFileListener(myListener);
break;
}
}
}
@Override
public void afterActionPerformed(AnAction action, DataContext dataContext, AnActionEvent event) {
AnAction[] newGroupActions = ((ActionGroup) ActionManager.getInstance().getAction("NewGroup")).getChildren(null);
for (AnAction newAction : newGroupActions) {
if (newAction == action) {
VirtualFileManager.getInstance().removeVirtualFileListener(myListener);
}
}
}
@Override
public void beforeEditorTyping(char c, DataContext dataContext) {
}
});
}
Aggregations