Eclipse Project Explorer Icons or Name - eclipse

In the Eclipse Project Explorer, I wish to add either a special icon or modify the name of a project to display whether a certain project parameter is set for a project. Is this possible, if yes how can I do it? I do not want to change the name of the project because that will mess up other items.

This can only be done by creating an Eclipse plugin. I believe following may fit the bill:
Label decorators (Decorators extension point)
Project natures/nature images (Nature images extension point)

Related

Eclipse to IntelliJ transfer

I have copied my src package structure from eclipse to intellij and it makes this structure within src folder:
How do I make it dz1.drugi so I can one click expand all to my classes?
Another question is how to select default project folder as it is "workspace" at \Users\{Name} for eclipse. Right now, when I create new project like this:
it saves it without workspace (or projects folder) at \Users\{Name}.
Click on the cog icon at the top-right of the explorer view, and check the "Flatten packages" option.
That said, If you get used to keyboard shortcuts top open classes and files, and navigate through recently opened files, you'll quickly see that you'll amost never use the explorer view anymore.
Project view has an option to compact empty middle packages, enable it. You can also use Flatten packages option. Actually, your question is a duplicate of this one.
IntelliJ IDEA remembers the last location you've used when creating a new project. Once you want to create another project, the location one level upper of the previous project directory would be suggested. So, create a project in C:\Users\someuser\workspace\myproject1 and IDE will suggest C:\Users\someuser\workspace\myproject2 for your new myproject2.

Eclipse plugin: Using components of another perspective

I already created a new Eclipse perspective, but I would like to know if it is possible to use the same elements and buttons (toolbar ones) that are in the C/C++ perspective?
Is there a way to use them in my own perspective?
Usually all plug-ins has a folder called icons in it. Look into this folder and copy the icons to your plug-in.
For C/C++ perspective icons look at all jars(inside <eclipseInstallationLocation>\plugins folder) containing the name 'cdt` copy all icon files from these jars to your plugin.

How can I change custom perspective's icon in eclipse?

I want to change my custom perspective's icon in eclipse. I have searched a lot but I didn't find any solution.
The icon for a perspective can be changed by updating the iconURI attribute of the perspective's definition in workbench.xmi file. This file is located inside the .metadata directory of the workspace. e.g. /My-Workspace/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi.
There are usually two lines with the iconURI attribute. For example:
<children xsi:type="advanced:Perspective" ... iconURI="platform:/plugin/com.atlassian.clover.eclipse.core/icons/cview16/clover.gif" tooltip="Clover">
and
<snippets xsi:type="advanced:Perspective" ... iconURI="platform:/plugin/com.atlassian.clover.eclipse.core/icons/cview16/clover.gif" tooltip="Clover">
The icon URI is a path to an image within an Eclipse plugin. (Plugins are located at {ECLIPSE_HOME}/plugins directory.)
The workbench.xmi file needs to be edited after closing the Eclipse IDE, because the file gets overwritten when you exit from Eclipse.
In this example I created a custom perspective named Clover by modifying the Java Perspective available in Eclipse, and saving it as "Clover". Initially my perspective had the same icon as the Java perspective:
So I closed Eclipse, changed the icon paths in workbench.xmi, saved the file, reopened the IDE, and got the new icon displayed:
Note: I use Eclipse 4.6.0 (Neon) but this solution would work for all Eclipse 4 versions.
If you stored an existing perspective under a different name as your custom perspective, then it is not possible to change the icon.
You would have to define the perspective by writing a small Eclipse plugin to be able to change the icon.
Open plugin.xml for your plugin; go to the Extensions page; and select your perspective extension (in org.eclipse.ui.perspectives: you should have your custom prspective entered in here). There is an icon attribute you can set for your custom perspective. (I am using Neon2)

How can I specify the icon for a new wizard in Eclipse?

I've added a custom new project wizard to Eclipse which uses the preexisting Java nature. Here's the block from plugin.xml where I add it:
<wizard
class="com.corp.eclipse.wizard.project.NewExtensionWizard"
descriptionImage="/rsrc/icons/app.png"
finalPerspective="org.eclipse.jdt.ui.JavaPerspective"
icon="rsrc/icons/app.png"
id="framer.newExtensionWizard"
name="Extension Project"
project="true">
</wizard>
The "Extension Project" project type shows up just fine in the "New" dialog, but the icon is not displayed. Does anyone know if there's a trick to getting icons attached to wizards in Eclipse? This is Eclipse 3.5.2.
I had the same issue as yours and I had to breakpoint through the initialisation code to finally find out why. This may be your issue:
In AbstractUIPlugin.class, imageDescriptorFromPlugin(...)
// if the bundle is not ready then there is no image
Bundle bundle = Platform.getBundle(pluginId);
if (!BundleUtility.isReady(bundle)) {
return null;
}
The bundle may not be loading. This can happen if the id of the plugin is not a prefix of the extension point (as was my case). So, the id for your wizard is framer.newExtensionWizard. Unless your entire plugin id (Bundle-SymbolicName in MANIFEST.MF) is just framer, the method is not going to find the bundle, and thus the image will not appear.
The solution then is to make sure that whatever id you give your plugin, make sure all extension point ids use that id as a prefix.
Is rsrc is your source folder? Usually icons folder is kept under the project directly. You can move it out of the source folder and also specify it in the build.properties.

how to change text "Eclipse" to some other text say "AshuEclipse" in the Header left hand corner?

How to change text "Eclipse" to some other text say "AshuEclipse" in the Header left hand corner?
Note: I dont want ot change the header to show workspace ,but I want to change the word Eclipse itself.
Plz suggest.
One solution an one workaround:
Solution (in theory, not tested)
The main Eclipse Windows is a WorkbenchWindow for the org.eclipse.ui plugin. It is created by the platform plugin.
If you look into the resources files within the org.eclipse.platform, you could see some files able to keep this value (for you to change it)
I have found:
eclipse-3.5.1\eclipse\plugins\org.eclipse.platform_3.3.201.v200909170800\about.properties
It contains:
blurb=Eclipse Platform\n\
eclipse-3.5.1\eclipse\plugins\org.eclipse.platform_3.3.201.v200909170800\plugin.properties
With:
pluginName=Eclipse Platform
providerName=Eclipse.org
productName=Eclipse Platform
productBlurb=Eclipse Platform\n\
Try and modify those values to see if the display can change. (I would bet on plugin.properties productBlurb)
Just tested: it does not change the display, so you need to explore some of the jars in the plugins directory of eclipse. In theory, you could change one of its resource file...
Workaround (if the previous section does not work)
My eclipse3.5 actually displays the name of the current perspective.
For instance; the Php perspective would be displayed in the header left hand corner:
alt text http://blog.wampserver.com/wp-content/uploads/2009/08/eclipse_perspective_debug.gif
So one solution would be to save your favorite perspective as "Ashu - Php Debug", and you would get what you want.
(see "create your own perspective" article)
alt text http://www.javalobby.org/images/postings/rj/eclipse_perspective/1.gif
That would need to be redefined for every perspective you are usually using.
And it would still have "Eclipse" at the end...
Preferences > General > Workspace > Workspace name
Right click on eclipse shortcut and go to properties.
Change target url text.
-> C:\your eclipe folder\eclipse.exe -showlocation <em>YOURTITLE</em>