Eclipse - Is it possible to link to a file from within a Java comment? - eclipse

I am looking for a way to link from a comment inside a .java file to another file somewhere in the project folder (like CMD-clicking a Java Type links to the Type declaration). In my case I am working on a (Spring Roo backed) web application, so I have controllers and view files.
What I have in mind may look like this (Javadoc-oriented but of course not parsed but used directly as a link):
public String orderlist(ModelMap modelMap){
modelMap.addAttribute("orders", Order.findAllOrders());
// #link("/WEB-INF/views/order/list.jspx")
return "order/list";
}
I want to CMD-click on the comment link to open the file.
I am heavily using Working Sets, filters and of course CMD+SHIFT+R ("Open Resource"), which are all great, but this might come in handy working on a controller and the corresponding view (especially in a team). Is this possible somehow, a basic feature that I missed completely so far or even total nonsense for some reason? I realize that those links should be considered when, for example, refactor|move the view file.

The feature you're describing is Eclipse's hyperlink detectors: http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/extension-points/org_eclipse_ui_workbench_texteditor_hyperlinkDetectors.html. Unfortunately I'm not sure an implementation as you're describing is likely available.
There's an URLHyperlinkDetector that can pick up URLs, so you could potentially put a file:// URL in a comment and link to that, but I think that Eclipse is hard-wired to assume it's something that can be opened in it's browser. It's worth a shot, but of course the absolute paths would break sharing across teams/machines.
You could try your hand at contributing your own via a plugin that your team could install. Here's an implementation we created in Aptana Studio for picking up relative URIs in files and opening them in editors if possible: https://github.com/aptana/studio3/blob/development/plugins/com.aptana.editor.common/src/com/aptana/editor/common/text/hyperlink/HyperlinkDetector.java

Related

React Folder structure question regarding Features

I know this has been asked to death, but I always like to make my life as easy as possible, and I know this somewhat comes down to a bit of personal preference and also depends upon the size of the project.
I recently saw a WDS video: https://www.youtube.com/watch?v=UUga4-z7b6s where he talks about folder structures, and I really like it.
My question comes down to this 'Features' directory in the advanced directory, unfortunately he doesn't give a code example but from what he (and another website I found that have a similar practice https://profy.dev/article/react-folder-structure#discussion-feature-driven-folder-structure-and-screaming-architecture) describes, the features directory is basically the code for the page, i.e. all the logic, rendering, etc you name it sit in there, and the actual page itself.
So far I follow along and it makes sense, however, this is where the confusion is, I have a large project I'm working on, and if I take for example the Registration page, I have a folder structure like this (note I'm using NextJS as well):
Now if I were to move all of that to a features folder, does that mean I'd not just have a file called 'register.tsx' with basically the following:
import Registration from 'features/registration';
export default Page() {
return <Registration />
}
Other than just having a simple pages folder, this feels redundant to me.
that seems to be bit redundant indeed! When you watch videos like the one from WDS you linked above, you always have to keep in mind that not all folder structures work as good for every type of project.
Since the folder structure needed for the NextJs page directory already is feature/page based, it's totally fine to not use a features folder and just only use the pages folder. This way you mitigate redundant work 'just to have a features folder for the sake of having one'.

"private" comments in Eclipse

I would like to write "private" comments in Eclipse while working on Java projects. In other words, I would like to write comments associated with areas in the Java classes that only I can see but other developers working on the project cannot. The comments therefore cannot be regular comments in the source code. Ideally I would select an area on a Java source file and have a view in the perspective allowing me to write and read my comments associated with the selected area. Those comments should be persisted in a file(s) outside of the Java source files of the project.
I understand that as other developers modify the Java code my comments might become stale and I will have to eventually have to work to alleviate this problem. I am not worried about the persistence right now, either.
How do I handle the Eclipse part of the challenge, i.e. create my own view in/to which I can write/read comments and have it associated with locations in the source files? Or, can I display comments lines in the source files that are not saved along with the source so that they are "private"?
This sounds like what you can already do with the Bookmarks View, aside from the text presentation in the view itself being rather limited.

Eclipse plugin for better JSP support

I'm looking for an eclipse plugin which can at least search where the current JSP is included (or the path mentioned for example in custom "include like" tags or comment or anything). Similar like doing copy qualified name and do a file search with the correct path.In IDEA it's called Analyze Backward Dependencies and it works for JSPs too (at least for the standard includes).
A better one would be to show all the JSPs where the current one is included and show all the included JSPs recursively as a tree maybe so I can navigate in it easily. I'm not sure if this can be done to be usable (I think it would be slow).
Another feature I would like if I click on a variable's name it jumps to where it's declared with even if it's declared in a different JSP.IDEA can do this too.
I have a simple solution for the first one but I can't add more functionality to it as I'm not familiar with the eclipse plugin system and RCP and I don't really have time to learn it.
And please don't tell me to use IDEA because unfortunately that's not an option at work.

Auto upload files in included path using Netbeans

I have a NetBeans javascript project with several included paths for plugins. I do not want to include the plugins in my core repository, so I have created separate, external folders for each and am including them via an include path. Because I test across many devices, I need my changes to upload on save and this works fine for the main code base, however, I would like to be able to edit a plugin via the include path and see those changes auto uploaded as well. Is this possible?
As of right now, the only alternative I see is to create separate projects for each plugin, which I am willing to do if this is the only option. The single project workflow is very preferable to me and I might be willing to switch IDE's if this is possible in another environment.
I would be happy to elaborate if my intentions are unclear.
I don't think it's possible. What about creating one single "umbrella" project for all plugins and simply manage it the same way you do the main project?
Personal note: What you have is basically several projects and the uploading is focused always on single project. So what you want is like "I want to treat them as projects but not to at the same time" :) Btw, how do you edit a plugin? I guess open it as a project in NetBeans or use some text editor. So again you basically treat it as a project.

Are URLs to doxygen pages permanent

hey everyone, we just added a nightly action to process the entire source tree with doxygen and place the output onto development webserver.
We also already have a sharepoint structure which holds design documents for various modules/projects. Currently, the level at which we are keeping this documentation is relatively high. We discuss structures of modules and talk about the major classes, but never go down to the individual method level. I wanted to bridge that gap by having hyperlinks in the SDS word documents that would point to doxygen output.
I noticed the links look like this:
http://example.com/docs/ProjectName/d4/d98/class_c_reader.html
http://example.com/docs/ProjectName/d4/d16/class_c_stream.html
The part that sketches me out a bit is "d4", "d98" and "d16" strings in the path. If I copy these links and create the hyperlinks, does anyone know if these URLs are guaranteed be preserved in the future. As I said, entire doxygen output gets regenerated nightly.
You can disable the d4/d98 subdirectories by disabling CREATE_SUBDIRS in the doxygen configuration.
Whether the name of the HTML files will stay the same I do not know for sure but from what I have seen when using doxygen it seems so. If you want to know for sure you can always look at the doxygen source.
Probably these links will not stay permanent.
Furthermore, Doxygen has a XML representation of the generated documentation but even this interface resp. the corresponding DSD has been changed with new releases of doxygen. This is quite frustrating, as we had used the XML representation for a similar application with the assumption that the structures would be kept identical with every new release.