Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Eclipse customization(How to change default settings in order to create a customized distribution.)
icon1.gif  Eclipse customization [message #819042] Mon, 12 March 2012 12:17 Go to next message
Raphael Moita is currently offline Raphael MoitaFriend
Messages: 25
Registered: September 2011
Junior Member
Hello everybody,

I'm trying to figure out what is the best way to customized a eclipse instalation in order to change some simple default settings like the option "Show line numbers" (Preferences > Genereal > Text Editors) to be checked by default, change "Source folder name" (Preferences > Java > Build Path) from "src" to any other name I'd like to, pre-configure the CVS Repository, etc.

I'd also like to include some code snippets into this customized distribution.

The only way to change default such values I know is creating a plugin that runs at Eclipse startup and does the "magic" through IEclipsePreferences class, but I personally don't like and thing it is too time consuming implementation in order to simply change a preference value.

So, I'm looking for any other customization solution where I could only, maybe, change some Xml's/properties values in the Eclipse configuration without programmatically stuff. Is that possible?!

I'd apreciate any help/suggestion on that point
Thanks in advance

Regards
--
Raphael Moita
Re: Eclipse customization [message #819080 is a reply to message #819042] Mon, 12 March 2012 13:17 Go to previous messageGo to next message
Martin Skorsky is currently offline Martin SkorskyFriend
Messages: 112
Registered: July 2009
Senior Member
Hello Raphael,

in the product_customization.ini you can declare preferences.
E.g.
# Setting the 'Show Heap Status'
org.eclipse.ui/SHOW_MEMORY_MONITOR=true

Using this file is configured in the extension point="org.eclipse.core.runtime.products".

Regards,
Martin
Re: Eclipse customization [message #819168 is a reply to message #819080] Mon, 12 March 2012 15:26 Go to previous messageGo to next message
Raphael Moita is currently offline Raphael MoitaFriend
Messages: 25
Registered: September 2011
Junior Member
Hi Martin,

Is the use of this file (C:\eclipse\plugins\org.eclipse.platform_3.7.1.v201109091335\plugin_customization.ini) just a matther of edit the values I want to change and restart Eclipse or is it a case where I have to create a plugin that contrubutes with org.eclipse.core.runtime.products and then point to a new customized plugin_customization.ini?

I read some articles that address the use of this file but the way they use is not clear to me.

If it's not so complex, could you show me a "dummy" example of how to change a simple value in a brand new eclipse distribution please? Which steps should I follow?

Thanks a million for the reply

--
Raphael Moita
Re: Eclipse customization [message #819171 is a reply to message #819168] Mon, 12 March 2012 15:31 Go to previous messageGo to next message
Martin Skorsky is currently offline Martin SkorskyFriend
Messages: 112
Registered: July 2009
Senior Member
You have to create your own contribution to org.eclipse.core.runtime.products.

The preference values in product_customization.ini are only evaluated for new workspaces. Otherwise they would overwrite changes of the user.
Re: Eclipse customization [message #819265 is a reply to message #819171] Mon, 12 March 2012 17:42 Go to previous messageGo to next message
Raphael Moita is currently offline Raphael MoitaFriend
Messages: 25
Registered: September 2011
Junior Member
Sorry Martin, but I think I don't know what consists on contributing to
org.eclipse.core.runtime.products.

I've created a simple example in order to validade/try it. Please point me out where I'm doing wrong.

I created a simple plugin that contains this plugin.xml configuration:

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
      <extension point="org.eclipse.core.runtime.products">
      <product application="org.eclipse.ui.ide.workbench" name="Raphael">
         <property name="aboutText" value="About Eclipse SDK Raphael Moita"/>
	 <property name="aboutImage" value="icons/Test.png"/>
      </product>
   </extension>   
</plugin>


My ideia is simply changing something in the About dialog.
Then I packaged de plugin (export jar) and put it in the droppin eclipse folder. I supposed such thing would change the text and I could see that happening when I created a new workspace and opened About dialog. But it didn't happen!

Is it make sense?
Thanks for your patience! Smile

--
Raphael Moita

[Updated on: Mon, 12 March 2012 18:05]

Report message to a moderator

Re: Eclipse customization [message #819686 is a reply to message #819265] Tue, 13 March 2012 07:39 Go to previous messageGo to next message
Martin Skorsky is currently offline Martin SkorskyFriend
Messages: 112
Registered: July 2009
Senior Member
Raphael, I think, you are on a good way.

Add an id to your extension and start your Eclipse with this product id.

plugin.xml looks like:
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
      <extension 

            id="my.new.product"

            point="org.eclipse.core.runtime.products">
      <product application="org.eclipse.ui.ide.workbench" name="Raphael">
         <property name="aboutText" value="About Eclipse SDK Raphael Moita"/>
	 <property name="aboutImage" value="icons/Test.png"/>

         <property name="preferenceCustomization" value="product_customization.ini"/>

      </product>
   </extension>   
</plugin>


Start Eclipse with
eclipse.exe ... -product my.new.product

Regards,

Martin
Re: Eclipse customization [message #820111 is a reply to message #819686] Tue, 13 March 2012 18:44 Go to previous messageGo to next message
Raphael Moita is currently offline Raphael MoitaFriend
Messages: 25
Registered: September 2011
Junior Member
Great!!!

It finally did something! Thanks Martin

But before throwing my last big thanks let me make one (or more) last question ...

What is the best way to find out the correct text that represents a Eclipse item I wanna change using my product to put into product_customization.ini file?

So far I found these ones: help.eclipse.org/helios/topic/org.eclipse.platform.doc.isv/reference/api/constant-values.html

For example, I'd like to have an Eclipse distribution where, for example, "Team > CVS > Ext Connection Method > CVS_RSH" field shows up pre-configured with some value I'd define, but I have no ideia which String represents this item.

Other point is the capability of "pre-import" a code-formatter file (Java > Code Style > Formatter)

Regards
--
Raphael Moita
Re: Eclipse customization [message #820506 is a reply to message #820111] Wed, 14 March 2012 08:05 Go to previous messageGo to next message
Martin Skorsky is currently offline Martin SkorskyFriend
Messages: 112
Registered: July 2009
Senior Member
To find the name of the preference you want to customize look at
<your workspace>\.metadata\.plugins\org.eclipse.core.runtime\.settings

This folder contains the preference stores.
E.g. the preferences of org.eclipse.pde.ui are stored in file org.eclipse.pde.ui.prefs, but only the non-defaults.
So, set the preference you want to some non-default and examine the file.

This is for workspace (instance) based preferences.
For preferences at installation level search the configuration folder.
Re: Eclipse customization [message #820933 is a reply to message #820506] Wed, 14 March 2012 19:00 Go to previous messageGo to next message
Raphael Moita is currently offline Raphael MoitaFriend
Messages: 25
Registered: September 2011
Junior Member
First of all Martin, sorry for lying to you when I said that was my last question! Very Happy

You have helped me a lot buddy, thanks again! That said, let me send you other little question Wink

Martin Skorsky wrote on Wed, 14 March 2012 04:05
To find the name of the preference you want to customize look at
<your workspace>\.metadata\.plugins\org.eclipse.core.runtime\.settings

This folder contains the preference stores.
E.g. the preferences of org.eclipse.pde.ui are stored in file org.eclipse.pde.ui.prefs, but only the non-defaults.
So, set the preference you want to some non-default and examine the file.


Got it, cool! But, I'm facing a scenario where it doesn't work. I'm tryng to pre-configure a Repository Location but in this case nothing happens. I got this repository configuration:

repositories/%ext%.@cvsp.zipa%%cvsroot/location=\:ext\:.@cvsp.zipa\:/cvsroot


from .metadata\.plugins\org.eclipse.core.runtime\.settings\org.eclipse.team.cvs.core.prefs like you said before and put it on
product_customization.ini

org.eclipse.team.cvs.core/repositories/%ext%.@cvsp.zipa%%cvsroot/location=\\:ext\\:.@cvsp.zipa\\:/cvsroot


Does it have the same way to set a value or is it a different scenario?

Other point I haven't found a way to execute is the capability of showing Repository View since changes, when I change manually, take place on a XML file on .metadata\.plugins\org.eclipse.ui.workbench\dialog_settings.xml instead of a .prefs file like the others.

Martin Skorsky wrote on Wed, 14 March 2012 04:05
This is for workspace (instance) based preferences.
For preferences at installation level search the configuration folder.


What kind of preferences could I modify at instalation level?

That's it (ok ok, I'm a big liar Very Happy))

Best Regards
--
Raphael Moita
Re: Eclipse customization [message #821322 is a reply to message #820933] Thu, 15 March 2012 07:40 Go to previous messageGo to next message
Martin Skorsky is currently offline Martin SkorskyFriend
Messages: 112
Registered: July 2009
Senior Member
Raphael,

with pre-configuration of the CVS repositories I cannot help.
I found the list of repositories in org.eclipse.team.cvs.core.prefs as you said.
May be there are other settings needed to activate these.

Preferences at installation level are the list of recent workspaces and others.
See <eclipse>/configuration/.settings/org.eclipse.ui.prefs

regards,

Martin
Re: Eclipse customization [message #821691 is a reply to message #821322] Thu, 15 March 2012 17:41 Go to previous message
Raphael Moita is currently offline Raphael MoitaFriend
Messages: 25
Registered: September 2011
Junior Member
Martin,

I'd like to thank you for all your attention and time spent on helping me on it. I really apreciated it.

Thank you very very much my friend!

Hope I can help you in something too in the future.

All the best
--
Raphael Moita
Previous Topic:Eclipse Source Builds
Next Topic:[LTK Refactoring] How to control the order of Refactoring are executed
Goto Forum:
  


Current Time: Fri Apr 19 03:22:41 GMT 2024

Powered by FUDForum. Page generated in 0.02692 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top