Need Information in EditorRegistry [message #66415] |
Sat, 07 June 2003 14:59 |
MorPheus Messages: 57 Registered: July 2009 |
Member |
|
|
Hi,
I have downloaded the source code of eclipse and I found that
EditorRegistry.java have one method called setProductDefaults.It also has
explanation saying that the method uses properties.ini file for setting the
default editors(see the comment).But I don't find any properties.ini in my
eclipse folder.Do I have to create one or it is there already.Please
explain.I read the properties.ini file is used to set the default editor.If
that is the case how to do that.?
MorPheus
//snippets from EditorRegistry.java
/**
* Set the default editors according to the preference store which
* can be overwritten in the file properties.ini.
*/
private void setProductDefaults(String defaultEditors) {
if(defaultEditors == null || defaultEditors.length() == 0)
return;
StringTokenizer extEditors = new StringTokenizer(defaultEditors,new
Character(IPreferenceConstants.SEPARATOR).toString());
while(extEditors.hasMoreTokens()) {
String extEditor = extEditors.nextToken().trim();
int index = extEditor.indexOf(':');
if(extEditor.length() < 3 || index <= 0 || index >= (extEditor.length() -
1)) {
//Extension and id must have at least one char.
WorkbenchPlugin.log("Error setting default editor. Could not parse '" +
extEditor + "'. Default editors should be specified as
'*.ext1:editorId1;*.ext2:editorId2'"); //$NON-NLS-1$ //$NON-NLS-2$
return;
}
String ext = extEditor.substring(0,index).trim();
String editorId = extEditor.substring(index + 1).trim();
FileEditorMapping mapping = getMappingFor(ext);
if(mapping == null) {
WorkbenchPlugin.log("Error setting default editor. Could not find mapping
for '" + ext + "'."); //$NON-NLS-1$ //$NON-NLS-2$
continue;
}
EditorDescriptor editor = (EditorDescriptor)findEditor(editorId);
if(editor == null) {
WorkbenchPlugin.log("Error setting default editor. Could not find editor:
'" + editorId + "'."); //$NON-NLS-1$ //$NON-NLS-2$
continue;
}
mapping.setDefaultEditor(editor);
}
}
|
|
|
Powered by
FUDForum. Page generated in 0.02902 seconds