GroIMP uses a bundle approach to link resources and Registry items.
Most resources used in GroIMP defined in property files are String.
The two main examples are:
/ui/commands/open.Name = &Open…
project.savequestion.title = Save Project project.savequestion.msg = The project {0} has been modified. Save changes?
The _project.savequestion.msg_ can be accesed with:
public static final I18NBundle I18N = I18NBundle.getInstance (UI.class); String VAR = "PROJECT NAME"; UI.I18N.msg ("project.savequestion.msg", VAR)
in this example, the _Resources.property_ file is at the root of the UI.class file, thus it can be accessed with _I18NBundle.getInstance (UI.class)_. In your plugin, you can access your _Resources.property_ by using one class of your package as long as both the .class and .property files are on the same level.
The VAR _PROJECT NAME_ is injected in the property message under {0}. The message can include any numer of parameters used like: _I18N.msg (PROPERTY_NAME, VAR1, VAR2, …)_.
GroIMP bundle also works with other object resources, such as Icon or Image.
In that case, the definition of the resource change slightly. For instance the registry command that define _undo for text_ has the properties:
<code> text.undo.Name = Undo text.undo.ShortDescription = Undo text.undo.Icon = \`icon actions/undo\` <code>
An _Icon_ is defined with _\`icon actions/undo\`_. First the \` symbol at the begining and end of the resource is used to define a non String resource. Then, the property is defined in two part separated by the first space:
GroIMP uses ResourcesConverter objects to load the given resource into the correct java object. See how to create a new Resource converter.