How to set mvsCodePage property by default for certain text files?
![]()
I'm trying to find a way to set the mvsCodePage property to a default value for certain text files.
I've defined the following in a plugin: <extension point="org.eclipse.core.contenttype.contentTypes"> <content-type base-type="org.eclipse.core.runtime.text" file-extensions="type1,type2" id="com.content.my" name="MyContent" priority="high" default-charset="UTF-8"> <property name="mvsCodePage" value="IBM-1047"/> </content-type> </extension> Whenever you create a new file of the form *.type1 and *.type2 it gets assigned to MyContent. As such the file will have a default charset of UTF-8. I also want the file to have a default value for mvsCodePage but this setting doesn't seem to be taking. So how do I set the mvsCodePage property on new files by default? Update: Looks like IFileItem inherits a method, setUserProperty that can be invoked. So if there's an extension point that will allow my code to get notified when a new file is added under source control, preferably after the content type is set, I could potentially retrieve the properties from the content type. Assuming I use some kind of convention like "jazz.user.propertyName=propertyValue" I could strip off the jazz.user and set propertyName=propertyValue on the IFileItem. So is there such an extension point? It's hard to find doc on the client API. |
One answer
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.