mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-238427 Get rid of components in GUI Designer plugin
GitOrigin-RevId: 8564e354807b758b2bf0f89c0529f5166d3b79b4
This commit is contained in:
committed by
intellij-monorepo-bot
parent
7210b9bda3
commit
43d6dc5a03
@@ -132,18 +132,11 @@
|
||||
<projectService serviceImplementation="com.intellij.uiDesigner.palette.Palette"/>
|
||||
|
||||
<projectService serviceImplementation="com.intellij.uiDesigner.clientProperties.ClientPropertiesManager"/>
|
||||
</extensions>
|
||||
|
||||
<project-components>
|
||||
<component>
|
||||
<implementation-class>com.intellij.uiDesigner.propertyInspector.DesignerToolWindowManager</implementation-class>
|
||||
<headless-implementation-class/>
|
||||
</component>
|
||||
<component>
|
||||
<implementation-class>com.intellij.ide.palette.impl.PaletteToolWindowManager</implementation-class>
|
||||
<headless-implementation-class/>
|
||||
</component>
|
||||
</project-components>
|
||||
<projectService serviceImplementation="com.intellij.uiDesigner.propertyInspector.DesignerToolWindowManager" headlessImplementation=""/>
|
||||
|
||||
<projectService serviceImplementation="com.intellij.ide.palette.impl.PaletteToolWindowManager" headlessImplementation=""/>
|
||||
</extensions>
|
||||
|
||||
<actions>
|
||||
<group id="GuiDesigner.MainToolbarActions">
|
||||
|
||||
@@ -38,7 +38,7 @@ public class PaletteToolWindowManager extends AbstractToolWindowManager {
|
||||
}
|
||||
|
||||
public static PaletteToolWindowManager getInstance(Project project) {
|
||||
return project.getComponent(PaletteToolWindowManager.class);
|
||||
return project.getService(PaletteToolWindowManager.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.actionSystem.PlatformDataKeys;
|
||||
import com.intellij.openapi.command.CommandProcessor;
|
||||
import com.intellij.openapi.fileEditor.FileEditor;
|
||||
import com.intellij.openapi.fileEditor.FileEditorManager;
|
||||
import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.progress.ProcessCanceledException;
|
||||
import com.intellij.openapi.project.Project;
|
||||
@@ -586,16 +587,17 @@ public final class FormEditingUtil {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static GuiEditor getActiveEditor(final DataContext context) {
|
||||
public static GuiEditor getActiveEditor(@NotNull DataContext context) {
|
||||
Project project = CommonDataKeys.PROJECT.getData(context);
|
||||
if (project == null) {
|
||||
if (project == null || project.isDisposed()) {
|
||||
return null;
|
||||
}
|
||||
final DesignerToolWindowManager toolWindowManager = DesignerToolWindowManager.getInstance(project);
|
||||
if (toolWindowManager == null) {
|
||||
return null;
|
||||
for (FileEditor editor : FileEditorManager.getInstance(project).getSelectedEditors()) {
|
||||
if (editor instanceof UIFormEditor) {
|
||||
return ((UIFormEditor)editor).getEditor();
|
||||
}
|
||||
}
|
||||
return toolWindowManager.getActiveFormEditor();
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ public class DesignerToolWindowManager extends AbstractToolWindowManager impleme
|
||||
}
|
||||
|
||||
public static DesignerToolWindowManager getInstance(@NotNull Project project) {
|
||||
return project.getComponent(DesignerToolWindowManager.class);
|
||||
return project.getService(DesignerToolWindowManager.class);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
Reference in New Issue
Block a user