#6 support Eclipse-nl structure from fragments in workspace

open-fixed
None
5
2007-09-15
2007-06-19
Anonymous
No

This patches:

NLPropertiesFileCreator.java
NewLocalePage.java
NLResourceFactory.java
ResourceFactory.java
StandardResourceFactory.java
plugin.xml

and adds
FragmentPropertiesFileCreator.java
FragmentResourceFactory.java
PDEUtils.java
ResourceFactoryDescriptor.java
ResourceFactory.exsd

The changes mainly include handling of contributed fragments containing translations, this extends the handling of the nl-folder within the same project

From a new extension point for resource factories a new resource factory is loaded if fragments contributing translations for the file to be opened are found.

Also, a newly created resource bundle is opened within RBE by default.

Discussion

  • the eclipse style patch

     
    Attachments
  • Uwe Voigt
    Uwe Voigt
    2007-06-19

    Logged In: YES
    user_id=582288
    Originator: NO

    oh, I had not been logged in...

     
  • Logged In: YES
    user_id=945603
    Originator: NO

    I'm working on this and have the patch building against the current CVS version.
    Still I have some things I'd like to discuss with uwe_ewald the original submitter.

     
    • assigned_to: nobody --> fleque
     
  • Logged In: YES
    user_id=945603
    Originator: NO

    The new FragmentResourceFactory only adds those resouces found in the fragment and not those found in the host. Imho the appropriate properties files from the host should be included as well. I will add this to new ResourceFactory.

     
  • Logged In: YES
    user_id=945603
    Originator: NO

    One more thing: The file-creator set for the new ResourceFactory create new mesage files in the fragment project. Imho we should ask the user here where to create it, either in the fragment or in the host project.

     
  • Uwe Voigt
    Uwe Voigt
    2007-09-13

    Logged In: YES
    user_id=582288
    Originator: NO

    Hi,

    >Imho the appropriate properties
    >files from the host should be included as well

    I don't think so because fragments are normally added to supply translations while the default language property resource bundle is located in the host. The behaviour you suggest should be provided by the NLResourceFactory I guess.

    For the case you add the 'translation from host plugin' functions in any way to the FragmentResourceFactory, then it is fair to ask the users which location they prefer to create bundle files in.

    Uwe

     
  • Logged In: YES
    user_id=945603
    Originator: NO

    Thanks for your comments Uwe.

    >>Imho the appropriate properties
    >>files from the host should be included as well

    >I don't think so because fragments are normally added to supply
    >translations while the default language property resource bundle is located
    >in the host. The behaviour you suggest should be provided by the
    >NLResourceFactory I guess.
    Hmm, right now the behaviour is as follows:
    When opening the default resource file in the host plugin, the editor will show only the bundles in the fragment plugin. This is quite irritating, I think as the file the user opened is the only file missing in the editor. I think I will make this configurable and make opening all the default.

    >For the case you add the 'translation from host plugin' functions in any
    >way to the FragmentResourceFactory, then it is fair to ask the users which
    >location they prefer to create bundle files in.
    I think this will be a preference setting as well.

     
  • Uwe Voigt
    Uwe Voigt
    2007-09-14

    Logged In: YES
    user_id=582288
    Originator: NO

    maybe it is rather a bug than conceptually wrong

    when I tested the code I used two case:
    - a host bundle with a plugin.properties file in the project root and a fragment bundle with a nl-folder in the project root which contains some folders with named by locales an that contain plugin.properties files

    - a host bundle with a messages.properties file located in a package folder under the source tree and a fragment bundle which contains messages_nn_nn.properties files located in exactly that package folder under the source tree. nn_nn means a locale string

    both cases function as expected: you can open either the default file or one of the translation files and see all bundles in the editor

    if you have detected a case where this does not work, please describe it. Maybe then I can help with that

    Uwe

     
  • Logged In: YES
    user_id=945603
    Originator: NO

    The patch with minor modifications is now in CVS, thanks Uwe for your contribution.
    Please review the new functionality if you have time.

    Regards
    Alex

     
    • status: open --> open-fixed
     
  • Uwe Voigt
    Uwe Voigt
    2007-09-17

    Logged In: YES
    user_id=582288
    Originator: NO

    I have tested both cases and first of them does not work well.
    There is an exception if one opens the resource bundle file from within a 'nl'-folder located in the fragment bundle. PartInitException (sorry, no trace) leads to NullPointerException if the shell wants to open the error dialog. I remember I had fixed that.
    Uwe

     
  • Logged In: YES
    user_id=945603
    Originator: NO

    I could reproduce that and hopefully now fixed all issues with the loading of resources from fragments.

    I've tested all 4 situations:
    - open standard property file from host
    - open standard property file from fragment
    - open property file in nl-structure from host
    - open property file in nl-structure from fragment

    Seems to work.