Eclipse does not Highlght my JSP-File - java

I have a weird occurance and can't eclipse.
Somehow, Eclipse does not show the SyntaxHighlighting for one File, but for all the others:
Did some else experience this problem once?
How can I fix this?
I allready tried closing and restarting Eclipse, but it ain't work!

If only one file that having this problem, most likely you accidentally open the file with Text Editor. Eclipse will remember that last editor that you use to open the file. Right click on the file at explorer list, at Popup menu, select Open With > JSP Editor.

Related

Intellij highlight file in Project Explorer

In Eclipse, one can choose a File in Editor, right click and hight-light the file in Project Explorer. That will expand the tree, and one can see the file highlighted.
I'm wondering how one can accomplish the same in Intellij IDEA.
There is a shortcut: ALT + F1 then select 1.Project View.
Or you can press Scroll from Source button:
If you're a fan of keyboard shortcuts like me, you can also assign one via Settings - Keymap
Adding to Ruslan answer, you can also decide to automate the process and keep the Project ToolWindow always in sync with the currently opened editor.
Just tick the Autoscroll * menu items.

Eclipse automatically opening some files in system editor

Was finding this problem with Eclipse(Kepler) over the last week, so downloaded Eclipse (Luna) and checked out the relevent project into an entirely new workspace.
I'm using *.str files for a particular project (they are standard editor files anyway - short for 'string'). But Eclipse wants to open such files as macVim files:
I have NO file associations set for *.str files:
...althought I do use macVim to open them in the underlying operating system. So I change the system editor to TextEdit and Eclipse happily now wants them to open in TextEdit - but I want to open them in the eclipse editor! (appart from anything else, I've got to develop an editor plugin for *.str files.
How can I convince Eclipse that it can open *.str in it's own editors without having to resort to the system editor?
EDIT - follow the answers - my understanding is this. If Eclipse doens't know what the file is, it will ask the system. If you ask it to open in a particular editor it will overlay that information on that particular file, and to make it happen in general (and change the icon) you need to add a file association.
You can add a a File Associations for '*.str' and set the Associated Editor to 'Text Editor'. Eclipse will use this for files that you have not yet opened.
For files that you have already opened Eclipse will be remembering the editor you last used, so for these right click on the file and use 'Open With > Text Editor'. You should only have to do this once.
Right click on the file, select open with, and there should be three options (Text Editor/System Editor/Default). Selecting text editor should associate it with eclipse (from within eclipse only) in future.

Eclipse Class File won't open in java editor?

I've been using eclipse a very long time but I've never encountered this problem.
I have a program I'm working with, and normally to navigate between class files you can simply double click the class file under the project explorer, or you can right click and select open with java editor.
This is fine, but randomly, I have a single class file that when you try to do this, nothing happens. If you select open with text editor, the file opens, but it won't open in java editor. Anyone experienced this?
I fixed it by copying the class file. The duplicate opened normally. Thank God.
Q: You have an Eclipse Java project (or J2EE project), correct?
Q: Most of the .java files in your project open with the (context-sensitive) Java editor, correct? And most of the .class files already compiled in your project open with the "Java decompiler", showing the Java byte code instructions for that class, correct?
Q: The problem is that some of the .java (source) and .class (byte code) files don't behave this way, correct? When a file goes "bad", is it always broken for both .java and the corresponding .class file?
SUGGESTION: Try Project, Clean; then "Project validate". See if one or all of the affected files "recover".
Close your eclipse IDE and compile the project from terminal or CMD using mvn clean install -U -DskipTests=true.See if you get any error in compilation then fix it(usually it is due to some indentation error which by mistake got added in java file),if not just lauch your eclipse IDE and open the corrupt java file ,it should open this time without any issue.

How to enable syntax highlighting in Eclipse Indigo?

How to enable syntax highlighting in Eclipe Indigo? I write in Java. I installed this plugins for more comfortable usage on small screens, but even if I turn it off - all the words in editor are black:(
You may set your coloring preferences by
Window->Preferences-> Java->Editor->Syntax Coloring
Make sure you are using the Java perspective (or Java EE) as well. You should be able to see the name of the active perspective and/or editor in the title bar.
To be 100% sure, you can always right click on the file in question and Open With->Java Editor to ensure that it is the Java editor that is open for your file.
Eclipse remembers which editor you last used to open a file and keeps opening it with that editor, even if you've installed a better one later. Right-click on the file and force it to open with the Java Editor using the "Open With..." menu. If you're not getting any coloring at all, you might just be using the wrong editor.

How get a list of all open files in Eclipse editors?

In my RCP application is editor, almost like in Eclipse. Class editor extends from org.eclipse.ui.texteditor.AbstractTextEditor and it is added in extension in plugin.xml -> org.eclipse.ui.editors. I would like to do view which contains open in editor files. The question is, how do I get a list of all open files?
Screen shot:
I haven't tested it, but you should be able to get it starting from the PlatformUI class.
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getEditorReferences()
In your workspace the following file contains your workbench information:
.metadata/.plugins/org.eclipse.ui.workbench/workbench.xml
It is possible to delete it (or edit it but that requires some fiddling around I suppose) without breaking your workspace, the file gets regenerated by Eclipse. When you delete it all workbench related settings are lost (ie all editors are closed), but your projects of that workspace stay intact.
from that you can get the list of file..

Categories