Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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.

0 votes



One answer

Permanent link
Hi Roan,

The mvsCodePage is a user property and there is no extension point for it that would allow you to set this property automatically.
But perhaps you can write some kind of script which for example runs Command Line Interface (see the property set command).

0 votes

Comments

I can set the property manually via the eclipse client so setting the property is not the issue; I want it to get set by default for new files of a certain type. I was wondering more so if there is an extension point that I could extend that would allow my plugin to get notified when a new jazz file is created, preferably after the content type is set. Upon notification, I can set the user property.

Your answer

Register or log in to post 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 12,023
× 70

Question asked: Jan 30 '14, 3:36 p.m.

Question was seen: 5,647 times

Last updated: Feb 06 '14, 10:00 a.m.

Confirmation Cancel Confirm