Eclipse File Associations: Image Display

I am developing some reference documentation in a Java project in Eclipse. The resources folder has my HTML pages and several GIF and PNG images that will be displayed inside the HTML.

Now for my convenience, I want to view images in the file structure of the project, see what they show, and which one to include in the HTML page. If I double-click the image, the default action that Eclipse performs is this: it opens in Internet Explorer. Since I don't like IE, I want to change this default action. In fact, I would rather have it open some kind of image viewer inside Eclipse.

I know this is a file association issue. However, I could not get it to work.

What I tried to do so far:

As an example, I did this for * .gif.

I went to Preferences -> General -> Editors -> File Associations . There I clicked "Add ..." and added *.gif .

Then I clicked "Add ..." in the "Related Editors" section and added an external gif view:

enter image description here

I expected this to open the default image viewer from my Windows system, but for some reason, it still opens it in Internet Explorer.

So what can I do to change this? Does Eclipse have an internal image viewer?

+6
source share
4 answers

There was nothing wrong with Eclipse, and the solution described is in order.

Actually the problem was on a Windows system. The default system file association for images was Internet Explorer. Change this solution to the problem.

+2
source

right click on the file โ†’ open C .. and then select โ†’ System Editor (it should remain selected as a check box)

After that, you can double-click the file and open it using a suitable application. My environment is eclipse indigo build 1857 on gentoo linux

EDIT: When you associate some external software with an extension, you should see the entire application related to the extension (above) in the "Open with .." menu. Then you can see: Text editor - System editor - Default editor - Other ...

  • Text editor: open the file with a text editor
  • System editor: open the file with the application associated with the extension in the operating system.
  • Default editor: open the file using the application (by default) associated with you in the section "Settings" โ†’ "General" โ†’ "Editor" โ†’ "File", etc ...

You should have something like this image, without the "Editor in place"

enter image description here

0
source

Eclipse Oxygen (4.7)

Eclipse Oxygen (4.7) added the following function - Images are opened in the Eclipse IDE .

You just need to double-click the file name in the package explorer.

The file URI is as follows: file:/// + absolute path:

Open image in Eclipse

Now there is an error related to the URI shown on the right side. If you rename a file, it will not be updated without reopening the file.

0
source

Source: https://habr.com/ru/post/969686/


All Articles