How to set template file for properties files in Eclipse? - eclipse

It is easy to set the template for build.xml(Window->Preferences->Ant->Editor->Template), but I could not figure out how to set template for properties file. In Window->Perference, there is not a properties editor->template option at all.
So how could I set the template for properties file?
Thanks.

It seems that the properties file editor inside eclipse does not have the template file features.
If fact , you can open the the *.properties using any editors with the template file features .Just right click from the editor content ---> Open With ---> Other ---> Internal Editors , and choose the editor with the template feature (eg Ant Editor) .Then , you can use the template files setup in that editor

Related

Plant UML in Visual Studio Code // Config file

I'm using Plant UML in VS-Code to generate diagrams: https://marketplace.visualstudio.com/items?itemName=jebbs.plantuml
I want to edit the global default extension setting:
Set input folder for the .puml files and ...
the output folder for the generated .png files
Question: I can't find the config file with the Export Settings for PlantUML in VS Code. Where could I find it, or how shall it be set up correctly to work with the IDE?
You could create a directory .vscode in the root directory of your project and put a file called 'settings.json' with these settings
{
"plantuml.commandArgs": [],
"plantuml.diagramsRoot": "../docs/diagrams/src",
"plantuml.exportOutDir": "../docs/diagrams/out"
}
See:
https://marketplace.visualstudio.com/items?itemName=jebbs.plantuml
Go to the section called "Include Files Search Logic"
On vscode
Go to File --> Preferences --> Settings
Search for plantuml and you will be presented by screen below
Change export format
Set output folder, default is out
uncheck the box if you don't want subfolder created, check if you want subfolder
Test

To create yml file in eclipse

I would like to create buildspec.yml file in eclipse. I have downloaded yaml editor and ydit from eclipse market place. How to create yaml file in src code. i could see only class and other files. not yaml. Please help on this
It's just normal file text, Right click your wanted project -> New -> Other -> File.
If you need more support you could install Yedit from Eclipse Market.
YEdit is an Eclipse editor for editing YAML files. It has the following features:
Syntax highlighting
Syntax checking
Content outline
Templates
Various text editing support like auto-indenting and toggling of comments.
Symfony compatibility mode. * Source formatting (experimental)
Use Right-click > New > Other > File and make sure its extension is .yaml or .yml.
PS: I suggest you try https://marketplace.eclipse.org/content/eclipse-wild-web-developer-web-development-eclipse-ide instead of Yedit. It's a better alternative IMO.

Can syntax highlighting be enabled for Groovy DSL with custom file extension in Eclipse?

We are working on creating a custom Domain Specific Language in Groovy. We plan to use a custom file name extension ( for example .xyz ) for the code written in this DSL.
I and using eclipse as my IDE.
When i change the extension of the file from .groovy to .xyz, eclipse considers this file as a text file and removes all the color codes that are associated with a groovy file.
Is there any configuration in Eclipse that will associate the .xyz file as a groovy source file?
I see that there are a .dsld file https://spring.io/blog/2011/05/09/better-dsl-support-in-groovy-eclipse but this do not seem to be a solution to my above problem.
You can associate a file extension with a editor content type in the Eclipse Preferences. Go to the 'General > Content Types' page in the preferences.
Find and select the Groovy content type in the list and click 'Add..' to add your '.xyz' extension to the list of file associations.
You can also do this in an Eclipse plugin using org.eclipse.core.contenttype.contentTypes extension point.

Where are per-file editor type overrides stored

In Eclipse, you have a set of default editors set up in Preferences > General > Editors > File Associations. When you open a file, if you select "Open With" and choose an editor other than the default for that file type, Eclipse remembers which editor you chose for that file, and uses it again when you re-open that file later.
Where are these per-file overrides for which editor to use stored?
If Open With has been used to select a specific editor this is stored using
IFile file = ... the file
file.setPersistentProperty(IDE.EDITOR_KEY, "editor id");
where IDE is org.eclipse.ui.ide.IDE.
you can use file.getPersistentProperty(IDE.EDITOR_KEY) to get this value.
Eclipse saves this information in the following file under the workspace:
.metadata/.plugins/org.eclipse.ui.workbench/workbench.xml
In that file, there are editor tags for the files being used in the workbench which associate them to the corresponding editors.

Eclipse: Open JSP file on CTRL+CLICK of jsp path

I used to open a jsp file included in another jsp file by just click the path by CTRL+CLICK in eclipse. But for sometime now this is not working. Don't understand why!!!.
eg. <jsp:include page="../someFile.jsp" /> if we just hover over this path and CTRL+CLICK it used to open the file in new tab in eclipse. Help Guys!!!
Im using Eclipse Indigo.
I'll admit to grasping at straws here, but it sounds like the default editor (or the editor specified for this specific file) has changed. From the Navigator or *Explorer menu select the JSP file and right-mouse-button "Open With..." to see the available editors for JSP. The checked editor in the list is the one you're using now. Try the other editors to see if they support the CTRL-CLICK action.