[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform] Re: Using Plug-in properties API?

Chris,

If I define a property within a plugin.properties file. For instance:
plugin.properties
views.myview.name = My View

and in plugin_de.properties
views.myview.name = Meine Ansicht

In plugin.xml I define:
<view name="%views.myview.name/>

If i do that, my views title will become 'My View' or 'Meine Ansicht' dependant on enviroments settings.

Now, I've further strings used within the MyView class. For instacne a labels text. Because it is quite handy to have all strings belonging to a class at just one place, I want to store the labels text also inside the propertiy file.
Just like:
plugin.properties
views.myview.name = My View
views.myview.label.text = A Label Text


and in plugin_de.properties
views.myview.name = Meine Ansicht
views.myview.label.text = Eine Namesinschrift

Now I'm at the point wher I first wrote my post.
I want to assign the string stored in the property file to the labels text.
Label label = new Label(parent SWT.NONE);
label.setText(???)

My problem is, that I do not know how to access the property file using Eclipse API.
I offcause I could use label.setText("%views.myview.label.text"), but this would just set the labels text to "%views.myview.label.text" and not to the value assigned in the file ("A Label Text", or "Eine Namesinschrift")


Hope I could make myself clear this time :)

Jan