Resource bundle editor installed but not working on Eclipse (Kepler) - eclipse

I have installed the ResourceBundle Editor plugin (http://essiembre.github.io/eclipse-rbe/) the usual way. In the plugins folder there's the JAR com.essiembre.eclipse.rbe_1.0.6.jar, in the features folder there's the sub folder com.essiembre.eclipse.rbe_1.0.6 with only the feature.xml in it.
The problem is:
I neither get the RIGHT-CLICK on properties file -> Open with... -> ResourceBundle Editor entry nor do I get any preferences as depicted on http://essiembre.github.io/eclipse-rbe/ ...
The above menu entry is missing entirely, even though Help -> Install new software... repeatedly tells me the plugin was/is installed.
Any ideas what's going on and how to fix this?
PS: I think programming tools questions belong here... (?)

Try creating a new file association with the ResourceBundle Editor
Go to Preferences > General > Content Types.
Add a content type: click "Add Root..." and choose a name you want, e.g. "Properties files"
Add a file association: click "Add..." and type "*.properties" (without quotes).
Add an associated editor: click "Add..." and choose "ResourceBundle Editor"
Apply and close.

Related

Eclipse: Error "Variable references empty selection: ${resource_loc}"

I have found that using the Eclipse "external tools" launch configuration is the best way to open my favorite editor on the current file in Eclipse, notably offering a one-time and super-flexible configuration versus the "Open With" menu, which I had tried to use beforehand and always found wanting, constraining, limiting, and requiring repetitive work for many file types. I set up this external tool as follows and this works great for files in my project:
Run:External Tools:External Tools Configurations...
New launch configuration
On the "Build" tab, un-check "Build before Launch"
On the Common tab, check "External Tools" under the "Display in favorites menu"
On the Main tab, enter "/usr/bin/myeditor" for the Location
Under "Working Directory" I am able to leave this blank
Under arguments ${resource_loc}
(At the top, in the "Name" field whatever I want the name to show up as)
I originally found this general technique for launching an external editor right here on stackoverflow.
So you can see ${resource_loc} or ${resource_path} is the one and only variable I need for this to work, and it does work great when I open a file located inside my Eclipse project and click the external tool. That part is fine.
But the problem I have just discovered occurs when I open a file that is not specifically listed in my project and then click the external tool button. It no longer works and I get an error dialog saying: "Variable references empty selection: ${resource_loc}."
Specifically, to reproduce this, I can create a new C++ "Hello World" project (CDT is included in my Eclipse along with Java) then add the line #include "/tmp/whatever.h" at the top of the one cpp file in the project and then right-click on "/tmp/whatever.h" and use the command "Open Declaration" and Eclipse kindly opens the file /tmp/whatever.h. Finally, I invoke my external tool intending to view whatever.h in my editor, and bang, that's when the problem occurs. (Before doing this I put a harmless line of commented text into /tmp/whatever.h.)
Before some SOer asks, no I am not actually trying to #include "/tmp/whatever.h". I am using this #include example as a specific way to show how the error can be reproduced. If you must know, in my case I actually observed the error when trying to open the editor while using Eclipse to browse framework files, files that are not part of my project.
I have already tried ${resource_path} to see if maybe that might have something in it in this context, but same error, and I have looked at the documented list of Eclipse launch variables here and again I don't see anything that looks like it would be more well-defined in the context of a file that is not part of the current project.
My assessment right now is that this is an unsolvable problem and likely just a limitation of trying to use the "External Tools" for this editor launching business. I only settled on that after using the default "Open With" menu in Eclipse for a while and finding the whole setup there highly unsatisfactory and requiring repeated configuration and actually IIRC it just would not work at all I believe in the context of my editor and controlling how many windows are created, whether one or many or one per project etc. Above, I simplified the launch for demonstration purposes.
OS: GNU/Linux Xubuntu 15.10.
Eclipse: Mars.1 Release (4.5.1) Build id: 20150924-1200
You can circumvent the "Workspace is the top-most Eclipse place" rule by linking files (or folders for that matter) in a project.
Example:
Create a new project:
File → New → Project → General → Project → Next → Project name: LinkProject → Finish
Create a file outside-workspace anywhere outside your Eclipse workspace dir.
Import this file as link:
Select LinkProject → File → Import... → General → File System → Next > → From directory: <as chosen for the file above> → Check ☑️ 📄 outside-workspace→ (⚠️ The next can be overlooked easily!) Advanced >> → Check ☑️ Create links in workspace → Finish
NB: I doesn't matter whether you uncheck  ☐ Create link locations relative to: PROJECT_LOC     ˅  or what you select from the list. ${resource_loc} is always the same. Just the file's/folder's Properties → Location: changes. There is a new property for linked files/folders: Resolved location which shows what ${resource_loc} is resolved to: an FQFN.
And, once you linked a file/folder in your project it is part of your project and you can also access it relatively, e.g. with ${workspace_loc:/LinkProject/outside-workspace}' which resolves to the FQFN, too.
See also Eclipse Platform User Guide – Linked resources.

Use Scene Builder in existing Eclipse project

I have an existing Eclipse project with Java 8 and Maven. Now I want to create a window with Oracle's Scene Builder. How can I do that?
All the tutorials start with "Create a new JavaFX project". This doesn't help me. I want to work with my existing project.
You should be able to just create a basic fxml file in your project hierarchy. Then right-click on it and choose "Open with SceneBuilder".
To create the file, if you have e(fx)clipse installed, you can do File -> New -> Other. Then under "JavaFX" choose "FXML document". Put in the name (without the .fxml extension), and choose your root element. Then once the file is created, close it, right-click on it in the package explorer, and open with SceneBuilder.
If you don't have e(fx)clipse, I think you can still do this; just create a blank file (File -> New -> File) and name it with the fxml extension. Then, again, right-click and choose "Open with SceneBuilder". (The only thing I am not sure about is whether this option is available without e(fx)clipse.)

Eclipse does not remember external source attachments

Using Eclipse 4.3.1 (Kepler) on Ubuntu, I find that each time I exit and reenter Eclipse, I have to respecify my external source attachments. What is the key to making Eclipse remember them?
Open the Source Attachment Configuration dialog by clicking on the "Change Attached Source" button in the Class File Editor; or open the similar Java Source Attachment dialog by right-clicking on the containing jar in Package Explorer and selecting "Properties".
I've tried both.
In the dialog, click on the "External File" button and navigate to a jar containing sources, or click on the "External Folder" button and navigate to a directory containing .java files in subdirectories corresponding to the package hierarchy.
All these ways work until I quit Eclipse and come back in.
I have never used these parts of Eclipse; I'm using Maven to manage my dependencies and Maven will automatically attach sources - so take my answer with a grain of salt :-)
I'm not sure why Eclipse doesn't remember those settings. My current feeling is that those settings are temporary.
If you edit the source attachments in the project's properties (look for "Java Build Path"; there is a tab "Libraries"), then the changes should be saved in the file .classpath. Have a look in there.
Lastly, you can try to create a "User Library" (search for this term in the preferences dialog). Here, you can define a bundle of JARs which make up some library. After adding the code JAR, you get options to specify the source JAR.

Hadoop Documentation for Eclipse

I recently installed Hadoop and am able to run simple programs.
However I would like to view documentation for Hadoop classes within Javadoc browser in Eclipse.
Please let me know how to enable that (I am a little novice with Eclipse IDE).
Thanks.
A couple of suggestions:
If you're using maven for your dependency management, you should be able to expand out the list of Maven dependencies in your Eclipse project, right click the hadoop-core-x.x.x.jar and select Maven -> Download Javadocs
Otherwise you'll need to source the Javadocs from the $HADOOP_HOME/docs/api folder and associated with your hadoop-core-x.x.x.jar in Eclipse. In Eclipse, right click your Java project and select Build Path -> Configure Build Path. Now click the Libraries tab and locate the entry for hadoop-core-x.x.x.jar. Expand the entry to show options for Source, Javadoc etc locations and click the Javadoc location entry. Now click the Edit button to the right and enter the location as the path $HADOOP_HOME/docs/api in the Javadoc URL text box (mine is file:/opt/hadoop/hadoop-1.0.2/docs/api/)
Either way now you should be able to hover over Hadoop classes in Eclipse and the Javadoc will popup. You can also show the Javadoc window that will populate for the class you are currently viewing, or just open an internal browser window and point it at the $HADOOP_HOME/docs/api/index.html file
Another easy solution for those who want to stay updated is to edit the Javadocs path like Chris said:
"In Eclipse, right click your Java project and select Build Path -> Configure Build Path. Now click the Libraries tab and locate the entry for hadoop-core-x.x.x.jar. Expand the entry to show options for Source, Javadoc etc locations and click the Javadoc location entry. Now click the Edit button to the right and enter the location as the path"
but instead of linking it directly to the api you have stored on your hard disk, link it to http://hadoop.apache.org/docs/stable/api/

Highlight .tpl syntax in Eclipse

I've been googling and can't find a solution for this. I'm trying to setup .tpl files to use either HTML syntax highlighting or PHP syntax highlighting. Has anyone does this, or do you know how?
Thanks
Go to Window -> Preferences-
Then General -> Editors -> File Associations-
Add the PHP Editor to the *.tpl file type. You may have to create the *.tpl type if it doesn't already exist.
You may also have to set the content type for your tpl files in Content Types also under the General settings. Scroll down to PHP Source File and make sure *.tpl exists there as well.
Then you need to restart eclipse to make it work.
Go to Window -> Preferences -> General -> Content Types
Select Text -> CSS, click Add, write *.tpl and save.
Do the step two for Text -> HTML, Javascript and PHP.
I took that from this link. You can get that form there or I give their content below if the anyhow that link doesn't work. It works for me nicely.
steps how to install SmartyPDT 0.9.1
Be sure that the .TPL files are not associated with any content type (file type). In Eclipse,
Be sure that the .TPL files are not associated with any content type (file type). In Eclipse,
Go to Help-> Install New Software
At the Work With section click on the Add... button. Give the new "Site" a name and set the location with http://smartypdt.googlecode.com/svn/trunk/org.eclipse.php.smarty.updatesite/ , then click OK. Go back to the Install New Software window and select the newly added "site". If the "Group items by category" check-box is checked, uncheck it. Now you should be able to see 1 item in the software list named "Smarty Feature"
Select the Smarty Feature, click Next> and from here afterwards it shouldn't be a problem.
If you are prompted that this is an unsigned package, just ignore the warning and install it anyway.
After the installation completes, restart Eclipse and it should be working.
Define a default PHP executable of type 'Zend Debugger' (only if you install vanilla Eclipse PDT):
In Eclipse go to Window->Preferences->PHP->PHP Executables Click on the Add button. Enter a name for that executable definition, for example "PHP localhost", complete the 2 fields which ask you for the PHP executable path (the PHP binary CLI executable) and php.ini path. Be sure that the PHP debugger is the Zend Debugger.
Installing smarty on eclipse kepler fails
(see Install SmartyPDT 0.0.9.1 in Eclipse Kepler).
The recommendation there is to use the PHP Development Tools (PDT) from former eclipse juno version. But in contrary to the recommendation I did not DELETE the mentioned features folder but I just uninstalled the plugins from eclipse itself (Help/About/InstallationDetails):
Uninstall all PDT packages
Restart eclipse
Then follow the instructions in above answer to install the PDT packages from Juno version and then the smarty package.
All these Installations worked without error.
But unfortunatly the *.tpl files are still not syntax highlighted. What to do more?
Our *.tpl file extension is not associated with the HTML editor in Eclipse by default.
Open Eclipse’s preferences.
Expand General from the tree on the left and select Content Types.
Expand Text on the right and select HTML. Click the Add... button below, enter *.tpl and click the OK button.
General -> Editors -> File Associations
Click Add..., enter *.tpl, and click OK.
Select HTML Editor from the Associated editors: section below and click the Default button to the right.