10

I am developing some help documentation in a Java project in Eclipse. In the resources folder there are my HTML pages and a couple of GIF and PNG images that will be displayed inside the HTML.

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

I know this is a matter of file associations. However I was not able to get it working.

What I tried to do so far:

As an example I did it for *.gif.

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

Then I pressed "Add..." at the Associated Editors section and added an external gif viewer:

enter image description here

I expected this to open the default image viewing program 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 of some kind?

Terry
  • 14,529
  • 13
  • 63
  • 88
  • if you right click on the file you should be able to choose to open it with system default program or the one choose by you as far as I remember – andrea.marangoni May 22 '14 at 09:26
  • Yop. Opens it in Internet Explorer. Or I can choose one from the same dialog as the screenshot shows. So which one? – Terry May 22 '14 at 09:31

4 Answers4

7

Why not just install plugin for viewing images

http://marketplace.eclipse.org/content/quickimage -> http://psnet.nu/c/quickimage

Sources https://github.com/persal/quickimage

Community
  • 1
  • 1
Paul Verest
  • 60,022
  • 51
  • 208
  • 332
2

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

In fact the problem was with the Windows system. The system's default file association with images was the Internet Explorer. Changing that solved the problem.

Terry
  • 14,529
  • 13
  • 63
  • 88
0

right click on the file -> open With.. and then select -> System Editor (it should remain selected as a checkbox does)

After that you should be able to double click on a file and open it with the right app. My environment is eclipse indigo build 1857 on gentoo linux

EDIT: When you associate some external software with an extension, you should see on the menu "open With.." all application associated with the extension(On the top). Then you can see : Text Editor - System Editor - Default Editor - Other...

  • Text Editor: open your file with the text editor
  • System Editor: open your file with the app associated with extension in the operating system
  • Default Editor: open your file with the (default) app associated by you under Preferences ->General -> EDitor -> File Associaton etc...

You should have something like this picture, without "In-Place Editor" option

enter image description here

andrea.marangoni
  • 1,499
  • 8
  • 22
  • Yeah this opens the Internet Explorer. Is there any way of telling it which system application to use? – Terry May 23 '14 at 09:54
0

Eclipse Oxygen (4.7)

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

You just need to double click the file name in the Package Explorer.

The file URI looks like this file:/// + absolute path:

Opened image in Eclipse

Now there is a bug related to the URI shown on the right side. If you rename the file, it won't be updated without reopening the file.

ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199