how to Open the web page in the file editor position?

Answered

idea plugin develop, I want to click a button in the toolwindow, and different buttons represent different URLs. Open the web page in the file editor position. i need use jcef with jbcefbrowser and cefmessagerouter. 

 I looked at it JCEFHtmlPanelProvider, but do not know how to work? 
The effect is as shown in the figure

0
3 comments

Hi,

Please clarify.

What are URLs? Do they contain hash and do you want to navigate to the hash position?

What is registermessagerouterhanlder? I cannot find anything similar.

There is no figure attached.

0

hi Karol Lewandowski 

i use jcef https://plugins.jetbrains.com/docs/intellij/jcef.html

I will pass it to the plugin code  through js handler. Here is a handler for receiving the url. like cefmessagerouter.

the url like https://www.google.com or any website

My purpose is to create a window in the picture. In the window is a jcefbrowser. After specifying the url, the window will be the same as the browser.


Click this tab page( position 1 in the picture. I want this window to look the same as the file editor next to it,and it will display the browser (position 2 in the picture).

0

Sorry, but it's hard to understand what you are trying to implement, but I assume you want to open pages in the browser like in the editor. If this is the case, then try implementing the com.intellij.openapi.fileEditor.FileEditor and com.intellij.openapi.fileEditor.FileEditorProvider. FileEditor.getComponent() should return a component which will embed the browser. Implementing editor is not trivial. I suggest getting inspiration from the existing implementations:
https://plugins.jetbrains.com/intellij-platform-explorer/extensions?extensions=com.intellij.fileEditorProvider

Also, a potentially similar plugin to what you want to implement: https://plugins.jetbrains.com/plugin/23275-browser (it displays pages in a tool window).

0

Please sign in to leave a comment.