Access Persistent Property value from outside of PropertyPage [message #299460] |
Fri, 17 February 2006 07:21  |
Eclipse User |
|
|
|
Originally posted by: zhengxie.ie.ibm.com
I have used the new plugin wizard creatd a plugin with property dialog ( a
subclass of PropertyPage), in it I use the following code to persist a
property.
public class MyPropertyPage extends PropertyPage {
.....
public boolean performOk() {
// store the value in the outputSqlFile text field
try {
((IResource) getElement()).setPersistentProperty(
new QualifiedName(Platform.getBundle("com.myPlugin").getSymbolicName(),
OUTPUT_SQL_FILE_PROPERTY),
outputSqlFileText.getText());
} catch (CoreException e) {
return false;
}
return true;
}
I need to get the persistent property value outside of MyPorpertyPage,
because the value needs to be available even the user does not open the
properties dialog. How can I do it?
I have searched eclipse help, it says "Persistent properties are used to
store resource-specific information on disk. The value of a persistent
property is an arbitrary string. Your plug-in decides how to interpret the
string. The strings are intended to be short (under 2KB). "
But how do I access the property persisted on the PropertyPage, from
outside of the PropertyPage class?
Thanks a million.
Jenny
|
|
|
|
Powered by
FUDForum. Page generated in 0.38443 seconds