Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MPS-16300 Attaching a Macro does not set focus into the inspector any…

…more
  • Loading branch information...
commit 79d3599e259809e234792c5c40e34420c9383347 1 parent 6c73d08
@ashatalin ashatalin authored
View
20 editor/editor-runtime/source/jetbrains/mps/nodeEditor/EditorContext.java
@@ -15,6 +15,7 @@
*/
package jetbrains.mps.nodeEditor;
+import com.intellij.openapi.wm.IdeFocusManager;
import jetbrains.mps.ide.project.ProjectHelper;
import jetbrains.mps.nodeEditor.attribute.AttributeKind;
import jetbrains.mps.nodeEditor.cells.EditorCell;
@@ -30,6 +31,7 @@
import jetbrains.mps.util.performance.PerformanceTracer;
import jetbrains.mps.util.Computable;
+import javax.swing.SwingUtilities;
import java.awt.Frame;
import java.util.List;
@@ -249,10 +251,20 @@ public void selectWRTFocusPolicy(final SNode node, final boolean force) {
}
public void openInspector() {
- InspectorTool inspector = getOperationContext().getComponent(InspectorTool.class);
- if (inspector != null) {
- inspector.openTool(true);
- }
+ SwingUtilities.invokeLater(new Runnable() {
+ @Override
+ public void run() {
+ IdeFocusManager.getGlobalInstance().doWhenFocusSettlesDown(new Runnable() {
+ @Override
+ public void run() {
+ final InspectorTool inspector = getOperationContext().getComponent(InspectorTool.class);
+ if (inspector != null) {
+ inspector.openTool(true);
+ }
+ }
+ });
+ }
+ });
}
public void selectAndSetCaret(final SNode node, final int position) {
Please sign in to comment.
Something went wrong with that request. Please try again.