3

I work for a big company that has standards on Java project names. Long standards:

com.company.department.subdepartment.stream.project

Rather than let the package explorer take up a sizable portion of my screen, I'm looking for a way to shorten the project names. Mousing over project names shows the full name, but it's still very slow to determine which project I want to look at next with the incredibly long names. As has been answered before, package names can be shortened. I've got a rule set up, but it only works for packages:

com.company.department.subdepartment={department}

Is there a way to do an analogous thing for project names in Eclipse?

Community
  • 1
  • 1
Will Beason
  • 3,417
  • 2
  • 28
  • 46
  • I think that this question isn't going deep enough into the root cause of the problem. Aren't the project names defined in the .project file? Why are these files under version control - they shouldn't be (and there are questions/answers about this, I believe). Anyone should be able to name the project that they see in Eclipse anything they want and not check in the .project and .classpath files. – Thomas Owens Feb 10 '15 at 16:01
  • We use the Rational Team Concert extension to Eclipse, so it all gets sync'd to the repository. Since we've got so many programmers sharing projects, the standardized system is to ensure collisions don't happen. – Will Beason Feb 10 '15 at 16:09
  • I haven't used RTC, but most version control tools can select the files to ignore. A simple Google search did turn up [a method to exclude files from changesets](https://jazz.net/help-dev/clm/index.jsp?re=1&topic=/com.ibm.team.scm.doc/topics/t_scm_eclipse_ignore.html&scope=null). This would be accepted as a good practice (see [here](http://stackoverflow.com/questions/116121/shoul-i-keep-my-project-files-under-version-control) and [here](http://stackoverflow.com/questions/2818239/classpath-and-project-check-into-version-control-or-not) and others). I would really suggest looking at your process – Thomas Owens Feb 10 '15 at 16:11
  • Tried it, it didn't work. I told RTC to ignore the .project file and deleted the one in the repository, synced, and changed the name, and the name still changed in RTC. – Will Beason Feb 10 '15 at 16:17
  • 1
    That seems like an RTC issue. A better question would be, then: "How do I make RTC's Eclipse extension ignore my .project and .classpath files?" And then describe what you've tried that didn't work, of course. – Thomas Owens Feb 10 '15 at 16:18
  • Basically, that doesn't work. Only way to resolve the issue is to get Eclipse to shorten the package names. – Will Beason Feb 19 '15 at 21:15

2 Answers2

1

Package explorer uses the org.eclipse.jdt.internal.ui.packageview.PackageExplorerLabelProvider class to provide the view labels. Going through the source of this I don't see any support for shortening the project names.

greg-449
  • 109,219
  • 232
  • 102
  • 145
0

The following ideas depend on how your eclipse workspaces are setup. If you're lucky and you just import project from your VCS, these could work for you.

If you're using maven, Eclipse project names are usually derived from your GAV. The Import as Maven project wizard has options for what pattern to use for the project name based on your maven GAV.

Otherwise, you can sometimes just right click the project -> rename. YMMV if you have any scripts or such that have the project name hardcoded. If you have these constraints, find those scripts and use variables rather than hardcoding.

Jeff
  • 43
  • 5