Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Technology Project and PMC » Help on the help
Help on the help [message #50871] Mon, 31 March 2003 02:49 Go to next message
Paul Glezen is currently offline Paul GlezenFriend
Messages: 60
Registered: July 2009
Member
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 15:27 Go to previous messageGo to next message
Eclipse UserFriend
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] Thu, 03 April 2003 02:50 Go to previous messageGo to next message
Paul Glezen is currently offline Paul GlezenFriend
Messages: 60
Registered: July 2009
Member
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 07:34 Go to previous messageGo to next message
Eclipse UserFriend
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 16:08 Go to previous message
Paul Glezen is currently offline Paul GlezenFriend
Messages: 60
Registered: July 2009
Member
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 15:27 Go to previous message
Eclipse UserFriend
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] Thu, 03 April 2003 02:50 Go to previous message
Paul Glezen is currently offline Paul GlezenFriend
Messages: 60
Registered: July 2009
Member
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 07:34 Go to previous message
Eclipse UserFriend
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 16:08 Go to previous message
Paul Glezen is currently offline Paul GlezenFriend
Messages: 60
Registered: July 2009
Member
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
>
Previous Topic:Eclipse won't open!
Next Topic:Free text search for multiple files (grep-like)
Goto Forum:
  


Current Time: Wed Jan 15 06:35:03 GMT 2025

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

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

Back to the top