Navigation Menu

Skip to content

Commit

Permalink
MPS-16300 Attaching a Macro does not set focus into the inspector any…
Browse files Browse the repository at this point in the history
…more
  • Loading branch information
ashatalin committed Jul 3, 2012
1 parent 6c73d08 commit 79d3599
Showing 1 changed file with 16 additions and 4 deletions.
Expand Up @@ -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;
Expand All @@ -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;

Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 79d3599

Please sign in to comment.