mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
make dependencies explicit
This commit is contained in:
+5
-4
@@ -98,7 +98,7 @@ public class DocumentationManager extends DockablePopupManager<DocumentationComp
|
||||
|
||||
private final ActionManagerEx myActionManagerEx;
|
||||
|
||||
private static final int ourFlagsForTargetElements = TargetElementUtilBase.getInstance().getAllAccepted();
|
||||
private final TargetElementUtilBase myTargetElementUtilBase;
|
||||
|
||||
private boolean myCloseOnSneeze;
|
||||
|
||||
@@ -160,7 +160,7 @@ public class DocumentationManager extends DockablePopupManager<DocumentationComp
|
||||
return ServiceManager.getService(project, DocumentationManager.class);
|
||||
}
|
||||
|
||||
public DocumentationManager(final Project project, ActionManagerEx managerEx) {
|
||||
public DocumentationManager(final Project project, ActionManagerEx managerEx, TargetElementUtilBase targetElementUtilBase) {
|
||||
super(project);
|
||||
myActionManagerEx = managerEx;
|
||||
final AnActionListener actionListener = new AnActionListener() {
|
||||
@@ -199,6 +199,7 @@ public class DocumentationManager extends DockablePopupManager<DocumentationComp
|
||||
};
|
||||
myActionManagerEx.addAnActionListener(actionListener, project);
|
||||
myUpdateDocAlarm = new Alarm(Alarm.ThreadToUse.POOLED_THREAD,myProject);
|
||||
myTargetElementUtilBase = targetElementUtilBase;
|
||||
}
|
||||
|
||||
private void closeDocHint() {
|
||||
@@ -578,11 +579,11 @@ public class DocumentationManager extends DockablePopupManager<DocumentationComp
|
||||
}
|
||||
|
||||
if (element == null) {
|
||||
element = assertSameProject(util.findTargetElement(editor, ourFlagsForTargetElements, offset));
|
||||
element = assertSameProject(util.findTargetElement(editor, myTargetElementUtilBase.getAllAccepted(), offset));
|
||||
|
||||
// Allow context doc over xml tag content
|
||||
if (element != null || contextElement != null) {
|
||||
final PsiElement adjusted = assertSameProject(util.adjustElement(editor, ourFlagsForTargetElements, element, contextElement));
|
||||
final PsiElement adjusted = assertSameProject(util.adjustElement(editor, myTargetElementUtilBase.getAllAccepted(), element, contextElement));
|
||||
if (adjusted != null) {
|
||||
element = adjusted;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2012 JetBrains s.r.o.
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -68,7 +68,11 @@ public class BookmarkManager extends AbstractProjectComponent implements Persist
|
||||
return project.getComponent(BookmarkManager.class);
|
||||
}
|
||||
|
||||
public BookmarkManager(Project project, MessageBus bus, PsiDocumentManager documentManager, EditorColorsManager colorsManager) {
|
||||
public BookmarkManager(Project project,
|
||||
MessageBus bus,
|
||||
PsiDocumentManager documentManager,
|
||||
EditorColorsManager colorsManager,
|
||||
EditorFactory editorFactory) {
|
||||
super(project);
|
||||
colorsManager.addEditorColorsListener(new EditorColorsListener() {
|
||||
@Override
|
||||
@@ -77,7 +81,7 @@ public class BookmarkManager extends AbstractProjectComponent implements Persist
|
||||
}
|
||||
}, project);
|
||||
myBus = bus;
|
||||
EditorEventMulticaster multicaster = EditorFactory.getInstance().getEventMulticaster();
|
||||
EditorEventMulticaster multicaster = editorFactory.getEventMulticaster();
|
||||
multicaster.addDocumentListener(new MyDocumentListener(), myProject);
|
||||
multicaster.addEditorMouseListener(new MyEditorMouseListener(), myProject);
|
||||
|
||||
|
||||
+10
-10
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -40,11 +40,14 @@ import java.util.Arrays;
|
||||
* @author ilyas
|
||||
*/
|
||||
public class GroovyCompilerLoader extends AbstractProjectComponent {
|
||||
static final String GROOVY_STUBS = "groovyStubs";
|
||||
private final CompilerManager myCompilerManager;
|
||||
private final FileEditorManager myFileEditorManager;
|
||||
|
||||
public static final String GROOVY_STUBS = "groovyStubs";
|
||||
|
||||
public GroovyCompilerLoader(Project project) {
|
||||
public GroovyCompilerLoader(Project project, CompilerManager manager, FileEditorManager editorManager) {
|
||||
super(project);
|
||||
myCompilerManager = manager;
|
||||
myFileEditorManager = editorManager;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -67,8 +70,7 @@ public class GroovyCompilerLoader extends AbstractProjectComponent {
|
||||
|
||||
@Override
|
||||
public void projectOpened() {
|
||||
CompilerManager compilerManager = CompilerManager.getInstance(myProject);
|
||||
compilerManager.addCompilableFileType(GroovyFileType.GROOVY_FILE_TYPE);
|
||||
myCompilerManager.addCompilableFileType(GroovyFileType.GROOVY_FILE_TYPE);
|
||||
|
||||
myProject.getMessageBus().connect().subscribe(FileEditorManagerListener.FILE_EDITOR_MANAGER, new FileEditorManagerAdapter() {
|
||||
@Override
|
||||
@@ -76,12 +78,10 @@ public class GroovyCompilerLoader extends AbstractProjectComponent {
|
||||
if (file.getName().endsWith(".java") && file.getPath().contains(GROOVY_STUBS)) {
|
||||
final PsiClass psiClass = findClassByStub(myProject, file);
|
||||
if (psiClass != null) {
|
||||
final FileEditorManager fileEditorManager = FileEditorManager.getInstance(myProject);
|
||||
final FileEditor[] editors = fileEditorManager.getEditors(file);
|
||||
final FileEditor[] editors = myFileEditorManager.getEditors(file);
|
||||
if (editors.length != 0) {
|
||||
decorateStubFile(file, fileEditorManager, editors[0]);
|
||||
decorateStubFile(file, myFileEditorManager, editors[0]);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user