Help on the help [message #50871] |
Sun, 30 March 2003 21:49  |
Eclipse User |
|
|
|
In some of the introductory material on plugin development there is an
abundance of samples from plugin.xml files where a string starts with a
percent '%' sign; such as
label="%PopupMenus.action"
I couldn't find this explained anywhere. Would someone please explain
its significance.
Thanks,
- Paul
|
|
|
Re: Help on the help [message #50955 is a reply to message #50871] |
Mon, 31 March 2003 10:27   |
Eclipse User |
|
|
|
Originally posted by: daniel.megert.gmx.net
Paul Glezen wrote:
> In some of the introductory material on plugin development there is an
> abundance of samples from plugin.xml files where a string starts with
> a percent '%' sign; such as
>
> label="%PopupMenus.action"
>
> I couldn't find this explained anywhere. Would someone please explain
> its significance.
A string that starts with a percent sign stands for an externalised
string. The corresponding string is defined in a properties file. In
your example the plugin.properties file would contain:
PopupMenus.action= <externalised string goes here>
HTH
Dani
|
|
|
Re: Help on the help [message #51288 is a reply to message #50955] |
Wed, 02 April 2003 21:50   |
Eclipse User |
|
|
|
I was hoping that the % implied a property file interpretation. But I
couldn't get it to work. I have a portion of my plugin config that
looks like
============== plugin.xml =====================
<menu
label="%Tools.menuName"
path="additions"
id="com.xyz.plugins.earscript.XYZMenu">
============== plugin.xml ======================
and a property file entry that looks like
Tools.menuName=XYZ Tools
But when I run it, the menu name is
%Tools.menuName
As a sanity check, I print the value of
EarscriptPlugin.getResourceString("Tools.menuName")
and I see "XYZ Tools". So one of my helper classes was able to find the
property. Is there an extra method on the plugin class that the Eclipse
runtime looks for when resolving % references in the plugin XML?
- Paul
|
|
|
Re: Help on the help [message #51314 is a reply to message #51288] |
Thu, 03 April 2003 02:34   |
Eclipse User |
|
|
|
Originally posted by: daniel.megert.gmx.net
Paul Glezen wrote:
> I was hoping that the % implied a property file interpretation. But I
> couldn't get it to work. I have a portion of my plugin config that
> looks like
>
> ============== plugin.xml =====================
> <menu
> label="%Tools.menuName"
> path="additions"
> id="com.xyz.plugins.earscript.XYZMenu">
> ============== plugin.xml ======================
>
> and a property file entry that looks like
>
> Tools.menuName=XYZ Tools
>
> But when I run it, the menu name is
>
> %Tools.menuName
>
> As a sanity check, I print the value of
>
> EarscriptPlugin.getResourceString("Tools.menuName")
>
> and I see "XYZ Tools". So one of my helper classes was able to find
> the property. Is there an extra method on the plugin class that the
> Eclipse runtime looks for when resolving % references in the plugin XML?
I see the following possible causes
1) spelling error in the properties file: its name must be
"plugin.properties" (for default language)
2) keys not equal (i.e. the key in the XML and the properties file don't
match
3) wrong location: it has to be in the same folder as plugin.xml
4) the file does not get packaged when you build the plug-in (missing
entry in build.properties)
Dani
|
|
|
Re: Help on the help [message #51426 is a reply to message #51314] |
Thu, 03 April 2003 11:08  |
Eclipse User |
|
|
|
I had problems 1 and 3 listed below. It's fine now.
Thanks,
- Paul
> I see the following possible causes
> 1) spelling error in the properties file: its name must be
> "plugin.properties" (for default language)
> 2) keys not equal (i.e. the key in the XML and the properties file don't
> match
> 3) wrong location: it has to be in the same folder as plugin.xml
> 4) the file does not get packaged when you build the plug-in (missing
> entry in build.properties)
>
> Dani
>
|
|
|
Re: Help on the help [message #592302 is a reply to message #50871] |
Mon, 31 March 2003 10:27  |
Eclipse User |
|
|
|
Originally posted by: daniel.megert.gmx.net
Paul Glezen wrote:
> In some of the introductory material on plugin development there is an
> abundance of samples from plugin.xml files where a string starts with
> a percent '%' sign; such as
>
> label="%PopupMenus.action"
>
> I couldn't find this explained anywhere. Would someone please explain
> its significance.
A string that starts with a percent sign stands for an externalised
string. The corresponding string is defined in a properties file. In
your example the plugin.properties file would contain:
PopupMenus.action= <externalised string goes here>
HTH
Dani
|
|
|
Re: Help on the help [message #592418 is a reply to message #50955] |
Wed, 02 April 2003 21:50  |
Eclipse User |
|
|
|
I was hoping that the % implied a property file interpretation. But I
couldn't get it to work. I have a portion of my plugin config that
looks like
============== plugin.xml =====================
<menu
label="%Tools.menuName"
path="additions"
id="com.xyz.plugins.earscript.XYZMenu">
============== plugin.xml ======================
and a property file entry that looks like
Tools.menuName=XYZ Tools
But when I run it, the menu name is
%Tools.menuName
As a sanity check, I print the value of
EarscriptPlugin.getResourceString("Tools.menuName")
and I see "XYZ Tools". So one of my helper classes was able to find the
property. Is there an extra method on the plugin class that the Eclipse
runtime looks for when resolving % references in the plugin XML?
- Paul
|
|
|
Re: Help on the help [message #592427 is a reply to message #51288] |
Thu, 03 April 2003 02:34  |
Eclipse User |
|
|
|
Originally posted by: daniel.megert.gmx.net
Paul Glezen wrote:
> I was hoping that the % implied a property file interpretation. But I
> couldn't get it to work. I have a portion of my plugin config that
> looks like
>
> ============== plugin.xml =====================
> <menu
> label="%Tools.menuName"
> path="additions"
> id="com.xyz.plugins.earscript.XYZMenu">
> ============== plugin.xml ======================
>
> and a property file entry that looks like
>
> Tools.menuName=XYZ Tools
>
> But when I run it, the menu name is
>
> %Tools.menuName
>
> As a sanity check, I print the value of
>
> EarscriptPlugin.getResourceString("Tools.menuName")
>
> and I see "XYZ Tools". So one of my helper classes was able to find
> the property. Is there an extra method on the plugin class that the
> Eclipse runtime looks for when resolving % references in the plugin XML?
I see the following possible causes
1) spelling error in the properties file: its name must be
"plugin.properties" (for default language)
2) keys not equal (i.e. the key in the XML and the properties file don't
match
3) wrong location: it has to be in the same folder as plugin.xml
4) the file does not get packaged when you build the plug-in (missing
entry in build.properties)
Dani
|
|
|
Re: Help on the help [message #592461 is a reply to message #51314] |
Thu, 03 April 2003 11:08  |
Eclipse User |
|
|
|
I had problems 1 and 3 listed below. It's fine now.
Thanks,
- Paul
> I see the following possible causes
> 1) spelling error in the properties file: its name must be
> "plugin.properties" (for default language)
> 2) keys not equal (i.e. the key in the XML and the properties file don't
> match
> 3) wrong location: it has to be in the same folder as plugin.xml
> 4) the file does not get packaged when you build the plug-in (missing
> entry in build.properties)
>
> Dani
>
|
|
|
Powered by
FUDForum. Page generated in 0.03805 seconds