Play 2.0 with Eclipse 3.6, Scala template editing - eclipse

I´m new to Play and Scala world, so I´m needing some help to figure out how can I edit the scala template files using Eclipse. I already installed scala ide 2.9 but when I try to edit the index.scala.html, the contents of the file aren´t editable...
Please can anyone help me?

I experienced this just recently, too, but lucky for you I made the full migration from IntelliJ to Eclipse.
There is some setting up you need to do with the Scala templates, but one of the easiest ways to get it done is following these steps:
Step 1: Add file extensions
http://help.eclipse.org/helios/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Ftasks%2Ftasks-51.xhtml
Be sure that your file extensions are properly added to the file associations.
Step 2:
Look at the associated editor. In the image above you'll see that the only associated editor with *.htm is Web Browser. So you'll need to hit the "Add..." button to add the Scala editor. Don't forget to set it as default :)
Step 3:
Right-click on your Scala template and be sure that you are choosing the right editor. You can also use this to switch between editors.
Hope this helps!

Related

How can you Import Forge Mods into Eclipse

Specifically I'm trying to edit this mod: https://www.curseforge.com/minecraft/mc-mods/naruto-anime-mod-plus/files/3050483
I'm not just trying to edit the config, I want to add custom stuff as well.
You can't do it easily because the mods is NOT open-source. In fact, it's All right reserved, so you are not allowed to do it. So do at your own risk.
1) Get the source code
You can ask to the original dev, but it's sure it will decline your question.
Else, you have to decompile the jar thanks to utilities like javadecompilers.com.
2) Create a new Java Project in eclipse
Create a blank java project
3) Copy/paste the code in your eclipse project
*The code obtain thanks to decompilation
4) Before using it, you should fix all decompilation issue.
Finally, I think it's a better idea to create a new one, specially because it will be faster to upgrade it in 1.17 or make more edition.

Create plug-in that creates a snapshot of the source code currently opened on editor - Eclipse CDT

I need to create a plug-in for Eclipse CDT that sends a "snapshot" of the source code of the currently opened editor each time the code is "built".
I am already capable of doing it each time the user presses a custom button created by me, but it would be great if it could be done when the "standard" "build" action is performed.
Do i need no create a plug-in of the type "builder"?
I am using Eclipse 4.4.0...
Can someone help me?! (Sorry for some english mistakes... :( )
One solution would be to create your own custom "Builder". Instead of actually building the code, it would invoke the functionality you already have.
For information on how to use the eclipse build system, please have a look here: https://wiki.eclipse.org/Eclipse/FAQ/How_do_I_implement_an_Eclipse_builder%3F.
Also, this website goes into more details about building in eclipse: https://www.eclipse.org/articles/Article-Builders/builders.htm. However, I think that the first one should do.
As a side note, this works with any kind of eclipse project (JDT and CDT). The build described there is common to all flavours.
Hope it helps,
-Caius

Add a new Template in Eclipse for Project Type / Executable

First I'm really new to Eclipse.
I searched a long time for a solution for my problem, and I already found some threads but I can't really follow what they are doing.
So my problem is, I want to add a new "Template" to the New -> C Project -> Project Type - Executable folder in the Wizard.
Like the default "Empty Project" and the "Hello World"
http://s1.directupload.net/images/131027/ktganjqa.png
Somebody know how I can do this?
And it would be nice if you could explain it fully cause, like I'm said, I'm quiet new to Eclipse
Greetz AllesFam
You have to create a plug-in, add a simple definition in the plugin.xml that points to a template.xml where you define what files should be copied to the newly created project.
For simple to average templates, no Java programming is required, the descriptive xml-s are enough.
You can take a look how I added templates to GNU ARM Eclipse Plug-in, the source code is available from the SourceForce git.

how to add my own templates to eclipse in play! framework editor

I've noticed that the play plugin for eclipse adds a play editor,
along with several useful templates
I'd like to add my own ones, but I couldn't find the way to do it
I go to window, preferences, web, html files, templates and I can add
templates to eclipse html editor, but I couldn't find a similar option
for play editor
Check out the source code for the play plugin :
https://github.com/playframework/playclipse/tree/master/source/templates
You might want to fork it and add your templates to that file. That is what I would do. But I do not have enough Eclipse development knowledge to help you further than point the direction.
I had a lok at the source, it seems like the template editor tags are defined here
https://github.com/playframework/playclipse/blob/master/source/src/org/playframework/playclipse/editors/html/HTMLEditor.java
looks like there's no support for creating your own templates thru eclipse...

How to programmatically get information in Eclipse

I'm developing an Eclipse Plug-in.
I need to programmatically get both filepath and filename of the selected/active file in the eclipse editor.
Also need to programmatically add an existing file (located outside the project) to the project and then open it on the editor.
I'm a totally beginner with Eclipse, so complete solution would be appreciated.
You question is quite general, but this should clear things up a bit:
Eclipse Plugin Development Tutorial
About adding a file to the project, you have to read the documentation and find where eclipse handles projects. I think that if you have a reference to the project it should be easy.
Hope it helps =)
Your editor is most likely inheriting from IEditorPart, so you should be able to call getEditorInput(), which then may or may not turn out to be a FileEditorInput, for example. From there, you can get at the underlying details of the file.
For your second problem, you can use IProject.create() and then e.g. do an IFile.createLink() and use a local filesystem path, or copy the file using IFile.appendContents().
Have you tried the solution proposed in http://www.eclipse.org/forums/index.php/mv/msg/97927/300308/#msg_300308?