[HELP] add template formatting in javaeditor exemple(always) [message #328500] |
Mon, 26 May 2008 13:34  |
Eclipse User |
|
|
|
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+++
|
|
|
|
Re: [HELP] add template formatting in javaeditor exemple(always) [message #328948 is a reply to message #328637] |
Sat, 07 June 2008 13:26  |
Eclipse User |
|
|
|
Daniel Megert a écrit :
> julien wrote:
>> 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.
> Surprise. This is only the preference. You have to read that preference
> and then do the formatting yourself.
sorry for the time response, but make two things in a same time is not a
good idea.
So ok, I have to make the indent myself but where???
I ll suppose I have two do that in the subclasses of
TemplateCompletionProcessor
but is there any methods who do specialy that or have to do that in the
protected Template[] getTemplates(String contextTypeId) {}
..
thnaks
a+++
>
> Dani
>>
>>
>> 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+++
>>
>>
>>
>>
>>
>>
|
|
|
Powered by
FUDForum. Page generated in 0.03840 seconds