Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » How to invoke XML formatter from Plugin
How to invoke XML formatter from Plugin [message #179449] Wed, 20 September 2006 18:08 Go to next message
Michael Giroux is currently offline Michael GirouxFriend
Messages: 287
Registered: July 2009
Senior Member
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 18:15 Go to previous messageGo to next message
Michael Giroux is currently offline Michael GirouxFriend
Messages: 287
Registered: July 2009
Senior Member
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 21:57 Go to previous message
Michael Giroux is currently offline Michael GirouxFriend
Messages: 287
Registered: July 2009
Senior Member
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
Previous Topic:XML Schema editor
Next Topic:Can I upgrade to WTP 1.5.1 using update manager?
Goto Forum:
  


Current Time: Sat Nov 23 08:15:20 GMT 2024

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

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

Back to the top