Plug-in fragment to overwrite a view [message #686501] |
Wed, 22 June 2011 07:26  |
Eclipse User |
|
|
|
Hello,
I try to create a plug-in fragment that would overwrite an existing view, declared in the host plug-in.
Basically, I created a plug-in project (named HostProjet), using template Hello World example: "plug-in with a view" in the new project wizard dialog.
Then I created a fragment project, which HostProjet is the host plug-in.
In this fragment project, I declared the same view using extension org.eclipse.ui.views, and I used the same ID, the same category ... all is similar.
I copied SampleView.java from HostProject to my fragment project to change a graphical element to quickly see my change.
Then, when I launch my application, HostProject is running, the fragment is "Resolved", but I don't see my graphical change. My fragment does'nt seems to be used.
Do you know why ?
Is it possible ?
I tried this simple test, because it can be usefull to overwrite a dialog or a view behaviour placed in a existing plug-in.
Thanks in advance.
Valouee
|
|
|
Re: Plug-in fragment to overwrite a view [message #690381 is a reply to message #686501] |
Wed, 29 June 2011 08:56  |
Eclipse User |
|
|
|
I'm not sure , but i think fragments are platform specific and they are only executed when a certain criteria is not met by the host plugin , for example if the default locale of your enviroment is en_US and your host plugin has some properties files in it caled SomeThing.properties ,when a create a fragment with a properties file called SomeThing.properties . and you run your plugin you will notice that the file from the host plugin is selected .. however when you create a file in your fragment called SomeThing_fr_FR.properties and then you set your enviroment Locale to fr_FR you will notice that the file that is in your fragment will be selected .
another example is when you have some platform dependent library ( e.g windows xp.DLL and windows vista .DLL )
you can not put windows xp.DLL library in your host plugin and then you try to override them with windows vista.DLL library using a fragment and expect it to run on windows vista. the correct way of doing this is to put windows xp.DLL in a fragment plugin and put the windows vista.DLL in another fragment plugin and let your host plugin platform independent .
and one more thing . can never override an existing class in your host plug-in .
this leads my to conclude that no you can not override and existing view in your plugin simply because it is designed not to be overridden , thats why there are extension points if they are declared that means you can override the host plugin implementation .
but hey it is only my conclusion i could be wrong . if i am please share with us the solution when you get it .
|
|
|
Powered by
FUDForum. Page generated in 0.13096 seconds