How I can handle double-click the file in project tree ?

Hi, All!
I need handle double-click the file in project tree. It's possible with some action?..

7 comments

Hello r321e,

I need handle double-click the file in project tree. It's possible
with some action?..


What are you actually trying to do? Most likely you don't need to override
the double-click action.

--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

User of my plugin has specified files that will be opened in my external utility.I need to override the double-click action for that.

0

Hello r321e,

User of my plugin has specified files that will be opened in my
external utility.I need to override the double-click action for that.


You'll need to provide an implementation of com.intellij.openapi.fileEditor.FileEditorProvider
interface, and open your external utility from its createEditor() method.
There are lots of places in IntelliJ IDEA from where files can be opened,
and double-click in project view is just one of them. Providing a FileEditorProvider
implementation will cover them all.

--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

I have some problem.

The Interface FileEditorProvider forces me to return a non-null FileEditor.
I called my external tool in the createEditor method that return null. But I don't create FileEditor object from the createEditor method.
How doing in this cause?

0

Did u get this to work ?
If so, how ?

0

I have exactly same question for this.....

 

I want to run external binary when double clicking on a file with a specific extension, so i tried this...

  1. make a class that implements FileEditorProvider
  2. In createEditor() method, I called external binary my own...
  3. And i returned null.

But it cannot be null, cause an error....

Please share a solution for this..

0

Please sign in to leave a comment.