Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » difference between IAutoEditStrategy and CTRL+ALT+F
difference between IAutoEditStrategy and CTRL+ALT+F [message #327128] Thu, 10 April 2008 16:16 Go to next message
Eclipse UserFriend
hi all, I have to implement a formatting stratégy and after some
reschears, I found two solution, the IAuteditStrategy and a shortcut
CTRL ALT F.

my question is simple, is this one use the other?? or I have to
implement 2 thing who do exacly the same thing??

thanks

a++
Re: difference between IAutoEditStrategy and CTRL+ALT+F [message #327132 is a reply to message #327128] Fri, 11 April 2008 05:16 Go to previous messageGo to next message
Eclipse UserFriend
julien wrote:
> hi all, I have to implement a formatting stratégy and after some
> reschears, I found two solution, the IAuteditStrategy and a shortcut
> CTRL ALT F.
>
> my question is simple, is this one use the other?? or I have to
> implement 2 thing who do exacly the same thing??
The auto-edit strategy is not the right thing to use for formatting. Not
sure what you mean with CTRL ALT F.

Dani
>
> thanks
>
> a++
Re: difference between IAutoEditStrategy and CTRL+ALT+F [message #327139 is a reply to message #327132] Fri, 11 April 2008 06:33 Go to previous messageGo to next message
Eclipse UserFriend
Daniel Megert a écrit :
> julien wrote:
>> hi all, I have to implement a formatting stratégy and after some
>> reschears, I found two solution, the IAuteditStrategy and a shortcut
>> CTRL ALT F.
>>
>> my question is simple, is this one use the other?? or I have to
>> implement 2 thing who do exacly the same thing??
> The auto-edit strategy is not the right thing to use for formatting. Not
> sure what you mean with CTRL ALT F.

it's when I wanna reformat all the document.
I found two choices
getContentFormatter in the source viewer and menu : sources->format
(CTRL+ALT+F) (with java plug) so with a action etc...

>
> Dani
>>
>> thanks
>>
>> a++

thanks a lot

a+++
Re: difference between IAutoEditStrategy and CTRL+ALT+F [message #327140 is a reply to message #327139] Fri, 11 April 2008 07:24 Go to previous messageGo to next message
Eclipse UserFriend
julien wrote:
> Daniel Megert a écrit :
>> julien wrote:
>>> hi all, I have to implement a formatting stratégy and after some
>>> reschears, I found two solution, the IAuteditStrategy and a shortcut
>>> CTRL ALT F.
>>>
>>> my question is simple, is this one use the other?? or I have to
>>> implement 2 thing who do exacly the same thing??
>> The auto-edit strategy is not the right thing to use for formatting.
>> Not sure what you mean with CTRL ALT F.
>
> it's when I wanna reformat all the document.
> I found two choices
> getContentFormatter in the source viewer and menu :
> sources->format (CTRL+ALT+F) (with java plug) so with a action etc...
One mentions code and the other a user action - doesn't make much sense
to me.

Dani
>
>>
>> Dani
>>>
>>> thanks
>>>
>>> a++
>
> thanks a lot
>
> a+++
Re: difference between IAutoEditStrategy and CTRL+ALT+F [message #327142 is a reply to message #327140] Fri, 11 April 2008 08:20 Go to previous messageGo to next message
Eclipse UserFriend
Daniel Megert a écrit :
> julien wrote:
>> Daniel Megert a écrit :
>>> julien wrote:
>>>> hi all, I have to implement a formatting stratégy and after some
>>>> reschears, I found two solution, the IAuteditStrategy and a shortcut
>>>> CTRL ALT F.
>>>>
>>>> my question is simple, is this one use the other?? or I have to
>>>> implement 2 thing who do exacly the same thing??
>>> The auto-edit strategy is not the right thing to use for formatting.
>>> Not sure what you mean with CTRL ALT F.
>>
>> it's when I wanna reformat all the document.
>> I found two choices
>> getContentFormatter in the source viewer and menu :
>> sources->format (CTRL+ALT+F) (with java plug) so with a action etc...
> One mentions code and the other a user action - doesn't make much sense

I ll take a other way.
I wanna reformat all my document (open with my editor).
What I have to do?

My first idea was to implément the user action and go take the open
document and reformat the all (all of this without pass by the
getContentFormater)

but I found a thing called getContentFormatter and I don't see the link
between that and the user action. what is getContentFormater ??


thanks a++

> to me.
>
> Dani
>>
>>>
>>> Dani
>>>>
>>>> thanks
>>>>
>>>> a++
>>
>> thanks a lot
>>
>> a+++
Re: difference between IAutoEditStrategy and CTRL+ALT+F [message #327148 is a reply to message #327142] Fri, 11 April 2008 11:39 Go to previous messageGo to next message
Eclipse UserFriend
julien wrote:
> Daniel Megert a écrit :
>> julien wrote:
>>> Daniel Megert a écrit :
>>>> julien wrote:
>>>>> hi all, I have to implement a formatting stratégy and after some
>>>>> reschears, I found two solution, the IAuteditStrategy and a
>>>>> shortcut CTRL ALT F.
>>>>>
>>>>> my question is simple, is this one use the other?? or I have to
>>>>> implement 2 thing who do exacly the same thing??
>>>> The auto-edit strategy is not the right thing to use for
>>>> formatting. Not sure what you mean with CTRL ALT F.
>>>
>>> it's when I wanna reformat all the document.
>>> I found two choices
>>> getContentFormatter in the source viewer and menu :
>>> sources->format (CTRL+ALT+F) (with java plug) so with a action etc...
>> One mentions code and the other a user action - doesn't make much sense
>
> I ll take a other way.
> I wanna reformat all my document (open with my editor).
> What I have to do?
>
> My first idea was to implément the user action and go take the open
> document and reformat the all (all of this without pass by the
> getContentFormater)
>
> but I found a thing called getContentFormatter and I don't see the
> link between that and the user action. what is getContentFormater ??
You have to do both: you have to provide the action and you have to
provide a content formatter:

The action in your editor will look similar to this:

action= new
TextOperationAction(JavaEditorMessages.getBundleForConstruct edKeys(),
"Format.", this, ISourceViewer.FORMAT); //$NON-NLS-1$
action.setActionDefinitionId(IJavaEditorActionDefinitionIds. FORMAT);
setAction("Format", action); //$NON-NLS-1$
markAsStateDependentAction("Format", true); //$NON-NLS-1$
markAsSelectionDependentAction("Format", true); //$NON-NLS-1$
PlatformUI.getWorkbench().getHelpSystem().setHelp(action,
IJavaHelpContextIds.FORMAT_ACTION);

Then you need to implement your content formatter and return it in your
source viewer config:
see:
org.eclipse.jface.text.source.SourceViewerConfiguration.getC ontentFormatter(ISourceViewer)

Besides that you have to define a 'format' command and contribute the
menu (both via plugin.xml).

I suggest you look how it is done in org.eclipse.jdt.ui plug-in.


Dani
>
>
> thanks a++
>
>> to me.
>>
>> Dani
>>>
>>>>
>>>> Dani
>>>>>
>>>>> thanks
>>>>>
>>>>> a++
>>>
>>> thanks a lot
>>>
>>> a+++
Re: difference between IAutoEditStrategy and CTRL+ALT+F [message #327174 is a reply to message #327148] Sun, 13 April 2008 02:11 Go to previous message
Eclipse UserFriend
Daniel Megert a écrit :
> julien wrote:
>> Daniel Megert a écrit :
>>> julien wrote:
>>>> Daniel Megert a écrit :
>>>>> julien wrote:
>>>>>> hi all, I have to implement a formatting stratégy and after some
>>>>>> reschears, I found two solution, the IAuteditStrategy and a
>>>>>> shortcut CTRL ALT F.
>>>>>>
>>>>>> my question is simple, is this one use the other?? or I have to
>>>>>> implement 2 thing who do exacly the same thing??
>>>>> The auto-edit strategy is not the right thing to use for
>>>>> formatting. Not sure what you mean with CTRL ALT F.
>>>>
>>>> it's when I wanna reformat all the document.
>>>> I found two choices
>>>> getContentFormatter in the source viewer and menu :
>>>> sources->format (CTRL+ALT+F) (with java plug) so with a action etc...
>>> One mentions code and the other a user action - doesn't make much sense
>>
>> I ll take a other way.
>> I wanna reformat all my document (open with my editor).
>> What I have to do?
>>
>> My first idea was to implément the user action and go take the open
>> document and reformat the all (all of this without pass by the
>> getContentFormater)
>>
>> but I found a thing called getContentFormatter and I don't see the
>> link between that and the user action. what is getContentFormater ??
> You have to do both: you have to provide the action and you have to
> provide a content formatter:
>
> The action in your editor will look similar to this:
>
> action= new
> TextOperationAction(JavaEditorMessages.getBundleForConstruct edKeys(),
> "Format.", this, ISourceViewer.FORMAT); //$NON-NLS-1$
> action.setActionDefinitionId(IJavaEditorActionDefinitionIds. FORMAT);
> setAction("Format", action); //$NON-NLS-1$
> markAsStateDependentAction("Format", true); //$NON-NLS-1$
> markAsSelectionDependentAction("Format", true); //$NON-NLS-1$
> PlatformUI.getWorkbench().getHelpSystem().setHelp(action,
> IJavaHelpContextIds.FORMAT_ACTION);
>
> Then you need to implement your content formatter and return it in your
> source viewer config:
> see:
> org.eclipse.jface.text.source.SourceViewerConfiguration.getC ontentFormatter(ISourceViewer)
>
>
> Besides that you have to define a 'format' command and contribute the
> menu (both via plugin.xml).
>
> I suggest you look how it is done in org.eclipse.jdt.ui plug-in.
>
>
> Dani
>>

thanks, but there is something I always don't understand.
when the contentFormatter is called??
the source -> format is called when I click on that (easy)

buet when the content format is used in the jdt?? when I tape a simple
hello world by example. is there any moment when I use this property??


thanks

a+++



>>
>> thanks a++
>>
>>> to me.
>>>
>>> Dani
>>>>
>>>>>
>>>>> Dani
>>>>>>
>>>>>> thanks
>>>>>>
>>>>>> a++
>>>>
>>>> thanks a lot
>>>>
>>>> a+++
Previous Topic:Teneo installation corrupts basic Ant installation
Next Topic:building plugin template for eclipse 3.3
Goto Forum:
  


Current Time: Tue Mar 18 09:02:18 EDT 2025

Powered by FUDForum. Page generated in 0.04364 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top