Open Inspector Window via Intentaion and set position


I'm searching for a way to open the Inspector Window via Intention next to the Editor Window (to the right). Opening the Inspector Window with the current positioning options is archieved easily with editorContext.openInspector(); but I'd like to set the position so that any user who invokes the intention sees the Window in the same place.

Is there a simple solution to my problem that I just didn't notice? Tanks for any help!



By the way, I still hope to get help with extending the editor language. I posted my request alongside this issue since I thought it would be redundant to create a new post.

Comment actions Permalink

I found this API, not sure if it is a good idea since I couldn't find any examples... but it does work:


InspectorTool inspectorTool = editorContext.getOperationContext().getComponent(InspectorTool.class); 

inspectorTool.getToolWindow().setAnchor(ToolWindowAnchor.RIGHT, new Runnable() {
public void run() {
// not sure if you are supposed to do anything here...


Comment actions Permalink

Thanks, Robert! That does the job. Also, I can imagine that other MPS components can be addressed the same way which might come in handy for similar tasks.

Comment actions Permalink

Yes, getToolWindow is part of the BaseTool type. 

Beware that IOperationContext is deprecated. Not sure if "getOperationContext" will survive, but if not we need to look for an alternative way to lookup a component. 


Please sign in to leave a comment.