How to invoke XML formatter from Plugin [message #179449] |
Wed, 20 September 2006 14:08  |
Eclipse User |
|
|
|
Hi, I'm writing a plugin that will generate XML. The customer would like
the xml formatted. I've checked the SDK docs but do not see any mention of
a formatter.
Can someone point me to the WST API I can use from a plugin?
Thanks
Michael Giroux
|
|
|
Re: How to invoke XML formatter from Plugin [message #179457 is a reply to message #179449] |
Wed, 20 September 2006 14:15   |
Eclipse User |
|
|
|
I forgot to mention that I discovered
org.eclipse.wst.sse.ui.internal.actions.FormatActionDelegate by searching
the plugin registry,
but this is "interrnal". I'm looking for a public API.
If one does not exist, why not?
Michael
"Michael Giroux" <michael.giroux@bull.com> wrote in message
news:ees03j$hsn$1@utils.eclipse.org...
> Hi, I'm writing a plugin that will generate XML. The customer would like
> the xml formatted. I've checked the SDK docs but do not see any mention
> of a formatter.
>
> Can someone point me to the WST API I can use from a plugin?
>
> Thanks
> Michael Giroux
>
|
|
|
Re: How to invoke XML formatter from Plugin [message #179505 is a reply to message #179449] |
Wed, 20 September 2006 17:57  |
Eclipse User |
|
|
|
For the moment, I am using
org.eclipse.wst.sse.ui.internal.actions.FormatActionDelegate to accomplish
the formatting, but I have a couple of issues:
1. format(IProgressMonitor, IFile) is protected, so it is necessary to
extend FormatActionDelegate to expose a method that invokes format(). A
public API would really be appreciated.
2. The IProgressMonitor that is passed to format() is not notified when the
formatting is complete. The done() method is not called. It is not clear
if this is an issue or not. If format() blocks until the task is complete
then the caller knows the formatting is complete when the method returns.
In this case, why does the method require an IProgressMonitor? If the
method does not block, then I would think that it is a bug that the progress
monitor done() is not invoked. As far as I can see, the progress monitor
worked() method is invoked once at the start of formatting, and from then
on, the monitor is never used.
3. formatting options (indentation amount, and tab or space) is workspace
global. There is no project specific configuration.
Michael Giroux
|
|
|
Powered by
FUDForum. Page generated in 0.03688 seconds