views:

102

answers:

3

I'm using the HTML editor resp. the Structured Text Editor in Eclipse very often but one settings gets me going crazy. It always opens in the tab Visual/Source (as seen in the picture below)

Editor tabs

Is there a possibility to tell Eclipse it should always open this editor in the Source tab?
That would help me a lot.

A: 

You didn't say what version of Eclipse you're using. My HTML / Structured Text editors didn't have the tabs the same as yours. I'm using 3.4.2.

You can extend that editor by writing your own plug-in for Eclipse. Outside of the 'create a plug-in project' stuff, start by finding the extension points for the target editor. Then your plug-in can just register as an extension and add a new property instead of writing a whole editor. The property should show up on a preference page and then your code can take care of switching the active view of the editor to the 'Source' tab based on that property.

Kelly French
+3  A: 

You seem to use a plugin which associates with HTML files. For example Eclipse normally loads XML files for the first time with Design tab, and once you switch to source tab, it remembers the next time to open any document associated with XML Editor in Source tab. I don't know remembering is up to Eclipse or up to the plugin associated with the file, but a quick workaround would be:

  1. to right click on the HTML file in package explorer > Open With > choose another editor (e.g. text editor). This only associates with current file. If you want to change file association for all HTMLs:
  2. goto Preferences (under menu Window) > General > Editor > File Associations and change HTML file association there.
Mohsen
A: 

Right click the file and then "open with" and open it in another HTML or texteditor. And then map this editor as the default editor for this filetype by right clicking the document and setting the file extension.

I always do this to get rid of the memory greedy WYSIWYG editors.

Lars