[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform] [HELP] add template formatting in javaeditor exemple(always)

hi all

always trying to put template formatting (grrrrr, I lost my mind), I decided to put that on the
java editor example and surprise,... that doesnt work.



What I ve done is

in the TemplatesPreferencePage I added

	private String FORMATTER_PREFERENCE_KEY = "my.formatter.preference.key";
	
	
	protected String getFormatterPreferenceKey() {
		return FORMATTER_PREFERENCE_KEY;
	}

	protected boolean isShowFormatterSetting() {
		return true;
	}

and that add the button in the preference page (and sauvegarde it). but that doesn't change anything in the editor.


in the XMLConfiguration I put the following code


public IAutoEditStrategy[] getAutoEditStrategies(
ISourceViewer sourceViewer, String contentType) {

return new IAutoEditStrategy[]{new DefaultIndentLineAutoEditStrategy() };
}



and that doesn't anything.


in fact, the getAutoEditStrategies serve to nothing. iether the getAutoEditStrategies is implemented or not, I have the indented line .




So if there any otherthing  to implement to get the templtate formatting.

thanks

a+++